From 4f5d005a987d984c2ec7f91846b0b3c72dc5329a Mon Sep 17 00:00:00 2001 From: JackAKirk Date: Mon, 29 Jan 2024 05:33:55 -0800 Subject: [PATCH] Report that devices with cc >= sm_70 support seq_cst cuda ptx 6.0 memory consistency model is implemented in dpc++ for devices > sm_70. Signed-off-by: JackAKirk --- source/adapters/cuda/device.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/source/adapters/cuda/device.cpp b/source/adapters/cuda/device.cpp index acea59e1a1..a80b49dc5a 100644 --- a/source/adapters/cuda/device.cpp +++ b/source/adapters/cuda/device.cpp @@ -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: { @@ -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: {