File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,8 @@ cdef class _Memory:
45
45
46
46
@staticmethod
47
47
cdef SyclDevice get_pointer_device(DPPLSyclUSMRef p, SyclContext ctx)
48
+ @staticmethod
49
+ cdef bytes get_pointer_type(DPPLSyclUSMRef p, SyclContext ctx)
48
50
49
51
50
52
cdef class MemoryUSMShared(_Memory):
Original file line number Diff line number Diff line change @@ -429,10 +429,18 @@ cdef class _Memory:
429
429
430
430
@staticmethod
431
431
cdef SyclDevice get_pointer_device(DPPLSyclUSMRef p, SyclContext ctx):
432
+ """ Returns sycl device used to allocate given pointer `p` in given sycl context `ctx`"""
432
433
cdef DPPLSyclDeviceRef dref = DPPLUSM_GetPointerDevice(p, ctx.get_context_ref())
433
434
434
435
return SyclDevice._create(dref)
435
436
437
+ @staticmethod
438
+ cdef bytes get_pointer_type(DPPLSyclUSMRef p, SyclContext ctx):
439
+ """ Returns USM-type of given pointer `p` in given sycl context `ctx`"""
440
+ cdef const char * usm_type = DPPLUSM_GetPointerType(p, ctx.get_context_ref())
441
+
442
+ return < bytes> usm_type
443
+
436
444
437
445
cdef class MemoryUSMShared(_Memory):
438
446
"""
You can’t perform that action at this time.
0 commit comments