Skip to content

Commit 7c9f616

Browse files
author
Andrew Lamzed-Short
authored
[SYCL] atomic_memory_order_capabilities query for device and context (intel#8517)
This patch implements the `atomic_memory_order_capabilities` query in the OpenCL and Level Zero backends/plugins for `device` and `context` Specifically: - OpenCL <2.0 returns the minimum required capability set (`relaxed`) defined in [Section 4.2 of the OpenCL 3.0 specification](https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html#CL_DEVICE_ATOMIC_MEMORY_CAPABILITIES). - OpenCL <3.0 and Level Zero backends return all memory order capabilities. - OpenCL >=3.0 queries the actual device to get the supported memory order capabilities. E2E test have also been updated to reflect these changes: intel/llvm-test-suite#1627
1 parent 8ab1427 commit 7c9f616

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

ur_level_zero.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1186,6 +1186,17 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(
11861186
return ReturnValue(result);
11871187
}
11881188

1189+
case UR_DEVICE_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES: {
1190+
ur_memory_order_capability_flags_t capabilities =
1191+
UR_MEMORY_ORDER_CAPABILITY_FLAG_RELAXED |
1192+
UR_MEMORY_ORDER_CAPABILITY_FLAG_ACQUIRE |
1193+
UR_MEMORY_ORDER_CAPABILITY_FLAG_RELEASE |
1194+
UR_MEMORY_ORDER_CAPABILITY_FLAG_ACQ_REL |
1195+
UR_MEMORY_ORDER_CAPABILITY_FLAG_SEQ_CST;
1196+
return ReturnValue(capabilities);
1197+
}
1198+
1199+
// TODO: Implement.
11891200
default:
11901201
zePrint("Unsupported ParamName in piGetDeviceInfo\n");
11911202
zePrint("ParamName=%d(0x%x)\n", ParamName, ParamName);
@@ -1716,7 +1727,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDevicePartition(
17161727
// Currently supported partitioning (by affinity domain/numa) would always
17171728
// partition to all sub-devices.
17181729
//
1719-
if (NumDevices !=0)
1730+
if (NumDevices != 0)
17201731
PI_ASSERT(NumDevices == EffectiveNumDevices, UR_RESULT_ERROR_INVALID_VALUE);
17211732

17221733
for (uint32_t I = 0; I < NumDevices; I++) {

0 commit comments

Comments
 (0)