@@ -50,6 +50,7 @@ from ._backend cimport ( # noqa: E211
50
50
DPCTLDevice_GetMaxWriteImageArgs,
51
51
DPCTLDevice_GetName,
52
52
DPCTLDevice_GetParentDevice,
53
+ DPCTLDevice_GetPlatform,
53
54
DPCTLDevice_GetPreferredVectorWidthChar,
54
55
DPCTLDevice_GetPreferredVectorWidthDouble,
55
56
DPCTLDevice_GetPreferredVectorWidthFloat,
@@ -80,6 +81,7 @@ from ._backend cimport ( # noqa: E211
80
81
DPCTLSize_t_Array_Delete,
81
82
DPCTLSyclDeviceRef,
82
83
DPCTLSyclDeviceSelectorRef,
84
+ DPCTLSyclPlatformRef,
83
85
_aspect_type,
84
86
_backend_type,
85
87
_device_type,
@@ -91,6 +93,8 @@ from .enum_types import backend_type, device_type
91
93
from libc.stdint cimport int64_t, uint32_t
92
94
from libc.stdlib cimport free, malloc
93
95
96
+ from ._sycl_platform cimport SyclPlatform
97
+
94
98
import collections
95
99
import warnings
96
100
@@ -639,6 +643,22 @@ cdef class SyclDevice(_SyclDevice):
639
643
self ._device_ref
640
644
)
641
645
646
+ @property
647
+ def platform (self ):
648
+ """ Returns the platform associated with this device.
649
+
650
+ Returns:
651
+ :class:`dpctl.SyclPlatform`: The platform associated with this
652
+ device.
653
+ """
654
+ cdef DPCTLSyclPlatformRef PRef = (
655
+ DPCTLDevice_GetPlatform(self ._device_ref)
656
+ )
657
+ if (PRef == NULL ):
658
+ raise RuntimeError (" Could not get platform for device." )
659
+ else :
660
+ return SyclPlatform._create(PRef)
661
+
642
662
@property
643
663
def preferred_vector_width_char (self ):
644
664
""" Returns the preferred native vector width size for built-in scalar
0 commit comments