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:
4545
4646 @staticmethod
4747 cdef SyclDevice get_pointer_device(DPPLSyclUSMRef p, SyclContext ctx)
48+ @staticmethod
49+ cdef bytes get_pointer_type(DPPLSyclUSMRef p, SyclContext ctx)
4850
4951
5052cdef class MemoryUSMShared(_Memory):
Original file line number Diff line number Diff line change @@ -429,10 +429,18 @@ cdef class _Memory:
429429
430430 @staticmethod
431431 cdef SyclDevice get_pointer_device(DPPLSyclUSMRef p, SyclContext ctx):
432+ """ Returns sycl device used to allocate given pointer `p` in given sycl context `ctx`"""
432433 cdef DPPLSyclDeviceRef dref = DPPLUSM_GetPointerDevice(p, ctx.get_context_ref())
433434
434435 return SyclDevice._create(dref)
435436
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+
436444
437445cdef class MemoryUSMShared(_Memory):
438446 """
You can’t perform that action at this time.
0 commit comments