Skip to content

Commit c68e9ac

Browse files
committed
Apply comments
Signed-off-by: Dmitry Sidorov <[email protected]>
1 parent 0e99c41 commit c68e9ac

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

sycl/include/CL/sycl/detail/pi.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,12 @@ constexpr pi_mem_flags PI_MEM_FLAGS_HOST_PTR_USE = CL_MEM_USE_HOST_PTR;
494494
constexpr pi_mem_flags PI_MEM_FLAGS_HOST_PTR_COPY = CL_MEM_COPY_HOST_PTR;
495495
constexpr pi_mem_flags PI_MEM_FLAGS_HOST_PTR_ALLOC = CL_MEM_ALLOC_HOST_PTR;
496496

497+
// NOTE: this is made 64-bit to match the size of cl_mem_properties_intel to
498+
// make the translation to OpenCL transparent.
499+
// TODO: populate
500+
//
501+
using pi_mem_properties = pi_bitfield;
502+
497503
// NOTE: queue properties are implemented this way to better support bit
498504
// manipulations
499505
using pi_queue_properties = pi_bitfield;
@@ -981,7 +987,7 @@ __SYCL_EXPORT pi_result piextQueueCreateWithNativeHandle(
981987
//
982988
__SYCL_EXPORT pi_result piMemBufferCreate(
983989
pi_context context, pi_mem_flags flags, size_t size, void *host_ptr,
984-
pi_mem *ret_mem, const cl_mem_properties_intel *properties = nullptr);
990+
pi_mem *ret_mem, const pi_mem_properties *properties = nullptr);
985991

986992
__SYCL_EXPORT pi_result piMemImageCreate(pi_context context, pi_mem_flags flags,
987993
const pi_image_format *image_format,

sycl/plugins/cuda/pi_cuda.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1628,9 +1628,10 @@ pi_result cuda_piextContextCreateWithNativeHandle(pi_native_handle nativeHandle,
16281628
///
16291629
pi_result cuda_piMemBufferCreate(pi_context context, pi_mem_flags flags,
16301630
size_t size, void *host_ptr, pi_mem *ret_mem,
1631-
const cl_mem_properties_intel *) {
1631+
const pi_mem_properties *properties) {
16321632
// Need input memory object
16331633
assert(ret_mem != nullptr);
1634+
assert(properties == nullptr && "no mem properties goes to cuda RT yet");
16341635
// Currently, USE_HOST_PTR is not implemented using host register
16351636
// since this triggers a weird segfault after program ends.
16361637
// Setting this constant to true enables testing that behavior.

sycl/plugins/level_zero/pi_level_zero.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1909,12 +1909,13 @@ pi_result piextQueueCreateWithNativeHandle(pi_native_handle NativeHandle,
19091909

19101910
pi_result piMemBufferCreate(pi_context Context, pi_mem_flags Flags, size_t Size,
19111911
void *HostPtr, pi_mem *RetMem,
1912-
const cl_mem_properties_intel *) {
1912+
const pi_mem_properties *properties) {
19131913

19141914
// TODO: implement read-only, write-only
19151915
assert((Flags & PI_MEM_FLAGS_ACCESS_RW) != 0);
19161916
assert(Context);
19171917
assert(RetMem);
1918+
assert(properties == nullptr && "no mem properties goes to l0 RT yet");
19181919

19191920
void *Ptr;
19201921
ze_device_handle_t ZeDevice = Context->Devices[0]->ZeDevice;

sycl/plugins/opencl/pi_opencl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ pi_result piextContextCreateWithNativeHandle(pi_native_handle nativeHandle,
519519

520520
pi_result piMemBufferCreate(pi_context context, pi_mem_flags flags, size_t size,
521521
void *host_ptr, pi_mem *ret_mem,
522-
const cl_mem_properties_intel *properties) {
522+
const pi_mem_properties *properties) {
523523
pi_result ret_err = PI_INVALID_OPERATION;
524524
clCreateBufferWithPropertiesINTEL_fn FuncPtr = nullptr;
525525

0 commit comments

Comments
 (0)