File tree 1 file changed +31
-2
lines changed
1 file changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -232,33 +232,62 @@ cdef class _Memory:
232
232
buffer .suboffsets = NULL # for pointer arrays only
233
233
234
234
property nbytes :
235
+ """ Extent of this USM buffer in bytes. """
235
236
def __get__ (self ):
236
237
return self .nbytes
237
238
238
239
property size :
240
+ """ Extent of this USM buffer in bytes. """
239
241
def __get__ (self ):
240
242
return self .nbytes
241
243
242
244
property _pointer :
245
+ """
246
+ USM pointer at the start of this buffer
247
+ represented in Python integer.
248
+ """
243
249
def __get__ (self ):
244
250
return < size_t> (self .memory_ptr)
245
251
246
252
property _context :
253
+ """ :class:`dpctl.SyclContext` the USM pointer is bound to. """
247
254
def __get__ (self ):
248
255
return self .queue.get_sycl_context()
249
256
250
257
property _queue :
258
+ """
259
+ :class:`dpctl.SyclQueue` with :class:`dpctl.SyclContext` the
260
+ USM pointer is bound to and :class:`dpctl.SyclDevice` it was
261
+ allocated on.
262
+ """
251
263
def __get__ (self ):
252
264
return self .queue
253
265
254
266
property reference_obj :
267
+ """
268
+ Reference to the Python object owning this USM buffer.
269
+ """
255
270
def __get__ (self ):
256
271
return self .refobj
257
272
273
+ property sycl_context :
274
+ """ :class:`dpctl.SyclContext` the USM pointer is bound to. """
275
+ def __get__ (self ):
276
+ return self .queue.get_sycl_context()
277
+
278
+ property sycl_device :
279
+ """ :class:`dpctl.SyclDevice` the USM pointer is bound to. """
280
+ def __get__ (self ):
281
+ return self .queue.get_sycl_device()
282
+
258
283
def __repr__ (self ):
259
284
return (
260
- " <Intel(R) USM allocated memory block of {} bytes at {}>"
261
- .format(self .nbytes, hex (< object > (< size_t> self .memory_ptr)))
285
+ " <SYCL(TM) USM-{} allocated memory block of {} bytes at {}>"
286
+ .format(
287
+ self .get_usm_type(),
288
+ self .nbytes,
289
+ hex (< object > (< size_t> self .memory_ptr))
290
+ )
262
291
)
263
292
264
293
def __len__ (self ):
You can’t perform that action at this time.
0 commit comments