@@ -302,7 +302,7 @@ cdef class _Memory:
302
302
return _to_memory, (self .copy_to_host(), self .get_usm_type())
303
303
304
304
property __sycl_usm_array_interface__ :
305
- def __get__ (self ):
305
+ def __get__ (self ):
306
306
cdef dict iface = {
307
307
" data" : (< Py_ssize_t> (< void * > self .memory_ptr),
308
308
True ), # bool(self.writeable)),
@@ -336,7 +336,7 @@ cdef class _Memory:
336
336
" or an instance of SyclContext or SyclQueue" )
337
337
return kind.decode(' UTF-8' )
338
338
339
- cpdef copy_to_host (self , obj = None ):
339
+ cpdef copy_to_host(self , obj = None ):
340
340
""" Copy content of instance's memory into memory of
341
341
`obj`, or allocate NumPy array of obj is None"""
342
342
# Cython does the right thing here
@@ -360,8 +360,8 @@ cdef class _Memory:
360
360
361
361
return obj
362
362
363
- cpdef copy_from_host (self , object obj):
364
- """ Copy contant of Python buffer provided by `obj` to instance memory."""
363
+ cpdef copy_from_host(self , object obj):
364
+ """ Copy content of Python buffer provided by `obj` to instance memory."""
365
365
cdef const unsigned char [::1 ] host_buf = obj
366
366
cdef Py_ssize_t buf_len = len (host_buf)
367
367
@@ -376,7 +376,7 @@ cdef class _Memory:
376
376
< size_t> buf_len
377
377
)
378
378
379
- cpdef copy_from_device (self , object sycl_usm_ary):
379
+ cpdef copy_from_device(self , object sycl_usm_ary):
380
380
""" Copy SYCL memory underlying the argument object into
381
381
the memory of the instance"""
382
382
cdef _BufferData src_buf
@@ -410,8 +410,8 @@ cdef class _Memory:
410
410
else :
411
411
raise TypeError
412
412
413
- cpdef bytes tobytes (self ):
414
- """ """
413
+ cpdef bytes tobytes(self ):
414
+ """ Constructs bytes object populated with copy of USM memory """
415
415
cdef Py_ssize_t nb = self .nbytes
416
416
cdef bytes b = PyBytes_FromStringAndSize(NULL , nb)
417
417
# convert bytes to memory view
0 commit comments