Skip to content

Commit

Permalink
Merge pull request oneapi-src#1291 from JackAKirk/cuda-seq-cst-b
Browse files Browse the repository at this point in the history
[CUDA] Report that devices with cc >= sm_70 support seq_cst
  • Loading branch information
kbenzie authored Mar 18, 2024
2 parents db4b0c1 + 4f5d005 commit 29ee45c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions source/adapters/cuda/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,13 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
UR_MEMORY_ORDER_CAPABILITY_FLAG_ACQUIRE |
UR_MEMORY_ORDER_CAPABILITY_FLAG_RELEASE |
UR_MEMORY_ORDER_CAPABILITY_FLAG_ACQ_REL;

int Major = 0;
UR_CHECK_ERROR(cuDeviceGetAttribute(
&Major, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, hDevice->get()));
if (Major >= 7)
Capabilities |= UR_MEMORY_ORDER_CAPABILITY_FLAG_SEQ_CST;

return ReturnValue(Capabilities);
}
case UR_DEVICE_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES: {
Expand Down Expand Up @@ -228,6 +235,13 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
UR_MEMORY_ORDER_CAPABILITY_FLAG_ACQUIRE |
UR_MEMORY_ORDER_CAPABILITY_FLAG_RELEASE |
UR_MEMORY_ORDER_CAPABILITY_FLAG_ACQ_REL;

int Major = 0;
UR_CHECK_ERROR(cuDeviceGetAttribute(
&Major, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, hDevice->get()));
if (Major >= 7)
Capabilities |= UR_MEMORY_ORDER_CAPABILITY_FLAG_SEQ_CST;

return ReturnValue(Capabilities);
}
case UR_DEVICE_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES: {
Expand Down

0 comments on commit 29ee45c

Please sign in to comment.