|
1 | 1 | # distutils: language = c++
|
2 | 2 | # cython: language_level=3
|
3 | 3 |
|
| 4 | +cimport dpctl |
| 5 | + |
| 6 | + |
4 | 7 | cdef public int USM_ARRAY_C_CONTIGUOUS
|
5 | 8 | cdef public int USM_ARRAY_F_CONTIGUOUS
|
6 | 9 | cdef public int USM_ARRAY_WRITEABLE
|
7 | 10 |
|
8 | 11 |
|
9 | 12 | cdef public class usm_ndarray [object PyUSMArrayObject, type PyUSMArrayType]:
|
10 |
| - cdef char* data |
11 |
| - cdef int nd |
12 |
| - cdef Py_ssize_t *shape |
13 |
| - cdef Py_ssize_t *strides |
14 |
| - cdef int typenum |
15 |
| - cdef int flags |
16 |
| - cdef object base |
| 13 | + # data fields |
| 14 | + cdef char* data_ |
| 15 | + cdef readonly int nd_ |
| 16 | + cdef Py_ssize_t *shape_ |
| 17 | + cdef Py_ssize_t *strides_ |
| 18 | + cdef readonly int typenum_ |
| 19 | + cdef readonly int flags_ |
| 20 | + cdef readonly object base_ |
| 21 | + # make usm_ndarray weak-referenceable |
| 22 | + cdef object __weakref__ |
17 | 23 |
|
18 | 24 | cdef void _reset(usm_ndarray self)
|
19 | 25 | cdef void _cleanup(usm_ndarray self)
|
20 | 26 | cdef usm_ndarray _clone(usm_ndarray self)
|
21 | 27 | cdef Py_ssize_t get_offset(usm_ndarray self) except *
|
22 | 28 |
|
| 29 | + cdef char* get_data(self) |
| 30 | + cdef int get_ndim(self) |
| 31 | + cdef Py_ssize_t * get_shape(self) |
| 32 | + cdef Py_ssize_t * get_strides(self) |
| 33 | + cdef int get_typenum(self) |
| 34 | + cdef int get_itemsize(self) |
| 35 | + cdef int get_flags(self) |
| 36 | + cdef object get_base(self) |
| 37 | + cdef dpctl.DPCTLSyclQueueRef get_queue_ref(self) except * |
| 38 | + cdef dpctl.SyclQueue get_sycl_queue(self) |
| 39 | + |
23 | 40 | cdef __cythonbufferdefaults__ = {"mode": "strided"}
|
0 commit comments