File tree Expand file tree Collapse file tree 6 files changed +44
-7
lines changed Expand file tree Collapse file tree 6 files changed +44
-7
lines changed Original file line number Diff line number Diff line change @@ -26,13 +26,19 @@ from ._backend cimport DPCTLSyclContextRef
26
26
from ._sycl_device cimport SyclDevice
27
27
28
28
29
- cdef class _SyclContext:
29
+ cdef public class _SyclContext [
30
+ object Py_SyclContextObject,
31
+ type Py_SyclContextType
32
+ ]:
30
33
""" Data owner for SyclContext
31
34
"""
32
35
cdef DPCTLSyclContextRef _ctxt_ref
33
36
34
37
35
- cdef public class SyclContext(_SyclContext) [object PySyclContextObject, type PySyclContextType]:
38
+ cdef public class SyclContext(_SyclContext) [
39
+ object PySyclContextObject,
40
+ type PySyclContextType
41
+ ]:
36
42
''' Wrapper class for a Sycl Context
37
43
'''
38
44
Original file line number Diff line number Diff line change @@ -473,3 +473,10 @@ cdef class SyclContext(_SyclContext):
473
473
" SyclContextRef" ,
474
474
& _context_capsule_deleter
475
475
)
476
+
477
+ cdef public DPCTLSyclContextRef get_context_ref(SyclContext ctx):
478
+ """
479
+ C-API function to get opaque context reference from
480
+ :class:`dpctl.SyclContext` instance.
481
+ """
482
+ return ctx.get_context_ref()
Original file line number Diff line number Diff line change @@ -29,7 +29,10 @@ from ._backend cimport (
29
29
)
30
30
31
31
32
- cdef class _SyclDevice:
32
+ cdef public class _SyclDevice [
33
+ object Py_SyclDeviceObject,
34
+ type Py_SyclDeviceType
35
+ ]:
33
36
""" A helper data-owner class to abstract a `cl::sycl::device` instance.
34
37
"""
35
38
cdef DPCTLSyclDeviceRef _device_ref
@@ -39,7 +42,10 @@ cdef class _SyclDevice:
39
42
cdef size_t * _max_work_item_sizes
40
43
41
44
42
- cdef public class SyclDevice(_SyclDevice) [object PySyclDeviceObject, type PySyclDeviceType]:
45
+ cdef public class SyclDevice(_SyclDevice) [
46
+ object PySyclDeviceObject,
47
+ type PySyclDeviceType
48
+ ]:
43
49
@staticmethod
44
50
cdef SyclDevice _create(DPCTLSyclDeviceRef dref)
45
51
@staticmethod
Original file line number Diff line number Diff line change @@ -1117,3 +1117,10 @@ cdef class SyclDevice(_SyclDevice):
1117
1117
return " :" .join((dt_str, str (relId)))
1118
1118
else :
1119
1119
return str (relId)
1120
+
1121
+ cdef public DPCTLSyclDeviceRef get_device_ref(SyclDevice dev):
1122
+ """
1123
+ C-API function to get opaque device reference from
1124
+ :class:`dpctl.SyclDevice` instance.
1125
+ """
1126
+ return dev.get_device_ref()
Original file line number Diff line number Diff line change @@ -31,15 +31,19 @@ from .program._program cimport SyclKernel
31
31
32
32
cdef void default_async_error_handler(int ) nogil except *
33
33
34
- cdef class _SyclQueue:
35
- """ Python wrapper class for a sycl::queue.
34
+ cdef public class _SyclQueue [
35
+ object Py_SyclQueueObject, type Py_SyclQueueType
36
+ ]:
37
+ """ Python data owner class for a sycl::queue.
36
38
"""
37
39
cdef DPCTLSyclQueueRef _queue_ref
38
40
cdef SyclContext _context
39
41
cdef SyclDevice _device
40
42
41
43
42
- cdef public class SyclQueue (_SyclQueue) [object PySyclQueueObject, type PySyclQueueType]:
44
+ cdef public class SyclQueue (_SyclQueue) [
45
+ object PySyclQueueObject, type PySyclQueueType
46
+ ]:
43
47
""" Python wrapper class for a sycl::queue.
44
48
"""
45
49
cdef int _init_queue_default(self , int )
Original file line number Diff line number Diff line change @@ -918,3 +918,10 @@ cdef class SyclQueue(_SyclQueue):
918
918
)
919
919
920
920
return SyclEvent._create(ERef, [])
921
+
922
+ cdef public DPCTLSyclQueueRef get_queue_ref(SyclQueue q):
923
+ """
924
+ C-API function to get opaque queue reference from
925
+ :class:`dpctl.SyclQueue` instance.
926
+ """
927
+ return q.get_queue_ref()
You can’t perform that action at this time.
0 commit comments