@@ -105,6 +105,15 @@ cdef class SyclContext:
105
105
cdef DPPLSyclContextRef get_context_ref (self ):
106
106
return self ._ctxt_ref
107
107
108
+ def addressof_ref (self ):
109
+ """ Returns the address of the DPPLSyclContextRef pointer as a
110
+ long.
111
+
112
+ Returns:
113
+ The address of the DPPLSyclContextRef object used to create this
114
+ SyclContext cast to a long.
115
+ """
116
+ return int (< long > self ._ctx_ref)
108
117
109
118
cdef class SyclDevice:
110
119
''' Wrapper class for a Sycl Device
@@ -163,6 +172,15 @@ cdef class SyclDevice:
163
172
'''
164
173
return self ._device_ref
165
174
175
+ def addressof_ref (self ):
176
+ """ Returns the address of the DPPLSyclDeviceRef pointer as a
177
+ long.
178
+
179
+ Returns:
180
+ The address of the DPPLSyclDeviceRef object used to create this
181
+ SyclDevice cast to a long.
182
+ """
183
+ return int (< long > self ._device_ref)
166
184
167
185
cdef class SyclEvent:
168
186
''' Wrapper class for a Sycl Event
@@ -187,6 +205,16 @@ cdef class SyclEvent:
187
205
cpdef void wait (self ):
188
206
DPPLEvent_Wait(self ._event_ref)
189
207
208
+ def addressof_ref (self ):
209
+ """ Returns the address of the C API DPPLSyclEventRef pointer as
210
+ a long.
211
+
212
+ Returns:
213
+ The address of the DPPLSyclEventRef object used to create this
214
+ SyclEvent cast to a long.
215
+ """
216
+ return int (< long > self ._event_ref)
217
+
190
218
191
219
cdef class SyclKernel:
192
220
''' Wraps a sycl::kernel object created from an OpenCL interoperability
@@ -219,6 +247,15 @@ cdef class SyclKernel:
219
247
'''
220
248
return self ._kernel_ref
221
249
250
+ def addressof_ref (self ):
251
+ """ Returns the address of the C API DPPLSyclKernelRef pointer
252
+ as a long.
253
+
254
+ Returns:
255
+ The address of the DPPLSyclKernelRef object used to create this
256
+ SyclKernel cast to a long.
257
+ """
258
+ return int (< long > self ._kernel_ref)
222
259
223
260
cdef class SyclProgram:
224
261
''' Wraps a sycl::program object created from an OpenCL interoperability
@@ -250,6 +287,16 @@ cdef class SyclProgram:
250
287
name = kernel_name.encode(' utf8' )
251
288
return DPPLProgram_HasKernel(self ._program_ref, name)
252
289
290
+ def addressof_ref (self ):
291
+ """ Returns the address of the C API DPPLSyclProgramRef pointer
292
+ as a long.
293
+
294
+ Returns:
295
+ The address of the DPPLSyclProgramRef object used to create this
296
+ SyclProgram cast to a long.
297
+ """
298
+ return int (< long > self ._program_ref)
299
+
253
300
import ctypes
254
301
255
302
cdef class SyclQueue:
@@ -380,6 +427,16 @@ cdef class SyclQueue:
380
427
cdef DPPLSyclQueueRef get_queue_ref (self ):
381
428
return self ._queue_ref
382
429
430
+ def addressof_ref (self ):
431
+ """ Returns the address of the C API DPPLSyclQueueRef pointer as
432
+ a long.
433
+
434
+ Returns:
435
+ The address of the DPPLSyclQueueRef object used to create this
436
+ SyclQueue cast to a long.
437
+ """
438
+ return int (< long > self ._queue_ref)
439
+
383
440
cpdef SyclEvent submit (self , SyclKernel kernel, list args, list gS, \
384
441
list lS = None , list dEvents = None ):
385
442
0 commit comments