Skip to content

Commit b7bb745

Browse files
[UR] Handle INVALID_VALUE in OCL urPlatformGet (#15779)
Pre-commit MR for: oneapi-src/unified-runtime#2227 As there is a spec change in UR, adapter handling code has been updated - it no longer tries to populate the platform list if it would be empty (otherwise both "destination" pointers could be null, which is now illegal). This fixes a bug Intel tracks internally as URT-831 Co-authored-by: Aaron Greig <aaron.greig@codeplay.com>
1 parent 4950917 commit b7bb745

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sycl/source/detail/adapter.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,10 @@ class Adapter {
100100
uint32_t platformCount = 0;
101101
call<UrApiKind::urPlatformGet>(&MAdapter, 1, 0, nullptr, &platformCount);
102102
UrPlatforms.resize(platformCount);
103-
call<UrApiKind::urPlatformGet>(&MAdapter, 1, platformCount,
104-
UrPlatforms.data(), nullptr);
103+
if (platformCount) {
104+
call<UrApiKind::urPlatformGet>(&MAdapter, 1, platformCount,
105+
UrPlatforms.data(), nullptr);
106+
}
105107
// We need one entry in this per platform
106108
LastDeviceIds.resize(platformCount);
107109
});

0 commit comments

Comments
 (0)