@@ -1335,7 +1335,11 @@ pi_result piextPlatformCreateWithNativeHandle(pi_native_handle NativeHandle,
1335
1335
// Return NULL if no such PI device found.
1336
1336
pi_device _pi_platform::getDeviceFromNativeHandle (ze_device_handle_t ZeDevice) {
1337
1337
1338
- std::lock_guard<std::mutex> Lock (this ->PiDevicesCacheMutex );
1338
+ pi_result Res = populateDeviceCacheIfNeeded (Platform);
1339
+ if (Res != PI_SUCCESS) {
1340
+ return nullptr ;
1341
+ }
1342
+
1339
1343
auto it = std::find_if (PiDevicesCache.begin (), PiDevicesCache.end (),
1340
1344
[&](std::unique_ptr<_pi_device> &D) {
1341
1345
return D.get ()->ZeDevice == ZeDevice;
@@ -2029,6 +2033,9 @@ pi_result piDevicePartition(pi_device Device,
2029
2033
2030
2034
if (OutDevices) {
2031
2035
// TODO: Consider support for partitioning to <= total sub-devices.
2036
+ // Currently supported partitioning (by affinity domain/numa) would always
2037
+ // partition to all sub-devices.
2038
+ //
2032
2039
PI_ASSERT (NumDevices == Device->SubDevices .size (), PI_INVALID_VALUE);
2033
2040
2034
2041
for (uint32_t I = 0 ; I < NumDevices; I++) {
@@ -2105,10 +2112,6 @@ pi_result piextDeviceCreateWithNativeHandle(pi_native_handle NativeHandle,
2105
2112
PI_ASSERT (NativeHandle, PI_INVALID_VALUE);
2106
2113
PI_ASSERT (Platform, PI_INVALID_PLATFORM);
2107
2114
2108
- pi_result Res = populateDeviceCacheIfNeeded (Platform);
2109
- if (Res != PI_SUCCESS) {
2110
- return Res;
2111
- }
2112
2115
auto ZeDevice = pi_cast<ze_device_handle_t >(NativeHandle);
2113
2116
2114
2117
// The SYCL spec requires that the set of devices must remain fixed for the
0 commit comments