Skip to content

Commit

Permalink
Move the device init to the platform
Browse files Browse the repository at this point in the history
  • Loading branch information
omarahmed1111 committed Oct 21, 2024
1 parent f8810c6 commit 4e0653b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 0 additions & 1 deletion source/adapters/opencl/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGet(ur_platform_handle_t hPlatform,
default:
return UR_RESULT_ERROR_INVALID_ENUMERATION;
}
UR_RETURN_ON_FAILURE(hPlatform->InitDevices());
try {
uint32_t AllDevicesNum = hPlatform->Devices.size();
uint32_t DeviceNumIter = 0;
Expand Down
1 change: 1 addition & 0 deletions source/adapters/opencl/platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ urPlatformGet(ur_adapter_handle_t *, uint32_t, uint32_t NumEntries,
for (uint32_t i = 0; i < NumPlatforms; i++) {
auto URPlatform =
std::make_unique<ur_platform_handle_t_>(CLPlatforms[i]);
UR_RETURN_ON_FAILURE(URPlatform->InitDevices());
Adapter->URPlatforms.emplace_back(URPlatform.release());
}
Adapter->NumPlatforms = NumPlatforms;
Expand Down

0 comments on commit 4e0653b

Please sign in to comment.