@@ -102,56 +102,12 @@ using pi_native_handle = uintptr_t;
102102// for PI <-> OpenCL ways. The PI <-> to other BE translation is almost
103103// always needed anyway.
104104//
105- // TODO: populate PI enums.
106- //
107105typedef enum {
108- PI_SUCCESS = 0 ,
109- PI_ERROR_INVALID_KERNEL_NAME = -46 ,
110- PI_ERROR_INVALID_OPERATION = -59 ,
111- PI_ERROR_INVALID_KERNEL = -48 ,
112- PI_ERROR_INVALID_QUEUE_PROPERTIES = -35 ,
113- PI_ERROR_INVALID_VALUE = -30 ,
114- PI_ERROR_INVALID_CONTEXT = -34 ,
115- PI_ERROR_INVALID_PLATFORM = -32 ,
116- PI_ERROR_INVALID_DEVICE = -33 ,
117- PI_ERROR_INVALID_BINARY = -42 ,
118- PI_ERROR_INVALID_QUEUE = -36 ,
119- PI_ERROR_OUT_OF_HOST_MEMORY = -6 ,
120- PI_ERROR_INVALID_PROGRAM = -44 ,
121- PI_ERROR_INVALID_PROGRAM_EXECUTABLE = -45 ,
122- PI_ERROR_INVALID_SAMPLER = -41 ,
123- PI_ERROR_INVALID_BUFFER_SIZE = -61 ,
124- PI_ERROR_INVALID_MEM_OBJECT = -38 ,
125- PI_ERROR_OUT_OF_RESOURCES = -5 ,
126- PI_ERROR_INVALID_EVENT = -58 ,
127- PI_ERROR_INVALID_EVENT_WAIT_LIST = -57 ,
128- PI_ERROR_MISALIGNED_SUB_BUFFER_OFFSET = -13 ,
129- PI_ERROR_BUILD_PROGRAM_FAILURE = -11 ,
130- PI_ERROR_INVALID_WORK_GROUP_SIZE = -54 ,
131- PI_ERROR_COMPILER_NOT_AVAILABLE = -3 ,
132- PI_ERROR_PROFILING_INFO_NOT_AVAILABLE = -7 ,
133- PI_ERROR_DEVICE_NOT_FOUND = -1 ,
134- PI_ERROR_INVALID_WORK_ITEM_SIZE = -55 ,
135- PI_ERROR_INVALID_WORK_DIMENSION = -53 ,
136- PI_ERROR_INVALID_KERNEL_ARGS = -52 ,
137- PI_ERROR_INVALID_IMAGE_SIZE = -40 ,
138- PI_ERROR_INVALID_ARG_VALUE = -50 ,
139- PI_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR = -39 ,
140- PI_ERROR_IMAGE_FORMAT_NOT_SUPPORTED = -10 ,
141- PI_ERROR_MEM_OBJECT_ALLOCATION_FAILURE = -4 ,
142- PI_ERROR_LINK_PROGRAM_FAILURE = -17 ,
143- PI_ERROR_PLUGIN_SPECIFIC_ERROR =
144- -996 , // /< PI_ERROR_PLUGIN_SPECIFIC_ERROR indicates
145- // /< that an backend spcific error or
146- // /< warning has been emitted by the plugin.
147- PI_ERROR_COMMAND_EXECUTION_FAILURE =
148- -997 , // /< PI_ERROR_COMMAND_EXECUTION_FAILURE indicates an error occurred
149- // /< during command enqueue or execution.
150- PI_ERROR_FUNCTION_ADDRESS_IS_NOT_AVAILABLE =
151- -998 , // /< PI_ERROR_FUNCTION_ADDRESS_IS_NOT_AVAILABLE indicates a fallback
152- // /< method determines the function exists but its address cannot be
153- // /< found.
154- PI_ERROR_UNKNOWN = -999
106+ #define _PI_ERRC (NAME, VAL ) NAME = VAL,
107+ #define _PI_ERRC_WITH_MSG (NAME, VAL, MSG ) NAME = VAL,
108+ #include < CL/sycl/detail/pi_error.def>
109+ #undef _PI_ERRC
110+ #undef _PI_ERRC_WITH_MSG
155111} _pi_result;
156112
157113typedef enum {
@@ -199,8 +155,9 @@ typedef enum : pi_uint64 {
199155 PI_DEVICE_TYPE_ALL = 0xFFFFFFFF , // /< All devices available in the PI plugin.
200156 PI_DEVICE_TYPE_CPU = (1 << 1 ), // /< A PI device that is the host processor.
201157 PI_DEVICE_TYPE_GPU = (1 << 2 ), // /< A PI device that is a GPU.
202- PI_DEVICE_TYPE_ACC = (1 << 3 ) // /< A PI device that is a
158+ PI_DEVICE_TYPE_ACC = (1 << 3 ), // /< A PI device that is a
203159 // /< dedicated accelerator.
160+ PI_DEVICE_TYPE_CUSTOM = (1 << 4 ) // /< A PI device that is a custom device.
204161} _pi_device_type;
205162
206163typedef enum {
@@ -340,6 +297,7 @@ typedef enum {
340297
341298typedef enum {
342299 PI_CONTEXT_INFO_DEVICES = 0x1081 ,
300+ PI_CONTEXT_INFO_PLATFORM = 0x1084 ,
343301 PI_CONTEXT_INFO_NUM_DEVICES = 0x1083 ,
344302 PI_CONTEXT_INFO_PROPERTIES = 0x1082 ,
345303 PI_CONTEXT_INFO_REFERENCE_COUNT = 0x1080 ,
@@ -377,16 +335,6 @@ typedef enum {
377335 PI_KERNEL_GROUP_INFO_NUM_REGS = 0x10112
378336} _pi_kernel_group_info;
379337
380- typedef enum {
381- PI_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT = (1 << 7 ),
382- PI_FP_ROUND_TO_NEAREST = (1 << 2 ),
383- PI_FP_ROUND_TO_ZERO = (1 << 3 ),
384- PI_FP_ROUND_TO_INF = (1 << 4 ),
385- PI_FP_INF_NAN = (1 << 1 ),
386- PI_FP_DENORM = (1 << 0 ),
387- PI_FP_FMA = (1 << 5 )
388- } _pi_fp_capabilities;
389-
390338typedef enum {
391339 PI_IMAGE_INFO_FORMAT = 0x1110 ,
392340 PI_IMAGE_INFO_ELEMENT_SIZE = 0x1111 ,
@@ -627,7 +575,6 @@ using pi_image_info = _pi_image_info;
627575using pi_kernel_info = _pi_kernel_info;
628576using pi_kernel_group_info = _pi_kernel_group_info;
629577using pi_kernel_sub_group_info = _pi_kernel_sub_group_info;
630- using pi_fp_capabilities = _pi_fp_capabilities;
631578using pi_event_info = _pi_event_info;
632579using pi_command_type = _pi_command_type;
633580using pi_mem_type = _pi_mem_type;
@@ -649,16 +596,45 @@ using pi_profiling_info = _pi_profiling_info;
649596using pi_device_partition_property = intptr_t ;
650597static constexpr pi_device_partition_property PI_DEVICE_PARTITION_EQUALLY =
651598 0x1086 ;
599+ static constexpr pi_device_partition_property PI_DEVICE_PARTITION_BY_COUNTS =
600+ 0x1087 ;
601+ static constexpr pi_device_partition_property
602+ PI_DEVICE_PARTITION_BY_COUNTS_LIST_END = 0x0 ;
652603static constexpr pi_device_partition_property
653604 PI_DEVICE_PARTITION_BY_AFFINITY_DOMAIN = 0x1088 ;
654605
655606// For compatibility with OpenCL define this not as enum.
656607using pi_device_affinity_domain = pi_bitfield;
657608static constexpr pi_device_affinity_domain PI_DEVICE_AFFINITY_DOMAIN_NUMA =
658609 (1 << 0 );
610+ static constexpr pi_device_affinity_domain PI_DEVICE_AFFINITY_DOMAIN_L4_CACHE =
611+ (1 << 1 );
612+ static constexpr pi_device_affinity_domain PI_DEVICE_AFFINITY_DOMAIN_L3_CACHE =
613+ (1 << 2 );
614+ static constexpr pi_device_affinity_domain PI_DEVICE_AFFINITY_DOMAIN_L2_CACHE =
615+ (1 << 3 );
616+ static constexpr pi_device_affinity_domain PI_DEVICE_AFFINITY_DOMAIN_L1_CACHE =
617+ (1 << 4 );
659618static constexpr pi_device_affinity_domain
660619 PI_DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE = (1 << 5 );
661620
621+ // For compatibility with OpenCL define this not as enum.
622+ using pi_device_fp_config = pi_bitfield;
623+ static constexpr pi_device_fp_config PI_FP_DENORM = (1 << 0 );
624+ static constexpr pi_device_fp_config PI_FP_INF_NAN = (1 << 1 );
625+ static constexpr pi_device_fp_config PI_FP_ROUND_TO_NEAREST = (1 << 2 );
626+ static constexpr pi_device_fp_config PI_FP_ROUND_TO_ZERO = (1 << 3 );
627+ static constexpr pi_device_fp_config PI_FP_ROUND_TO_INF = (1 << 4 );
628+ static constexpr pi_device_fp_config PI_FP_FMA = (1 << 5 );
629+ static constexpr pi_device_fp_config PI_FP_SOFT_FLOAT = (1 << 6 );
630+ static constexpr pi_device_fp_config PI_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT =
631+ (1 << 7 );
632+
633+ // For compatibility with OpenCL define this not as enum.
634+ using pi_device_exec_capabilities = pi_bitfield;
635+ static constexpr pi_device_exec_capabilities PI_EXEC_KERNEL = (1 << 0 );
636+ static constexpr pi_device_exec_capabilities PI_EXEC_NATIVE_KERNEL = (1 << 1 );
637+
662638// Entry type, matches OpenMP for compatibility
663639struct _pi_offload_entry_struct {
664640 void *addr;
0 commit comments