diff options
author | Alastair Murray <alastairmurray42@gmail.com> | 2020-04-13 22:39:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-13 14:39:42 -0700 |
commit | 70a018cac5e07354ec5b32f4b2a3368cf8bd9d21 (patch) | |
tree | e8dd4164c89e9c5ae67e4989fe2380f16d66d81b | |
parent | c0a08056096c9e1ad945d1ef5756dc92fab93404 (diff) | |
download | OpenCL-Headers-70a018cac5e07354ec5b32f4b2a3368cf8bd9d21.tar.gz OpenCL-Headers-70a018cac5e07354ec5b32f4b2a3368cf8bd9d21.tar.bz2 OpenCL-Headers-70a018cac5e07354ec5b32f4b2a3368cf8bd9d21.zip |
Synchronize experimental enum etc with cl.xml (#83)
-rw-r--r-- | CL/cl.h | 111 | ||||
-rw-r--r-- | CL/cl_icd.h | 30 | ||||
-rw-r--r-- | CL/cl_platform.h | 2 |
3 files changed, 129 insertions, 14 deletions
@@ -109,7 +109,9 @@ typedef cl_uint cl_kernel_exec_info; #endif #ifdef CL_EXPERIMENTAL typedef cl_bitfield cl_device_atomic_capabilities; +typedef cl_bitfield cl_mem_properties; typedef cl_uint cl_khronos_vendor_id; +typedef cl_uint cl_version; #endif typedef struct _cl_image_format { @@ -160,6 +162,17 @@ typedef struct _cl_buffer_region { #endif +#ifdef CL_EXPERIMENTAL + +#define CL_NAME_VERSION_MAX_NAME_SIZE 64 + +typedef struct _cl_name_version { + cl_version version; + char name[CL_NAME_VERSION_MAX_NAME_SIZE]; +} cl_name_version; + +#endif + /******************************************************************************/ /* Error Codes */ @@ -258,6 +271,10 @@ typedef struct _cl_buffer_region { #ifdef CL_VERSION_2_1 #define CL_PLATFORM_HOST_TIMER_RESOLUTION 0x0905 #endif +#ifdef CL_EXPERIMENTAL +#define CL_PLATFORM_NUMERIC_VERSION 0x0906 +#define CL_PLATFORM_EXTENSIONS_WITH_VERSION 0x0907 +#endif /* cl_device_type - bitfield */ #define CL_DEVICE_TYPE_DEFAULT (1 << 0) @@ -377,6 +394,23 @@ typedef struct _cl_buffer_region { #define CL_DEVICE_MAX_NUM_SUB_GROUPS 0x105C #define CL_DEVICE_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS 0x105D #endif +#ifdef CL_EXPERIMENTAL +#define CL_DEVICE_NUMERIC_VERSION 0x105E +#define CL_DEVICE_EXTENSIONS_WITH_VERSION 0x1060 +#define CL_DEVICE_ILS_WITH_VERSION 0x1061 +#define CL_DEVICE_BUILT_IN_KERNELS_WITH_VERSION 0x1062 +#define CL_DEVICE_ATOMIC_MEMORY_CAPABILITIES 0x1063 +#define CL_DEVICE_ATOMIC_FENCE_CAPABILITIES 0x1064 +#define CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT 0x1065 +#define CL_DEVICE_OPENCL_C_ALL_VERSIONS 0x1066 +#define CL_DEVICE_PREFERRED_WORK_GROUP_SIZE_MULTIPLE 0x1067 +#define CL_DEVICE_WORK_GROUP_COLLECTIVE_FUNCTIONS_SUPPORT 0x1068 +#define CL_DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT 0x1069 +/* 0x106A to 0x106E - Reserved for upcoming KHR extension */ +#define CL_DEVICE_OPENCL_C_FEATURES 0x106F +#define CL_DEVICE_DEVICE_ENQUEUE_SUPPORT 0x1070 +#define CL_DEVICE_PIPE_SUPPORT 0x1071 +#endif /* cl_device_fp_config - bitfield */ #define CL_FP_DENORM (1 << 0) @@ -470,6 +504,9 @@ typedef struct _cl_buffer_region { #ifdef CL_VERSION_2_1 #define CL_QUEUE_DEVICE_DEFAULT 0x1095 #endif +#ifdef CL_EXPERIMENTAL +#define CL_QUEUE_PROPERTIES_ARRAY 0x1098 +#endif /* cl_mem_flags and cl_svm_mem_flags - bitfield */ #define CL_MEM_READ_WRITE (1 << 0) @@ -578,6 +615,9 @@ typedef struct _cl_buffer_region { #ifdef CL_VERSION_2_0 #define CL_MEM_USES_SVM_POINTER 0x1109 #endif +#ifdef CL_EXPERIMENTAL +#define CL_MEM_PROPERTIES 0x110A +#endif /* cl_image_info */ #define CL_IMAGE_FORMAT 0x1110 @@ -601,6 +641,9 @@ typedef struct _cl_buffer_region { #define CL_PIPE_MAX_PACKETS 0x1121 #endif +#ifdef CL_EXPERIMENTAL +#define CL_PIPE_PROPERTIES 0x1122 +#endif /* cl_addressing_mode */ #define CL_ADDRESS_NONE 0x1130 @@ -629,6 +672,9 @@ typedef struct _cl_buffer_region { #define CL_SAMPLER_LOD_MIN 0x1156 #define CL_SAMPLER_LOD_MAX 0x1157 #endif +#ifdef CL_EXPERIMENTAL +#define CL_SAMPLER_PROPERTIES 0x1158 +#endif /* cl_map_flags - bitfield */ #define CL_MAP_READ (1 << 0) @@ -813,6 +859,9 @@ typedef struct _cl_buffer_region { #define CL_COMMAND_SVM_MAP 0x120C #define CL_COMMAND_SVM_UNMAP 0x120D #endif +#ifdef CL_EXPERIMENTAL +#define CL_COMMAND_SVM_MIGRATE_MEM 0x120E +#endif /* command execution status */ #define CL_COMPLETE 0x0 @@ -847,25 +896,38 @@ typedef struct _cl_buffer_region { #define CL_DEVICE_ATOMIC_SCOPE_DEVICE (1 << 5) #define CL_DEVICE_ATOMIC_SCOPE_ALL_SVM_DEVICES (1 << 6) -/* cl_device_info */ -#define CL_DEVICE_ATOMIC_MEMORY_CAPABILITIES 0x1063 -#define CL_DEVICE_ATOMIC_FENCE_CAPABILITIES 0x1064 -#define CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT 0x1065 -#define CL_DEVICE_OPENCL_C_VERSIONS 0x1066 -#define CL_DEVICE_MAX_WRITE_IMAGE3D_ARGS 0x1067 -#define CL_DEVICE_WORK_GROUP_COLLECTIVE_FUNCTIONS_SUPPORT 0x1068 -#define CL_DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT 0x1069 -/* 0x106A to 0x106E - Reserved for upcoming KHR extension */ -#define CL_DEVICE_OPENCL_C_FEATURES 0x106F - -/* cl_command_type */ -#define CL_COMMAND_SVM_MIGRATE_MEM 0x120E - #endif /* cl_khronos_vendor_id */ #define CL_KHRONOS_VENDOR_ID_CODEPLAY 0x10004 +#ifdef CL_EXPERIMENTAL + +/* cl_version */ +#define CL_VERSION_MAJOR_BITS (10) +#define CL_VERSION_MINOR_BITS (10) +#define CL_VERSION_PATCH_BITS (12) + +#define CL_VERSION_MAJOR_MASK ((1 << CL_VERSION_MAJOR_BITS) - 1) +#define CL_VERSION_MINOR_MASK ((1 << CL_VERSION_MINOR_BITS) - 1) +#define CL_VERSION_PATCH_MASK ((1 << CL_VERSION_PATCH_BITS) - 1) + +#define CL_VERSION_MAJOR(version) \ + ((version) >> (CL_VERSION_MINOR_BITS + CL_VERSION_PATCH_BITS)) + +#define CL_VERSION_MINOR(version) \ + (((version) >> CL_VERSION_PATCH_BITS) & CL_VERSION_MINOR_MASK) + +#define CL_VERSION_PATCH(version) ((version) & CL_VERSION_PATCH_MASK) + +#define CL_MAKE_VERSION(major, minor, patch) \ + ((((major) & CL_VERSION_MAJOR_MASK) \ + << (CL_VERSION_MINOR_BITS + CL_VERSION_PATCH_BITS)) | \ + (((minor) & CL_VERSION_MINOR_MASK) << CL_VERSION_PATCH_BITS) | \ + ((patch) & CL_VERSION_PATCH_MASK)) + +#endif + /********************************************************************************************************/ /* Platform API */ @@ -1034,6 +1096,27 @@ clCreatePipe(cl_context context, #endif +#ifdef CL_EXPERIMENTAL + +extern CL_API_ENTRY cl_mem CL_API_CALL +clCreateBufferWithProperties(cl_context context, + const cl_mem_properties * properties, + cl_mem_flags flags, + size_t size, + void * host_ptr, + cl_int * errcode_ret) CL_API_SUFFIX__EXPERIMENTAL; + +extern CL_API_ENTRY cl_mem CL_API_CALL +clCreateImageWithProperties(cl_context context, + const cl_mem_properties * properties, + cl_mem_flags flags, + const cl_image_format * image_format, + const cl_image_desc * image_desc, + void * host_ptr, + cl_int * errcode_ret) CL_API_SUFFIX__EXPERIMENTAL; + +#endif + extern CL_API_ENTRY cl_int CL_API_CALL clRetainMemObject(cl_mem memobj) CL_API_SUFFIX__VERSION_1_0; diff --git a/CL/cl_icd.h b/CL/cl_icd.h index d3be8ac..2aca273 100644 --- a/CL/cl_icd.h +++ b/CL/cl_icd.h @@ -151,6 +151,25 @@ typedef void *cl_api_clCreateImage; #endif +#ifdef CL_EXPERIMENTAL + +typedef CL_API_ENTRY cl_mem(CL_API_CALL *cl_api_clCreateBufferWithProperties)( + cl_context context, const cl_mem_properties *properties, cl_mem_flags flags, + size_t size, void *host_ptr, + cl_int *errcode_ret) CL_API_SUFFIX__EXPERIMENTAL; + +typedef CL_API_ENTRY cl_mem(CL_API_CALL *cl_api_clCreateImageWithProperties)( + cl_context context, const cl_mem_properties *properties, cl_mem_flags flags, + const cl_image_format *image_format, const cl_image_desc *image_desc, + void *host_ptr, cl_int *errcode_ret) CL_API_SUFFIX__EXPERIMENTAL; + +#else + +typedef void *cl_api_clCreateBufferWithProperties; +typedef void *cl_api_clCreateImageWithProperties; + +#endif + typedef CL_API_ENTRY cl_int(CL_API_CALL *cl_api_clRetainMemObject)( cl_mem memobj) CL_API_SUFFIX__VERSION_1_0; @@ -1254,6 +1273,17 @@ typedef struct _cl_icd_dispatch { /* OpenCL 2.2 */ cl_api_clSetProgramReleaseCallback clSetProgramReleaseCallback; cl_api_clSetProgramSpecializationConstant clSetProgramSpecializationConstant; + +#ifdef CL_EXPERIMENTAL + /* Entries in the ICD struct should not normally be ifdef'ed because it is + * important that it be identical for all configurations. However, as these + * entry points are experimental they should not be in normal ICD builds. */ + + /* Experimental */ + cl_api_clCreateBufferWithProperties clCreateBufferWithProperties; + cl_api_clCreateImageWithProperties clCreateImageWithProperties; + +#endif } cl_icd_dispatch; #ifdef __cplusplus diff --git a/CL/cl_platform.h b/CL/cl_platform.h index 0462601..39048e6 100644 --- a/CL/cl_platform.h +++ b/CL/cl_platform.h @@ -54,6 +54,8 @@ extern "C" { #define CL_EXT_SUFFIX__VERSION_2_1 #define CL_API_SUFFIX__VERSION_2_2 #define CL_EXT_SUFFIX__VERSION_2_2 +#define CL_API_SUFFIX__EXPERIMENTAL +#define CL_EXT_SUFFIX__EXPERIMENTAL #ifdef __GNUC__ |