Skip to content

Commit 2c3096a

Browse files
committed
[CUDA,HIP] Fix UR_DEVICE_INFO_ATOMIC_*_CAPABILITIES query
We were returning `uint64_t` instead of `ur_memory_scope_capability_flags_t`.
1 parent 9f62123 commit 2c3096a

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

source/adapters/cuda/device.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
215215
int Major = 0;
216216
UR_CHECK_ERROR(cuDeviceGetAttribute(
217217
&Major, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, hDevice->get()));
218-
uint64_t Capabilities =
218+
ur_memory_scope_capability_flags_t Capabilities =
219219
(Major >= 7) ? UR_MEMORY_SCOPE_CAPABILITY_FLAG_WORK_ITEM |
220220
UR_MEMORY_SCOPE_CAPABILITY_FLAG_SUB_GROUP |
221221
UR_MEMORY_SCOPE_CAPABILITY_FLAG_WORK_GROUP |

source/adapters/hip/device.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -775,9 +775,10 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
775775
// Because scopes are hierarchical, wider scopes support all narrower
776776
// scopes. At a minimum, each device must support WORK_ITEM, SUB_GROUP and
777777
// WORK_GROUP. (https://github.com/KhronosGroup/SYCL-Docs/pull/382)
778-
uint64_t Capabilities = UR_MEMORY_SCOPE_CAPABILITY_FLAG_WORK_ITEM |
779-
UR_MEMORY_SCOPE_CAPABILITY_FLAG_SUB_GROUP |
780-
UR_MEMORY_SCOPE_CAPABILITY_FLAG_WORK_GROUP;
778+
ur_memory_scope_capability_flags_t Capabilities =
779+
UR_MEMORY_SCOPE_CAPABILITY_FLAG_WORK_ITEM |
780+
UR_MEMORY_SCOPE_CAPABILITY_FLAG_SUB_GROUP |
781+
UR_MEMORY_SCOPE_CAPABILITY_FLAG_WORK_GROUP;
781782
return ReturnValue(Capabilities);
782783
}
783784
case UR_DEVICE_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES: {

0 commit comments

Comments
 (0)