summaryrefslogtreecommitdiff
path: root/lib/mesa/include/CL
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2021-07-22 10:17:30 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2021-07-22 10:17:30 +0000
commitca11beabae33eb59fb981b8adf50b1d47a2a98f0 (patch)
tree3e4691a396e6e54cd54224a190663d5cf976625b /lib/mesa/include/CL
parent27c8a50e8bbde7d28b1fc46d715a4c469e24f2c4 (diff)
Import Mesa 21.1.5
Diffstat (limited to 'lib/mesa/include/CL')
-rw-r--r--lib/mesa/include/CL/cl.h199
-rw-r--r--lib/mesa/include/CL/cl_ext_intel.h356
-rw-r--r--lib/mesa/include/CL/cl_icd.h69
-rw-r--r--lib/mesa/include/CL/cl_version.h43
4 files changed, 559 insertions, 108 deletions
diff --git a/lib/mesa/include/CL/cl.h b/lib/mesa/include/CL/cl.h
index 32ae73fc5..fa3bd0e1b 100644
--- a/lib/mesa/include/CL/cl.h
+++ b/lib/mesa/include/CL/cl.h
@@ -1,29 +1,17 @@
/*******************************************************************************
- * Copyright (c) 2008-2019 The Khronos Group Inc.
+ * Copyright (c) 2008-2020 The Khronos Group Inc.
*
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and/or associated documentation files (the
- * "Materials"), to deal in the Materials without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Materials, and to
- * permit persons to whom the Materials are furnished to do so, subject to
- * the following conditions:
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Materials.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
- * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
- * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
- * https://www.khronos.org/registry/
- *
- * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
******************************************************************************/
#ifndef __OPENCL_CL_H
@@ -50,6 +38,7 @@ typedef struct _cl_sampler * cl_sampler;
typedef cl_uint cl_bool; /* WARNING! Unlike cl_ types in cl_platform.h, cl_bool is not guaranteed to be the same size as the bool in kernels. */
typedef cl_ulong cl_bitfield;
+typedef cl_ulong cl_properties;
typedef cl_bitfield cl_device_type;
typedef cl_uint cl_platform_info;
typedef cl_uint cl_device_info;
@@ -69,7 +58,7 @@ typedef cl_bitfield cl_device_affinity_domain;
typedef intptr_t cl_context_properties;
typedef cl_uint cl_context_info;
#ifdef CL_VERSION_2_0
-typedef cl_bitfield cl_queue_properties;
+typedef cl_properties cl_queue_properties;
#endif
typedef cl_uint cl_command_queue_info;
typedef cl_uint cl_channel_order;
@@ -116,9 +105,16 @@ typedef cl_uint cl_event_info;
typedef cl_uint cl_command_type;
typedef cl_uint cl_profiling_info;
#ifdef CL_VERSION_2_0
-typedef cl_bitfield cl_sampler_properties;
+typedef cl_properties cl_sampler_properties;
typedef cl_uint cl_kernel_exec_info;
#endif
+#ifdef CL_VERSION_3_0
+typedef cl_bitfield cl_device_atomic_capabilities;
+typedef cl_bitfield cl_device_device_enqueue_capabilities;
+typedef cl_uint cl_khronos_vendor_id;
+typedef cl_properties cl_mem_properties;
+typedef cl_uint cl_version;
+#endif
typedef struct _cl_image_format {
cl_channel_order image_channel_order;
@@ -138,23 +134,29 @@ typedef struct _cl_image_desc {
cl_uint num_mip_levels;
cl_uint num_samples;
#ifdef CL_VERSION_2_0
-#ifdef __GNUC__
- __extension__ /* Prevents warnings about anonymous union in -pedantic builds */
-#endif
+#if __CL_HAS_ANON_STRUCT__
#ifdef _MSC_VER
+#if _MSC_VER >= 1500
#pragma warning( push )
#pragma warning( disable : 4201 ) /* Prevents warning about nameless struct/union in /W4 /Za builds */
#endif
+#endif
+ __CL_ANON_STRUCT__
union {
#endif
+#endif
cl_mem buffer;
#ifdef CL_VERSION_2_0
+#if __CL_HAS_ANON_STRUCT__
cl_mem mem_object;
};
#ifdef _MSC_VER
+#if _MSC_VER >= 1500
#pragma warning( pop )
#endif
#endif
+#endif
+#endif
} cl_image_desc;
#endif
@@ -168,6 +170,17 @@ typedef struct _cl_buffer_region {
#endif
+#ifdef CL_VERSION_3_0
+
+#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 */
@@ -266,6 +279,10 @@ typedef struct _cl_buffer_region {
#ifdef CL_VERSION_2_1
#define CL_PLATFORM_HOST_TIMER_RESOLUTION 0x0905
#endif
+#ifdef CL_VERSION_3_0
+#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)
@@ -385,6 +402,24 @@ 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_VERSION_3_0
+#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_CAPABILITIES 0x1070
+#define CL_DEVICE_PIPE_SUPPORT 0x1071
+#define CL_DEVICE_LATEST_CONFORMANCE_VERSION_PASSED 0x1072
+#endif
/* cl_device_fp_config - bitfield */
#define CL_FP_DENORM (1 << 0)
@@ -478,6 +513,9 @@ typedef struct _cl_buffer_region {
#ifdef CL_VERSION_2_1
#define CL_QUEUE_DEVICE_DEFAULT 0x1095
#endif
+#ifdef CL_VERSION_3_0
+#define CL_QUEUE_PROPERTIES_ARRAY 0x1098
+#endif
/* cl_mem_flags and cl_svm_mem_flags - bitfield */
#define CL_MEM_READ_WRITE (1 << 0)
@@ -586,6 +624,9 @@ typedef struct _cl_buffer_region {
#ifdef CL_VERSION_2_0
#define CL_MEM_USES_SVM_POINTER 0x1109
#endif
+#ifdef CL_VERSION_3_0
+#define CL_MEM_PROPERTIES 0x110A
+#endif
/* cl_image_info */
#define CL_IMAGE_FORMAT 0x1110
@@ -602,12 +643,14 @@ typedef struct _cl_buffer_region {
#define CL_IMAGE_NUM_SAMPLES 0x111A
#endif
-#ifdef CL_VERSION_2_0
/* cl_pipe_info */
+#ifdef CL_VERSION_2_0
#define CL_PIPE_PACKET_SIZE 0x1120
#define CL_PIPE_MAX_PACKETS 0x1121
-
+#endif
+#ifdef CL_VERSION_3_0
+#define CL_PIPE_PROPERTIES 0x1122
#endif
/* cl_addressing_mode */
@@ -637,6 +680,9 @@ typedef struct _cl_buffer_region {
#define CL_SAMPLER_LOD_MIN 0x1156
#define CL_SAMPLER_LOD_MAX 0x1157
#endif
+#ifdef CL_VERSION_3_0
+#define CL_SAMPLER_PROPERTIES 0x1158
+#endif
/* cl_map_flags - bitfield */
#define CL_MAP_READ (1 << 0)
@@ -701,10 +747,6 @@ typedef struct _cl_buffer_region {
#ifdef CL_VERSION_1_2
#define CL_KERNEL_ATTRIBUTES 0x1195
#endif
-#ifdef CL_VERSION_2_1
-#define CL_KERNEL_MAX_NUM_SUB_GROUPS 0x11B9
-#define CL_KERNEL_COMPILE_NUM_SUB_GROUPS 0x11BA
-#endif
#ifdef CL_VERSION_1_2
@@ -766,6 +808,8 @@ typedef struct _cl_buffer_region {
#define CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE 0x2033
#define CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE 0x2034
#define CL_KERNEL_LOCAL_SIZE_FOR_SUB_GROUP_COUNT 0x11B8
+#define CL_KERNEL_MAX_NUM_SUB_GROUPS 0x11B9
+#define CL_KERNEL_COMPILE_NUM_SUB_GROUPS 0x11BA
#endif
@@ -823,6 +867,9 @@ typedef struct _cl_buffer_region {
#define CL_COMMAND_SVM_MAP 0x120C
#define CL_COMMAND_SVM_UNMAP 0x120D
#endif
+#ifdef CL_VERSION_3_0
+#define CL_COMMAND_SVM_MIGRATE_MEM 0x120E
+#endif
/* command execution status */
#define CL_COMPLETE 0x0
@@ -830,11 +877,9 @@ typedef struct _cl_buffer_region {
#define CL_SUBMITTED 0x2
#define CL_QUEUED 0x3
-#ifdef CL_VERSION_1_1
-
/* cl_buffer_create_type */
+#ifdef CL_VERSION_1_1
#define CL_BUFFER_CREATE_TYPE_REGION 0x1220
-
#endif
/* cl_profiling_info */
@@ -846,6 +891,53 @@ typedef struct _cl_buffer_region {
#define CL_PROFILING_COMMAND_COMPLETE 0x1284
#endif
+/* cl_device_atomic_capabilities - bitfield */
+#ifdef CL_VERSION_3_0
+#define CL_DEVICE_ATOMIC_ORDER_RELAXED (1 << 0)
+#define CL_DEVICE_ATOMIC_ORDER_ACQ_REL (1 << 1)
+#define CL_DEVICE_ATOMIC_ORDER_SEQ_CST (1 << 2)
+#define CL_DEVICE_ATOMIC_SCOPE_WORK_ITEM (1 << 3)
+#define CL_DEVICE_ATOMIC_SCOPE_WORK_GROUP (1 << 4)
+#define CL_DEVICE_ATOMIC_SCOPE_DEVICE (1 << 5)
+#define CL_DEVICE_ATOMIC_SCOPE_ALL_DEVICES (1 << 6)
+#endif
+
+/* cl_device_device_enqueue_capabilities - bitfield */
+#ifdef CL_VERSION_3_0
+#define CL_DEVICE_QUEUE_SUPPORTED (1 << 0)
+#define CL_DEVICE_QUEUE_REPLACEABLE_DEFAULT (1 << 1)
+#endif
+
+/* cl_khronos_vendor_id */
+#define CL_KHRONOS_VENDOR_ID_CODEPLAY 0x10004
+
+#ifdef CL_VERSION_3_0
+
+/* 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 */
@@ -946,6 +1038,16 @@ clGetContextInfo(cl_context context,
void * param_value,
size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
+#ifdef CL_VERSION_3_0
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clSetContextDestructorCallback(cl_context context,
+ void (CL_CALLBACK* pfn_notify)(cl_context context,
+ void* user_data),
+ void* user_data) CL_API_SUFFIX__VERSION_3_0;
+
+#endif
+
/* Command Queue APIs */
#ifdef CL_VERSION_2_0
@@ -1014,6 +1116,27 @@ clCreatePipe(cl_context context,
#endif
+#ifdef CL_VERSION_3_0
+
+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__VERSION_3_0;
+
+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__VERSION_3_0;
+
+#endif
+
extern CL_API_ENTRY cl_int CL_API_CALL
clRetainMemObject(cl_mem memobj) CL_API_SUFFIX__VERSION_1_0;
@@ -1186,11 +1309,11 @@ clLinkProgram(cl_context context,
#ifdef CL_VERSION_2_2
-extern CL_API_ENTRY cl_int CL_API_CALL
+extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_2_2_DEPRECATED cl_int CL_API_CALL
clSetProgramReleaseCallback(cl_program program,
void (CL_CALLBACK * pfn_notify)(cl_program program,
void * user_data),
- void * user_data) CL_API_SUFFIX__VERSION_2_2;
+ void * user_data) CL_EXT_SUFFIX__VERSION_2_2_DEPRECATED;
extern CL_API_ENTRY cl_int CL_API_CALL
clSetProgramSpecializationConstant(cl_program program,
diff --git a/lib/mesa/include/CL/cl_ext_intel.h b/lib/mesa/include/CL/cl_ext_intel.h
index 9d1e4b587..aab82284c 100644
--- a/lib/mesa/include/CL/cl_ext_intel.h
+++ b/lib/mesa/include/CL/cl_ext_intel.h
@@ -1,33 +1,22 @@
/*******************************************************************************
- * Copyright (c) 2008-2019 The Khronos Group Inc.
+ * Copyright (c) 2008-2020 The Khronos Group Inc.
*
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and/or associated documentation files (the
- * "Materials"), to deal in the Materials without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Materials, and to
- * permit persons to whom the Materials are furnished to do so, subject to
- * the following conditions:
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Materials.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
- * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
- * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
- * https://www.khronos.org/registry/
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
- * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
******************************************************************************/
/*****************************************************************************\
-Copyright (c) 2013-2019 Intel Corporation All Rights Reserved.
+Copyright (c) 2013-2020 Intel Corporation All Rights Reserved.
THESE MATERIALS ARE PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -294,8 +283,8 @@ typedef cl_uint cl_diagnostics_verbose_level;
#define CL_DEVICE_AVC_ME_SUPPORTS_TEXTURE_SAMPLER_USE_INTEL 0x410C
#define CL_DEVICE_AVC_ME_SUPPORTS_PREEMPTION_INTEL 0x410D
-#define CL_AVC_ME_VERSION_0_INTEL 0x0; // No support.
-#define CL_AVC_ME_VERSION_1_INTEL 0x1; // First supported version.
+#define CL_AVC_ME_VERSION_0_INTEL 0x0 /* No support. */
+#define CL_AVC_ME_VERSION_1_INTEL 0x1 /* First supported version. */
#define CL_AVC_ME_MAJOR_16x16_INTEL 0x0
#define CL_AVC_ME_MAJOR_16x8_INTEL 0x1
@@ -416,6 +405,325 @@ typedef cl_uint cl_diagnostics_verbose_level;
#define CL_AVC_ME_INTERLACED_SCAN_TOP_FIELD_INTEL 0x0
#define CL_AVC_ME_INTERLACED_SCAN_BOTTOM_FIELD_INTEL 0x1
+/*******************************************
+* cl_intel_unified_shared_memory extension *
+********************************************/
+
+/* These APIs are in sync with Revision Q of the cl_intel_unified_shared_memory spec! */
+
+#define cl_intel_unified_shared_memory 1
+
+/* cl_device_info */
+#define CL_DEVICE_HOST_MEM_CAPABILITIES_INTEL 0x4190
+#define CL_DEVICE_DEVICE_MEM_CAPABILITIES_INTEL 0x4191
+#define CL_DEVICE_SINGLE_DEVICE_SHARED_MEM_CAPABILITIES_INTEL 0x4192
+#define CL_DEVICE_CROSS_DEVICE_SHARED_MEM_CAPABILITIES_INTEL 0x4193
+#define CL_DEVICE_SHARED_SYSTEM_MEM_CAPABILITIES_INTEL 0x4194
+
+typedef cl_bitfield cl_device_unified_shared_memory_capabilities_intel;
+
+/* cl_device_unified_shared_memory_capabilities_intel - bitfield */
+#define CL_UNIFIED_SHARED_MEMORY_ACCESS_INTEL (1 << 0)
+#define CL_UNIFIED_SHARED_MEMORY_ATOMIC_ACCESS_INTEL (1 << 1)
+#define CL_UNIFIED_SHARED_MEMORY_CONCURRENT_ACCESS_INTEL (1 << 2)
+#define CL_UNIFIED_SHARED_MEMORY_CONCURRENT_ATOMIC_ACCESS_INTEL (1 << 3)
+
+typedef cl_properties cl_mem_properties_intel;
+
+/* cl_mem_properties_intel */
+#define CL_MEM_ALLOC_FLAGS_INTEL 0x4195
+
+typedef cl_bitfield cl_mem_alloc_flags_intel;
+
+/* cl_mem_alloc_flags_intel - bitfield */
+#define CL_MEM_ALLOC_WRITE_COMBINED_INTEL (1 << 0)
+
+typedef cl_uint cl_mem_info_intel;
+
+/* cl_mem_alloc_info_intel */
+#define CL_MEM_ALLOC_TYPE_INTEL 0x419A
+#define CL_MEM_ALLOC_BASE_PTR_INTEL 0x419B
+#define CL_MEM_ALLOC_SIZE_INTEL 0x419C
+#define CL_MEM_ALLOC_DEVICE_INTEL 0x419D
+/* Enum values 0x419E-0x419F are reserved for future queries. */
+
+typedef cl_uint cl_unified_shared_memory_type_intel;
+
+/* cl_unified_shared_memory_type_intel */
+#define CL_MEM_TYPE_UNKNOWN_INTEL 0x4196
+#define CL_MEM_TYPE_HOST_INTEL 0x4197
+#define CL_MEM_TYPE_DEVICE_INTEL 0x4198
+#define CL_MEM_TYPE_SHARED_INTEL 0x4199
+
+typedef cl_uint cl_mem_advice_intel;
+
+/* cl_mem_advice_intel */
+/* Enum values 0x4208-0x420F are reserved for future memory advices. */
+
+/* cl_kernel_exec_info */
+#define CL_KERNEL_EXEC_INFO_INDIRECT_HOST_ACCESS_INTEL 0x4200
+#define CL_KERNEL_EXEC_INFO_INDIRECT_DEVICE_ACCESS_INTEL 0x4201
+#define CL_KERNEL_EXEC_INFO_INDIRECT_SHARED_ACCESS_INTEL 0x4202
+#define CL_KERNEL_EXEC_INFO_USM_PTRS_INTEL 0x4203
+
+/* cl_command_type */
+#define CL_COMMAND_MEMFILL_INTEL 0x4204
+#define CL_COMMAND_MEMCPY_INTEL 0x4205
+#define CL_COMMAND_MIGRATEMEM_INTEL 0x4206
+#define CL_COMMAND_MEMADVISE_INTEL 0x4207
+
+extern CL_API_ENTRY void* CL_API_CALL
+clHostMemAllocINTEL(
+ cl_context context,
+ const cl_mem_properties_intel* properties,
+ size_t size,
+ cl_uint alignment,
+ cl_int* errcode_ret);
+
+typedef CL_API_ENTRY void* (CL_API_CALL *
+clHostMemAllocINTEL_fn)(
+ cl_context context,
+ const cl_mem_properties_intel* properties,
+ size_t size,
+ cl_uint alignment,
+ cl_int* errcode_ret);
+
+extern CL_API_ENTRY void* CL_API_CALL
+clDeviceMemAllocINTEL(
+ cl_context context,
+ cl_device_id device,
+ const cl_mem_properties_intel* properties,
+ size_t size,
+ cl_uint alignment,
+ cl_int* errcode_ret);
+
+typedef CL_API_ENTRY void* (CL_API_CALL *
+clDeviceMemAllocINTEL_fn)(
+ cl_context context,
+ cl_device_id device,
+ const cl_mem_properties_intel* properties,
+ size_t size,
+ cl_uint alignment,
+ cl_int* errcode_ret);
+
+extern CL_API_ENTRY void* CL_API_CALL
+clSharedMemAllocINTEL(
+ cl_context context,
+ cl_device_id device,
+ const cl_mem_properties_intel* properties,
+ size_t size,
+ cl_uint alignment,
+ cl_int* errcode_ret);
+
+typedef CL_API_ENTRY void* (CL_API_CALL *
+clSharedMemAllocINTEL_fn)(
+ cl_context context,
+ cl_device_id device,
+ const cl_mem_properties_intel* properties,
+ size_t size,
+ cl_uint alignment,
+ cl_int* errcode_ret);
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clMemFreeINTEL(
+ cl_context context,
+ void* ptr);
+
+typedef CL_API_ENTRY cl_int (CL_API_CALL *
+clMemFreeINTEL_fn)(
+ cl_context context,
+ void* ptr);
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clMemBlockingFreeINTEL(
+ cl_context context,
+ void* ptr);
+
+typedef CL_API_ENTRY cl_int (CL_API_CALL *
+clMemBlockingFreeINTEL_fn)(
+ cl_context context,
+ void* ptr);
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clGetMemAllocInfoINTEL(
+ cl_context context,
+ const void* ptr,
+ cl_mem_info_intel param_name,
+ size_t param_value_size,
+ void* param_value,
+ size_t* param_value_size_ret);
+
+typedef CL_API_ENTRY cl_int (CL_API_CALL *
+clGetMemAllocInfoINTEL_fn)(
+ cl_context context,
+ const void* ptr,
+ cl_mem_info_intel param_name,
+ size_t param_value_size,
+ void* param_value,
+ size_t* param_value_size_ret);
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clSetKernelArgMemPointerINTEL(
+ cl_kernel kernel,
+ cl_uint arg_index,
+ const void* arg_value);
+
+typedef CL_API_ENTRY cl_int (CL_API_CALL *
+clSetKernelArgMemPointerINTEL_fn)(
+ cl_kernel kernel,
+ cl_uint arg_index,
+ const void* arg_value);
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clEnqueueMemsetINTEL( /* Deprecated */
+ cl_command_queue command_queue,
+ void* dst_ptr,
+ cl_int value,
+ size_t size,
+ cl_uint num_events_in_wait_list,
+ const cl_event* event_wait_list,
+ cl_event* event);
+
+typedef CL_API_ENTRY cl_int (CL_API_CALL *
+clEnqueueMemsetINTEL_fn)( /* Deprecated */
+ cl_command_queue command_queue,
+ void* dst_ptr,
+ cl_int value,
+ size_t size,
+ cl_uint num_events_in_wait_list,
+ const cl_event* event_wait_list,
+ cl_event* event);
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clEnqueueMemFillINTEL(
+ cl_command_queue command_queue,
+ void* dst_ptr,
+ const void* pattern,
+ size_t pattern_size,
+ size_t size,
+ cl_uint num_events_in_wait_list,
+ const cl_event* event_wait_list,
+ cl_event* event);
+
+typedef CL_API_ENTRY cl_int (CL_API_CALL *
+clEnqueueMemFillINTEL_fn)(
+ cl_command_queue command_queue,
+ void* dst_ptr,
+ const void* pattern,
+ size_t pattern_size,
+ size_t size,
+ cl_uint num_events_in_wait_list,
+ const cl_event* event_wait_list,
+ cl_event* event);
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clEnqueueMemcpyINTEL(
+ cl_command_queue command_queue,
+ cl_bool blocking,
+ void* dst_ptr,
+ const void* src_ptr,
+ size_t size,
+ cl_uint num_events_in_wait_list,
+ const cl_event* event_wait_list,
+ cl_event* event);
+
+typedef CL_API_ENTRY cl_int (CL_API_CALL *
+clEnqueueMemcpyINTEL_fn)(
+ cl_command_queue command_queue,
+ cl_bool blocking,
+ void* dst_ptr,
+ const void* src_ptr,
+ size_t size,
+ cl_uint num_events_in_wait_list,
+ const cl_event* event_wait_list,
+ cl_event* event);
+
+#ifdef CL_VERSION_1_2
+
+/* Because these APIs use cl_mem_migration_flags, they require
+ OpenCL 1.2: */
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clEnqueueMigrateMemINTEL(
+ cl_command_queue command_queue,
+ const void* ptr,
+ size_t size,
+ cl_mem_migration_flags flags,
+ cl_uint num_events_in_wait_list,
+ const cl_event* event_wait_list,
+ cl_event* event);
+
+typedef CL_API_ENTRY cl_int (CL_API_CALL *
+clEnqueueMigrateMemINTEL_fn)(
+ cl_command_queue command_queue,
+ const void* ptr,
+ size_t size,
+ cl_mem_migration_flags flags,
+ cl_uint num_events_in_wait_list,
+ const cl_event* event_wait_list,
+ cl_event* event);
+
+#endif
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clEnqueueMemAdviseINTEL(
+ cl_command_queue command_queue,
+ const void* ptr,
+ size_t size,
+ cl_mem_advice_intel advice,
+ cl_uint num_events_in_wait_list,
+ const cl_event* event_wait_list,
+ cl_event* event);
+
+typedef CL_API_ENTRY cl_int (CL_API_CALL *
+clEnqueueMemAdviseINTEL_fn)(
+ cl_command_queue command_queue,
+ const void* ptr,
+ size_t size,
+ cl_mem_advice_intel advice,
+ cl_uint num_events_in_wait_list,
+ const cl_event* event_wait_list,
+ cl_event* event);
+
+/***************************************************
+* cl_intel_create_buffer_with_properties extension *
+****************************************************/
+
+#define cl_intel_create_buffer_with_properties 1
+
+extern CL_API_ENTRY cl_mem CL_API_CALL
+clCreateBufferWithPropertiesINTEL(
+ cl_context context,
+ const cl_mem_properties_intel* properties,
+ cl_mem_flags flags,
+ size_t size,
+ void * host_ptr,
+ cl_int * errcode_ret) CL_EXT_SUFFIX__VERSION_1_0;
+
+typedef CL_API_ENTRY cl_mem (CL_API_CALL *
+clCreateBufferWithPropertiesINTEL_fn)(
+ cl_context context,
+ const cl_mem_properties_intel* properties,
+ cl_mem_flags flags,
+ size_t size,
+ void * host_ptr,
+ cl_int * errcode_ret) CL_EXT_SUFFIX__VERSION_1_0;
+
+/******************************************
+* cl_intel_mem_channel_property extension *
+*******************************************/
+
+#define CL_MEM_CHANNEL_INTEL 0x4213
+
+/*********************************
+* cl_intel_mem_force_host_memory *
+**********************************/
+
+#define cl_intel_mem_force_host_memory 1
+
+/* cl_mem_flags */
+#define CL_MEM_FORCE_HOST_MEMORY_INTEL (1 << 20)
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/mesa/include/CL/cl_icd.h b/lib/mesa/include/CL/cl_icd.h
index 2be64719b..8ff8b94f9 100644
--- a/lib/mesa/include/CL/cl_icd.h
+++ b/lib/mesa/include/CL/cl_icd.h
@@ -1,29 +1,17 @@
/*******************************************************************************
- * Copyright (c) 2019 The Khronos Group Inc.
+ * Copyright (c) 2019-2020 The Khronos Group Inc.
*
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and/or associated documentation files (the
- * "Materials"), to deal in the Materials without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Materials, and to
- * permit persons to whom the Materials are furnished to do so, subject to
- * the following conditions:
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Materials.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
- * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
- * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
- * https://www.khronos.org/registry/
- *
- * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
******************************************************************************/
#ifndef OPENCL_CL_ICD_H
@@ -34,6 +22,12 @@
#include <CL/cl_ext.h>
#include <CL/cl_gl.h>
+#if defined(_WIN32)
+#include <CL/cl_d3d11.h>
+#include <CL/cl_d3d10.h>
+#include <CL/cl_dx9_media_sharing.h>
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -157,6 +151,31 @@ typedef void *cl_api_clCreateImage;
#endif
+#ifdef CL_VERSION_3_0
+
+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__VERSION_3_0;
+
+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__VERSION_3_0;
+
+typedef CL_API_ENTRY cl_int(CL_API_CALL* cl_api_clSetContextDestructorCallback)(
+ cl_context context,
+ void(CL_CALLBACK* pfn_notify)(cl_context context, void* user_data),
+ void* user_data) CL_API_SUFFIX__VERSION_3_0;
+
+#else
+
+typedef void *cl_api_clCreateBufferWithProperties;
+typedef void *cl_api_clCreateImageWithProperties;
+typedef void *cl_api_clSetContextDestructorCallback;
+
+#endif
+
typedef CL_API_ENTRY cl_int(CL_API_CALL *cl_api_clRetainMemObject)(
cl_mem memobj) CL_API_SUFFIX__VERSION_1_0;
@@ -1260,6 +1279,12 @@ typedef struct _cl_icd_dispatch {
/* OpenCL 2.2 */
cl_api_clSetProgramReleaseCallback clSetProgramReleaseCallback;
cl_api_clSetProgramSpecializationConstant clSetProgramSpecializationConstant;
+
+ /* OpenCL 3.0 */
+ cl_api_clCreateBufferWithProperties clCreateBufferWithProperties;
+ cl_api_clCreateImageWithProperties clCreateImageWithProperties;
+ cl_api_clSetContextDestructorCallback clSetContextDestructorCallback;
+
} cl_icd_dispatch;
#ifdef __cplusplus
diff --git a/lib/mesa/include/CL/cl_version.h b/lib/mesa/include/CL/cl_version.h
index bb766cb9b..f38280a8a 100644
--- a/lib/mesa/include/CL/cl_version.h
+++ b/lib/mesa/include/CL/cl_version.h
@@ -1,29 +1,17 @@
/*******************************************************************************
- * Copyright (c) 2018 The Khronos Group Inc.
+ * Copyright (c) 2018-2020 The Khronos Group Inc.
*
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and/or associated documentation files (the
- * "Materials"), to deal in the Materials without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Materials, and to
- * permit persons to whom the Materials are furnished to do so, subject to
- * the following conditions:
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Materials.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
- * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
- * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
- * https://www.khronos.org/registry/
- *
- * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
******************************************************************************/
#ifndef __CL_VERSION_H
@@ -39,14 +27,18 @@
CL_TARGET_OPENCL_VERSION != 120 && \
CL_TARGET_OPENCL_VERSION != 200 && \
CL_TARGET_OPENCL_VERSION != 210 && \
- CL_TARGET_OPENCL_VERSION != 220
-#pragma message("cl_version: CL_TARGET_OPENCL_VERSION is not a valid value (100, 110, 120, 200, 210, 220). Defaulting to 220 (OpenCL 2.2)")
+ CL_TARGET_OPENCL_VERSION != 220 && \
+ CL_TARGET_OPENCL_VERSION != 300
+#pragma message("cl_version: CL_TARGET_OPENCL_VERSION is not a valid value (100, 110, 120, 200, 210, 220, 300). Defaulting to 220 (OpenCL 2.2)")
#undef CL_TARGET_OPENCL_VERSION
#define CL_TARGET_OPENCL_VERSION 220
#endif
/* OpenCL Version */
+#if CL_TARGET_OPENCL_VERSION >= 300 && !defined(CL_VERSION_3_0)
+#define CL_VERSION_3_0 1
+#endif
#if CL_TARGET_OPENCL_VERSION >= 220 && !defined(CL_VERSION_2_2)
#define CL_VERSION_2_2 1
#endif
@@ -67,6 +59,9 @@
#endif
/* Allow deprecated APIs for older OpenCL versions. */
+#if CL_TARGET_OPENCL_VERSION <= 220 && !defined(CL_USE_DEPRECATED_OPENCL_2_2_APIS)
+#define CL_USE_DEPRECATED_OPENCL_2_2_APIS
+#endif
#if CL_TARGET_OPENCL_VERSION <= 210 && !defined(CL_USE_DEPRECATED_OPENCL_2_1_APIS)
#define CL_USE_DEPRECATED_OPENCL_2_1_APIS
#endif