Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ AM_PROG_AR
LT_INIT([disable-static])
AC_CONFIG_TESTDIR([tests], [.])

m4_define([REQ_OPENCL_VERSION],[3_0])
m4_define([REQ_OPENCL_VERSION],[3_1])
OPENCL_VERSION="m4_translit(REQ_OPENCL_VERSION, [_], [.])"
AC_SUBST([OPENCL_VERSION])
AC_DEFINE_UNQUOTED([OCL_ICD_OPENCL_VERSION], ["$OPENCL_VERSION"],
Expand Down
8 changes: 4 additions & 4 deletions icd_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def self.include_headers_no_warnings
headers_no_warn << "# define CL_USE_DEPRECATED_OPENCL_2_0_APIS\n"
headers_no_warn << "# define CL_USE_DEPRECATED_OPENCL_2_1_APIS\n"
headers_no_warn << "# define CL_USE_DEPRECATED_OPENCL_2_2_APIS\n"
headers_no_warn << "# define CL_TARGET_OPENCL_VERSION 300\n"
headers_no_warn << "# define CL_TARGET_OPENCL_VERSION 310\n"
headers_no_warn << "# include <CL/opencl.h>\n"
headers_no_warn << self.include_headers
headers_no_warn << "#pragma GCC diagnostic pop\n"
Expand All @@ -193,7 +193,7 @@ def self.include_headers_no_warnings
# generate mode
def self.generate_libdummy_icd_header
libdummy_icd_structures = "/**\n#{$license}\n*/\n"
libdummy_icd_structures += "#define CL_TARGET_OPENCL_VERSION 300\n"
libdummy_icd_structures += "#define CL_TARGET_OPENCL_VERSION 310\n"
libdummy_icd_structures += "#include <CL/opencl.h>\n"
libdummy_icd_structures += self.include_headers
libdummy_icd_structures += "\n\nstruct _cl_icd_dispatch;\n"
Expand Down Expand Up @@ -357,7 +357,7 @@ def self.generate_icd_layer_source
#define CL_USE_DEPRECATED_OPENCL_2_0_APIS
#define CL_USE_DEPRECATED_OPENCL_2_1_APIS
#define CL_USE_DEPRECATED_OPENCL_2_2_APIS
#define CL_TARGET_OPENCL_VERSION 300
#define CL_TARGET_OPENCL_VERSION 310
#ifdef HAVE_OPENCL_CL_LAYER_H
#include <OpenCL/cl_layer.h>
#elif defined HAVE_CL_CL_LAYER_H
Expand Down Expand Up @@ -429,7 +429,7 @@ def self.generate_icd_layer_source
const struct _cl_icd_dispatch *target_dispatch,
cl_uint *num_entries_out,
const struct _cl_icd_dispatch **layer_dispatch,
cl_properties *properties) {
const cl_layer_properties *properties) {
(void)properties;
if (!target_dispatch || !layer_dispatch ||!num_entries_out || num_entries < sizeof(dispatch)/sizeof(dispatch.clGetPlatformIDs))
return -1;
Expand Down
120 changes: 77 additions & 43 deletions khronos-headers/CL/cl.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2008-2020 The Khronos Group Inc.
* Copyright (c) 2008-2026 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -24,6 +24,12 @@
extern "C" {
#endif

#if defined(_WIN32) && defined(_MSC_VER) && __CL_HAS_ANON_STRUCT__
/* Disable warning C4201: nonstandard extension used : nameless struct/union */
#pragma warning( push )
#pragma warning( disable : 4201 )
#endif

/******************************************************************************/

typedef struct _cl_platform_id * cl_platform_id;
Expand Down Expand Up @@ -112,8 +118,11 @@ typedef cl_uint cl_kernel_exec_info;
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;
typedef cl_properties cl_mem_properties;
#endif
typedef cl_uint cl_version;
#ifdef CL_VERSION_3_1
typedef cl_bitfield cl_device_integer_dot_product_capabilities;
#endif

typedef struct _cl_image_format {
Expand All @@ -133,39 +142,14 @@ typedef struct _cl_image_desc {
size_t image_slice_pitch;
cl_uint num_mip_levels;
cl_uint num_samples;
#ifdef CL_VERSION_2_0
#if defined(__GNUC__)
__extension__ /* Prevents warnings about anonymous union in -pedantic builds */
#endif
#if defined(_MSC_VER) && !defined(__STDC__)
#pragma warning( push )
#pragma warning( disable : 4201 ) /* Prevents warning about nameless struct/union in /W4 builds */
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wc11-extensions" /* Prevents warning about nameless union being C11 extension*/
#endif
#if defined(_MSC_VER) && defined(__STDC__)
/* Anonymous unions are not supported in /Za builds */
#else
union {
#endif
#if defined(CL_VERSION_2_0) && __CL_HAS_ANON_UNION__
__CL_ANON_UNION__ union {
#endif
cl_mem buffer;
#ifdef CL_VERSION_2_0
#if defined(_MSC_VER) && defined(__STDC__)
/* Anonymous unions are not supported in /Za builds */
#else
#if defined(CL_VERSION_2_0) && __CL_HAS_ANON_UNION__
cl_mem mem_object;
};
#endif
#if defined(_MSC_VER) && !defined(__STDC__)
#pragma warning( pop )
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif
} cl_image_desc;

#endif
Expand All @@ -190,6 +174,19 @@ typedef struct _cl_name_version {

#endif

#ifdef CL_VERSION_3_1

typedef struct _cl_device_integer_dot_product_acceleration_properties {
cl_bool signed_accelerated;
cl_bool unsigned_accelerated;
cl_bool mixed_signedness_accelerated;
cl_bool accumulating_saturating_signed_accelerated;
cl_bool accumulating_saturating_unsigned_accelerated;
cl_bool accumulating_saturating_mixed_signedness_accelerated;
} cl_device_integer_dot_product_acceleration_properties;

#endif

/******************************************************************************/

/* Error Codes */
Expand Down Expand Up @@ -309,7 +306,10 @@ typedef struct _cl_name_version {
#define CL_DEVICE_MAX_COMPUTE_UNITS 0x1002
#define CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS 0x1003
#define CL_DEVICE_MAX_WORK_GROUP_SIZE 0x1004
#define CL_DEVICE_MAX_WORK_ITEM_SIZES 0x1005
#define CL_DEVICE_MAX_WORK_ITEM_SIZES 0x1005 /* deprecated */
#ifdef CL_VERSION_3_1
#define CL_DEVICE_MAX_WORK_GROUP_SIZES 0x1005
#endif
#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR 0x1006
#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT 0x1007
#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT 0x1008
Expand Down Expand Up @@ -363,7 +363,7 @@ typedef struct _cl_name_version {
/* 0x1033 reserved for CL_DEVICE_HALF_FP_CONFIG which is already defined in "cl_ext.h" */
#ifdef CL_VERSION_1_1
#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF 0x1034
#define CL_DEVICE_HOST_UNIFIED_MEMORY 0x1035 /* deprecated */
#define CL_DEVICE_HOST_UNIFIED_MEMORY 0x1035
#define CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR 0x1036
#define CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT 0x1037
#define CL_DEVICE_NATIVE_VECTOR_WIDTH_INT 0x1038
Expand Down Expand Up @@ -423,12 +423,28 @@ typedef struct _cl_name_version {
#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 */
#endif
#ifdef CL_VERSION_3_1
#define CL_DEVICE_UUID 0x106A
#define CL_DRIVER_UUID 0x106B
#define CL_DEVICE_LUID_VALID 0x106C
#define CL_DEVICE_LUID 0x106D
#define CL_DEVICE_NODE_MASK 0x106E
#endif
#ifdef CL_VERSION_3_0
#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
#ifdef CL_VERSION_3_1
#define CL_DEVICE_INTEGER_DOT_PRODUCT_CAPABILITIES 0x1073
#define CL_DEVICE_INTEGER_DOT_PRODUCT_ACCELERATION_PROPERTIES_8BIT 0x1074
#define CL_DEVICE_INTEGER_DOT_PRODUCT_ACCELERATION_PROPERTIES_4x8BIT_PACKED 0x1075
#define CL_DEVICE_SPIRV_EXTENDED_INSTRUCTION_SETS 0x12B9
#define CL_DEVICE_SPIRV_EXTENSIONS 0x12BA
#define CL_DEVICE_SPIRV_CAPABILITIES 0x12BB
#endif

/* cl_device_fp_config - bitfield */
#define CL_FP_DENORM (1 << 0)
Expand Down Expand Up @@ -569,11 +585,8 @@ typedef struct _cl_name_version {
#define CL_RGx 0x10BB
#define CL_RGBx 0x10BC
#endif
#ifdef CL_VERSION_1_2
#define CL_DEPTH 0x10BD
#define CL_DEPTH_STENCIL 0x10BE
#endif
#ifdef CL_VERSION_2_0
#define CL_DEPTH 0x10BD
#define CL_sRGB 0x10BF
#define CL_sRGBx 0x10C0
#define CL_sRGBA 0x10C1
Expand All @@ -597,9 +610,6 @@ typedef struct _cl_name_version {
#define CL_UNSIGNED_INT32 0x10DC
#define CL_HALF_FLOAT 0x10DD
#define CL_FLOAT 0x10DE
#ifdef CL_VERSION_1_2
#define CL_UNORM_INT24 0x10DF
#endif
#ifdef CL_VERSION_2_1
#define CL_UNORM_INT_101010_2 0x10E0
#endif
Expand Down Expand Up @@ -920,8 +930,6 @@ typedef struct _cl_name_version {
/* 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)
Expand All @@ -945,6 +953,16 @@ typedef struct _cl_name_version {
(((minor) & CL_VERSION_MINOR_MASK) << CL_VERSION_PATCH_BITS) | \
((patch) & CL_VERSION_PATCH_MASK))

#ifdef CL_VERSION_3_1

/* Size Constants */
#define CL_UUID_SIZE 16
#define CL_LUID_SIZE 8

/* cl_device_integer_dot_product_capabilities - bitfield */
#define CL_DEVICE_INTEGER_DOT_PRODUCT_INPUT_4x8BIT_PACKED (1 << 0)
#define CL_DEVICE_INTEGER_DOT_PRODUCT_INPUT_4x8BIT (1 << 1)

#endif

/********************************************************************************************************/
Expand Down Expand Up @@ -1841,6 +1859,18 @@ clEnqueueSVMMigrateMem(cl_command_queue command_queue,

#endif

#ifdef CL_VERSION_3_1

extern CL_API_ENTRY cl_int CL_API_CALL
clGetKernelSuggestedLocalWorkSize(cl_command_queue command_queue,
cl_kernel kernel,
cl_uint work_dim,
const size_t * global_work_offset,
const size_t * global_work_size,
size_t * suggested_local_work_size) CL_API_SUFFIX__VERSION_3_1;

#endif

#ifdef CL_VERSION_1_2

/* Extension function access
Expand Down Expand Up @@ -1942,4 +1972,8 @@ clEnqueueTask(cl_command_queue command_queue,
}
#endif

#if defined(_WIN32) && defined(_MSC_VER) && __CL_HAS_ANON_STRUCT__
#pragma warning( pop )
#endif

#endif /* __OPENCL_CL_H */
Loading
Loading