Skip to content

Commit

Permalink
Added public C functions to access data payload of USMMemory* objects (
Browse files Browse the repository at this point in the history
  • Loading branch information
oleksandr-pavlyk authored Aug 24, 2021
1 parent 58f78f5 commit 260573c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions dpctl/memory/_memory.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -706,3 +706,13 @@ def as_usm_memory(obj):
"USM allocation represented by argument {}".
format(obj)
)


cdef public DPCTLSyclUSMRef get_usm_pointer(_Memory obj):
return obj.memory_ptr

cdef public DPCTLSyclContextRef get_context(_Memory obj):
return obj.queue._context.get_context_ref()

cdef public size_t get_nbytes(_Memory obj):
return <size_t>obj.nbytes

0 comments on commit 260573c

Please sign in to comment.