@@ -26,11 +26,18 @@ a OpenCL source string or a SPIR-V binary file.
2626"""
2727
2828cimport cython.array
29+ from libc.stdint cimport uint32_t
2930
30- from dpctl._backend cimport ( # noqa: E211, E402
31+ from dpctl._backend cimport ( # noqa: E211, E402;
3132 DPCTLCString_Delete,
3233 DPCTLKernel_Delete,
34+ DPCTLKernel_GetCompileNumSubGroups,
35+ DPCTLKernel_GetCompileSubGroupSize,
36+ DPCTLKernel_GetMaxNumSubGroups,
3337 DPCTLKernel_GetNumArgs,
38+ DPCTLKernel_GetPreferredWorkGroupSizeMultiple,
39+ DPCTLKernel_GetPrivateMemSize,
40+ DPCTLKernel_GetWorkGroupSize,
3441 DPCTLKernelBundle_CreateFromOCLSource,
3542 DPCTLKernelBundle_CreateFromSpirv,
3643 DPCTLKernelBundle_Delete,
@@ -95,6 +102,61 @@ cdef class SyclKernel:
95102 """
96103 return int (< size_t> self ._kernel_ref)
97104
105+ @property
106+ def work_group_size (self ):
107+ """ Returns the maximum number of work-items in a work-group that can
108+ be used to execute the kernel on device it was built for.
109+ """
110+ cdef size_t v = DPCTLKernel_GetWorkGroupSize(self ._kernel_ref)
111+ return v
112+
113+ @property
114+ def preferred_work_group_size_multiple (self ):
115+ """ Returns a value, of which work-group size is preferred to be
116+ a multiple, for executing the kernel on the device it was built for.
117+ """
118+ cdef size_t v = DPCTLKernel_GetPreferredWorkGroupSizeMultiple(
119+ self ._kernel_ref)
120+ return v
121+
122+ @property
123+ def private_mem_size (self ):
124+ """ Returns the minimum amount of private memory, in bytes, used by each
125+ work-item in the kernel.
126+ """
127+ cdef size_t v = DPCTLKernel_GetPrivateMemSize(self ._kernel_ref)
128+ return v
129+
130+ @property
131+ def max_num_sub_groups (self ):
132+ """ Returns the maximum number of sub-groups for this kernel.
133+ """
134+ cdef uint32_t n = DPCTLKernel_GetMaxNumSubGroups(self ._kernel_ref)
135+ return n
136+
137+ @property
138+ def max_sub_group_size (self ):
139+ """ Returns the maximum sub-groups size for this kernel.
140+ """
141+ cdef uint32_t sz = 0
142+ return NotImplemented
143+
144+ @property
145+ def compile_num_sub_groups (self ):
146+ """ Returns the number of sub-groups specified by this kernel,
147+ or 0 (if not specified).
148+ """
149+ cdef size_t n = DPCTLKernel_GetCompileNumSubGroups(self ._kernel_ref)
150+ return n
151+
152+ @property
153+ def compile_sub_group_size (self ):
154+ """ Returns the required sub-group size specified by this kernel,
155+ or 0 (if not specified).
156+ """
157+ cdef size_t n = DPCTLKernel_GetCompileSubGroupSize(self ._kernel_ref)
158+ return n
159+
98160
99161cdef class SyclProgram:
100162 """ Wraps a ``sycl::kernel_bundle<sycl::bundle_state::executable>`` object
0 commit comments