Skip to content

Commit 336cc9a

Browse files
Added SyclDevice.native_vector_width_* properties
1 parent 2a0ce39 commit 336cc9a

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

dpctl/_sycl_device.pyx

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ from ._backend cimport ( # noqa: E211
5454
DPCTLDevice_GetMaxWorkItemSizes3d,
5555
DPCTLDevice_GetMaxWriteImageArgs,
5656
DPCTLDevice_GetName,
57+
DPCTLDevice_GetNativeVectorWidthChar,
58+
DPCTLDevice_GetNativeVectorWidthDouble,
59+
DPCTLDevice_GetNativeVectorWidthFloat,
60+
DPCTLDevice_GetNativeVectorWidthHalf,
61+
DPCTLDevice_GetNativeVectorWidthInt,
62+
DPCTLDevice_GetNativeVectorWidthLong,
63+
DPCTLDevice_GetNativeVectorWidthShort,
5764
DPCTLDevice_GetParentDevice,
5865
DPCTLDevice_GetPartitionMaxSubDevices,
5966
DPCTLDevice_GetPlatform,
@@ -942,6 +949,55 @@ cdef class SyclDevice(_SyclDevice):
942949
"""
943950
return DPCTLDevice_GetPreferredVectorWidthHalf(self._device_ref)
944951

952+
@property
953+
def native_vector_width_char(self):
954+
""" Returns the native ISA vector width size for built-in scalar
955+
types that can be put into vectors.
956+
"""
957+
return DPCTLDevice_GetNativeVectorWidthChar(self._device_ref)
958+
959+
@property
960+
def native_vector_width_short(self):
961+
""" Returns the native ISA vector width size for built-in scalar
962+
types that can be put into vectors.
963+
"""
964+
return DPCTLDevice_GetNativeVectorWidthShort(self._device_ref)
965+
966+
@property
967+
def native_vector_width_int(self):
968+
""" Returns the native ISA vector width size for built-in scalar
969+
types that can be put into vectors.
970+
"""
971+
return DPCTLDevice_GetNativeVectorWidthInt(self._device_ref)
972+
973+
@property
974+
def native_vector_width_long(self):
975+
""" Returns the native ISA vector width size for built-in scalar
976+
types that can be put into vectors.
977+
"""
978+
return DPCTLDevice_GetNativeVectorWidthLong(self._device_ref)
979+
980+
@property
981+
def native_vector_width_float(self):
982+
""" Returns the native ISA vector width size for built-in scalar
983+
types that can be put into vectors.
984+
"""
985+
return DPCTLDevice_GetNativeVectorWidthFloat(self._device_ref)
986+
987+
@property
988+
def native_vector_width_double(self):
989+
""" Returns the native ISA vector width size for built-in scalar
990+
types that can be put into vectors.
991+
"""
992+
return DPCTLDevice_GetNativeVectorWidthDouble(self._device_ref)
993+
994+
@property
995+
def native_vector_width_half(self):
996+
""" Returns the native ISA vector width size for built-in scalar
997+
types that can be put into vectors.
998+
"""
999+
return DPCTLDevice_GetNativeVectorWidthHalf(self._device_ref)
1000+
9451001
@property
9461002
def global_mem_size(self):
9471003
""" Returns the size of global memory on this device in bytes.

0 commit comments

Comments
 (0)