Skip to content

Commit 149ed7a

Browse files
Added support for some properties/methods of underluing device
Per issue 381, it would be useful to provide shortcuts to access information pertitent to the device underlying SyclQueue directly from the SyclQueue instance itself. ``` q.print_device_info() q.sycl_device.print_device_info() ``` now are synonyms.
1 parent ab0faea commit 149ed7a

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

dpctl/_sycl_queue.pyx

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -932,6 +932,43 @@ cdef class SyclQueue(_SyclQueue):
932932

933933
return SyclEvent._create(ERef, [])
934934

935+
@property
936+
def backend(self):
937+
"""Returns the backend_type enum value for the device
938+
associated with this queue.
939+
940+
Returns:
941+
backend_type: The backend for the device.
942+
"""
943+
return self.sycl_device.backend
944+
945+
@property
946+
def name(self):
947+
"""Returns the device name for the device
948+
associated with this queue.
949+
950+
Returns:
951+
str: The name of the device as a string.
952+
"""
953+
return self.sycl_device.name
954+
955+
@property
956+
def driver_version(self):
957+
"""Returns the driver version for the device
958+
associated with this queue.
959+
960+
Returns:
961+
str: The driver version of the device as a string.
962+
"""
963+
return self.sycl_device.driver_version
964+
965+
def print_device_info(self):
966+
""" Print information about the SYCL device
967+
associated with this queue.
968+
"""
969+
self.sycl_device.print_device_info()
970+
971+
935972
cdef public DPCTLSyclQueueRef get_queue_ref(SyclQueue q):
936973
"""
937974
C-API function to get opaque queue reference from

0 commit comments

Comments
 (0)