Skip to content

Commit 368514e

Browse files
committed
add missing device info queries
1 parent 17b5a6d commit 368514e

11 files changed

Lines changed: 1742 additions & 2 deletions

dpctl/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,12 @@
6565
backend_type,
6666
device_type,
6767
event_status_type,
68+
fp_config,
6869
global_mem_cache_type,
70+
local_mem_type,
71+
memory_order,
72+
memory_scope,
73+
partition_property,
6974
)
7075

7176
__all__ = [
@@ -118,6 +123,11 @@
118123
"backend_type",
119124
"event_status_type",
120125
"global_mem_cache_type",
126+
"local_mem_type",
127+
"partition_property",
128+
"fp_config",
129+
"memory_order",
130+
"memory_scope",
121131
]
122132
__all__ += [
123133
"get_include",

dpctl/_backend.pxd

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ cdef extern from "syclinterface/dpctl_error_handler_type.h":
3131
cdef extern from "syclinterface/dpctl_utils.h":
3232
cdef void DPCTLCString_Delete(const char *str)
3333
cdef void DPCTLSize_t_Array_Delete(size_t *arr)
34+
cdef void DPCTLInt_Array_Delete(int *arr)
3435

3536

3637
cdef extern from "syclinterface/dpctl_sycl_enum_types.h":
@@ -128,6 +129,41 @@ cdef extern from "syclinterface/dpctl_sycl_enum_types.h":
128129
_MEM_CACHE_TYPE_READ_ONLY "DPCTL_MEM_CACHE_TYPE_READ_ONLY"
129130
_MEM_CACHE_TYPE_READ_WRITE "DPCTL_MEM_CACHE_TYPE_READ_WRITE"
130131

132+
ctypedef enum _local_mem_type "DPCTLLocalMemType":
133+
_LOCAL_MEM_TYPE_NONE "DPCTL_LOCAL_MEM_TYPE_NONE"
134+
_LOCAL_MEM_TYPE_LOCAL "DPCTL_LOCAL_MEM_TYPE_LOCAL"
135+
_LOCAL_MEM_TYPE_GLOBAL "DPCTL_LOCAL_MEM_TYPE_GLOBAL"
136+
137+
ctypedef enum _partition_property_type "DPCTLPartitionPropertyType":
138+
_PARTITION_NO_PARTITION "DPCTL_PARTITION_NO_PARTITION"
139+
_PARTITION_EQUALLY "DPCTL_PARTITION_EQUALLY"
140+
_PARTITION_BY_COUNTS "DPCTL_PARTITION_BY_COUNTS"
141+
_PARTITION_BY_AFFINITY_DOMAIN "DPCTL_PARTITION_BY_AFFINITY_DOMAIN"
142+
143+
ctypedef enum _fp_config_type "DPCTLFPConfigType":
144+
_FP_DENORM "DPCTL_FP_DENORM"
145+
_FP_INF_NAN "DPCTL_FP_INF_NAN"
146+
_FP_ROUND_TO_NEAREST "DPCTL_FP_ROUND_TO_NEAREST"
147+
_FP_ROUND_TO_ZERO "DPCTL_FP_ROUND_TO_ZERO"
148+
_FP_ROUND_TO_INF "DPCTL_FP_ROUND_TO_INF"
149+
_FP_FMA "DPCTL_FP_FMA"
150+
_FP_CORRECT_ROUND_DIV_SQRT "DPCTL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT"
151+
_FP_SOFT_FLOAT "DPCTL_FP_SOFT_FLOAT"
152+
153+
ctypedef enum _memory_order_type "DPCTLMemoryOrderType":
154+
_MEMORY_ORDER_RELAXED "DPCTL_MEMORY_ORDER_RELAXED"
155+
_MEMORY_ORDER_ACQUIRE "DPCTL_MEMORY_ORDER_ACQUIRE"
156+
_MEMORY_ORDER_RELEASE "DPCTL_MEMORY_ORDER_RELEASE"
157+
_MEMORY_ORDER_ACQ_REL "DPCTL_MEMORY_ORDER_ACQ_REL"
158+
_MEMORY_ORDER_SEQ_CST "DPCTL_MEMORY_ORDER_SEQ_CST"
159+
160+
ctypedef enum _memory_scope_type "DPCTLMemoryScopeType":
161+
_MEMORY_SCOPE_WORK_ITEM "DPCTL_MEMORY_SCOPE_WORK_ITEM"
162+
_MEMORY_SCOPE_SUB_GROUP "DPCTL_MEMORY_SCOPE_SUB_GROUP"
163+
_MEMORY_SCOPE_WORK_GROUP "DPCTL_MEMORY_SCOPE_WORK_GROUP"
164+
_MEMORY_SCOPE_DEVICE "DPCTL_MEMORY_SCOPE_DEVICE"
165+
_MEMORY_SCOPE_SYSTEM "DPCTL_MEMORY_SCOPE_SYSTEM"
166+
131167

132168
cdef extern from "syclinterface/dpctl_sycl_types.h":
133169
cdef struct DPCTLOpaqueSyclContext
@@ -290,6 +326,46 @@ cdef extern from "syclinterface/dpctl_sycl_device_interface.h":
290326

291327
cdef void DPCTLDevice_DisablePeerAccess(const DPCTLSyclDeviceRef DRef,
292328
const DPCTLSyclDeviceRef PDRef)
329+
cdef uint32_t DPCTLDevice_GetVendorId(const DPCTLSyclDeviceRef DRef)
330+
cdef uint32_t DPCTLDevice_GetAddressBits(const DPCTLSyclDeviceRef DRef)
331+
cdef size_t DPCTLDevice_GetImageMaxBufferSize(
332+
const DPCTLSyclDeviceRef DRef)
333+
cdef uint32_t DPCTLDevice_GetMaxSamplers(const DPCTLSyclDeviceRef DRef)
334+
cdef size_t DPCTLDevice_GetMaxParameterSize(
335+
const DPCTLSyclDeviceRef DRef)
336+
cdef uint32_t DPCTLDevice_GetMemBaseAddrAlign(
337+
const DPCTLSyclDeviceRef DRef)
338+
cdef bool DPCTLDevice_GetErrorCorrectionSupport(
339+
const DPCTLSyclDeviceRef DRef)
340+
cdef bool DPCTLDevice_IsAvailable(const DPCTLSyclDeviceRef DRef)
341+
cdef const char *DPCTLDevice_GetVersion(const DPCTLSyclDeviceRef DRef)
342+
cdef const char *DPCTLDevice_GetBackendVersion(
343+
const DPCTLSyclDeviceRef DRef)
344+
cdef _local_mem_type DPCTLDevice_GetLocalMemType(
345+
const DPCTLSyclDeviceRef DRef)
346+
cdef _partition_property_type DPCTLDevice_GetPartitionTypeProperty(
347+
const DPCTLSyclDeviceRef DRef)
348+
cdef _partition_affinity_domain_type \
349+
DPCTLDevice_GetPartitionTypeAffinityDomain(
350+
const DPCTLSyclDeviceRef DRef)
351+
cdef int *DPCTLDevice_GetHalfFPConfig(
352+
const DPCTLSyclDeviceRef DRef, size_t *res_len)
353+
cdef int *DPCTLDevice_GetSingleFPConfig(
354+
const DPCTLSyclDeviceRef DRef, size_t *res_len)
355+
cdef int *DPCTLDevice_GetDoubleFPConfig(
356+
const DPCTLSyclDeviceRef DRef, size_t *res_len)
357+
cdef int *DPCTLDevice_GetAtomicMemoryOrderCapabilities(
358+
const DPCTLSyclDeviceRef DRef, size_t *res_len)
359+
cdef int *DPCTLDevice_GetAtomicFenceOrderCapabilities(
360+
const DPCTLSyclDeviceRef DRef, size_t *res_len)
361+
cdef int *DPCTLDevice_GetAtomicMemoryScopeCapabilities(
362+
const DPCTLSyclDeviceRef DRef, size_t *res_len)
363+
cdef int *DPCTLDevice_GetAtomicFenceScopeCapabilities(
364+
const DPCTLSyclDeviceRef DRef, size_t *res_len)
365+
cdef int *DPCTLDevice_GetPartitionProperties(
366+
const DPCTLSyclDeviceRef DRef, size_t *res_len)
367+
cdef int *DPCTLDevice_GetPartitionAffinityDomains(
368+
const DPCTLSyclDeviceRef DRef, size_t *res_len)
293369

294370
cdef extern from "syclinterface/dpctl_sycl_device_manager.h":
295371
cdef DPCTLDeviceVectorRef DPCTLDeviceVector_CreateFromArray(

0 commit comments

Comments
 (0)