Skip to content

Commit d9c49ff

Browse files
author
Lamzed-Short, Andrew
committed
Added bitmask for returned value from OpenCL 3.0 runtime
Unsure whether ACQUIRE and RELEASE need removing as current pi.h expects 5 bits for memory order info but the OCL headers say only 3 are necessary in 3.0 as the values are RELAXED, ACQ_REL, and SEQ_CST.
1 parent a508c49 commit d9c49ff

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

sycl/include/sycl/detail/pi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,8 @@ constexpr pi_memory_order_capabilities PI_MEMORY_ORDER_RELEASE = 0x04;
554554
constexpr pi_memory_order_capabilities PI_MEMORY_ORDER_ACQ_REL = 0x08;
555555
constexpr pi_memory_order_capabilities PI_MEMORY_ORDER_SEQ_CST = 0x10;
556556

557+
constexpr pi_memory_order_capabilities PI_MEMORY_ORDER_BITMASK = 0x07;
558+
557559
using pi_memory_scope_capabilities = pi_bitfield;
558560
constexpr pi_memory_scope_capabilities PI_MEMORY_SCOPE_WORK_ITEM = 0x01;
559561
constexpr pi_memory_scope_capabilities PI_MEMORY_SCOPE_SUB_GROUP = 0x02;

sycl/plugins/opencl/pi_opencl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ pi_result piDeviceGetInfo(pi_device device, pi_device_info paramName,
311311
cl_int result = clGetDeviceInfo(
312312
cast<cl_device_id>(device), cast<cl_device_info>(paramName),
313313
paramValueSize, paramValue, paramValueSizeRet);
314-
return static_cast<pi_result>(result);
314+
return static_cast<pi_result>(result & PI_MEMORY_ORDER_BITMASK);
315315
}
316316
}
317317
case PI_DEVICE_INFO_ATOMIC_64: {

0 commit comments

Comments
 (0)