From b3ca3bdd0e83df6c19df022ad2f289f1f56d978b Mon Sep 17 00:00:00 2001
From: foreman
Date: Tue, 5 Sep 2017 16:10:54 -0400
Subject: [PATCH] P4 to Git Change 1455364 by lmoriche@lmoriche_opencl_dev2 on
2017/09/05 15:55:28
SWDEV-126884 - OCL 2.1 Platform APIs
- Update the OpenCL headers with Khronos GitHub latest
- Switch the runtime/compiler/compilerlib to OpenCL 2.2 headers (still reporting OpenCL 2.0)
- Move spir.h to compiler/llvm/lib/Transforms/SPIR
- Update the cl.hpp and cl2.hpp C++ wrappers.
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_context.cpp#55 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_icd_amd.h#19 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/build/Makefile.headers#5 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl.h#4 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl.hpp#3 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_d3d10.h#2 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_d3d11.h#2 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_dx9_media_sharing.h#2 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_ext.h#14 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_gl.h#2 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_gl_ext.h#2 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_platform.h#2 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl1.2/CL/opencl.h#2 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl1.2/CL/spir.h#3 delete
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl.h#23 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl.hpp#5 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl2.hpp#3 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_d3d10.h#4 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_d3d11.h#4 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_dx9_media_sharing.h#5 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_egl.h#5 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_ext.h#30 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_gl.h#4 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_gl_ext.h#3 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_platform.h#9 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.0/CL/opencl.h#3 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.0/CL/spir.h#3 delete
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.1/CL/cl.h#4 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.1/CL/cl.hpp#2 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.1/CL/cl2.hpp#1 add
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.1/CL/cl_d3d10.h#2 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.1/CL/cl_d3d11.h#2 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.1/CL/cl_dx9_media_sharing.h#2 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.1/CL/cl_egl.h#2 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.1/CL/cl_ext.h#7 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.1/CL/cl_gl.h#2 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.1/CL/cl_gl_ext.h#2 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.1/CL/cl_platform.h#3 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.1/CL/opencl.h#2 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.1/CL/spir.h#2 delete
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.2/CL/cl.h#1 add
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.2/CL/cl.hpp#1 add
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.2/CL/cl2.hpp#1 add
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.2/CL/cl_d3d10.h#1 add
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.2/CL/cl_d3d11.h#1 add
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.2/CL/cl_dx9_media_sharing.h#1 add
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.2/CL/cl_egl.h#1 add
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.2/CL/cl_ext.h#1 add
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.2/CL/cl_gl.h#1 add
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.2/CL/cl_gl_ext.h#1 add
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.2/CL/cl_platform.h#1 add
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.2/CL/opencl.h#1 add
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/icd/build/Makefile.icd#32 edit
... //depot/stg/opencl/drivers/opencl/compiler/clc/src/build/Makefile.clc#16 edit
... //depot/stg/opencl/drivers/opencl/compiler/clc/src/e2lSpir.cpp#18 edit
... //depot/stg/opencl/drivers/opencl/compiler/clc/src/e2lSpirMeta.cpp#11 edit
... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/Transforms/SPIR/AMDSPIRLoader.cpp#101 edit
... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/Transforms/SPIR/spir.h#1 branch
... //depot/stg/opencl/drivers/opencl/compiler/llvm32/lib/Transforms/SPIR/AMDSPIRLoader.cpp#3 edit
... //depot/stg/opencl/drivers/opencl/compiler/llvm32/lib/Transforms/SPIR/spir.h#1 branch
... //depot/stg/opencl/drivers/opencl/runtime/runtimedefs#45 edit
... //depot/stg/opencl/drivers/opencl/tests/ocltst/module/spir/SPIREnumCheck.cpp#3 edit
... //depot/stg/opencl/drivers/opencl/tests/ocltst/module/spir/build/Makefile.spir#18 edit
... //depot/stg/opencl/drivers/opencl/tools/cltrace/build/Makefile.cltrace#2 edit
... //depot/stg/opencl/drivers/opencl/tools/cltrace/cltrace.cpp#15 edit
---
opencl/api/opencl/amdocl/cl_context.cpp | 16 +-
opencl/api/opencl/amdocl/cl_icd_amd.h | 53 +-
.../opencl/khronos/headers/opencl1.2/CL/cl.h | 17 +-
.../khronos/headers/opencl1.2/CL/cl.hpp | 2068 ++-
.../khronos/headers/opencl1.2/CL/cl_d3d10.h | 23 +-
.../khronos/headers/opencl1.2/CL/cl_d3d11.h | 23 +-
.../opencl1.2/CL/cl_dx9_media_sharing.h | 23 +-
.../khronos/headers/opencl1.2/CL/cl_ext.h | 518 +-
.../khronos/headers/opencl1.2/CL/cl_gl.h | 9 +-
.../khronos/headers/opencl1.2/CL/cl_gl_ext.h | 9 +-
.../headers/opencl1.2/CL/cl_platform.h | 656 +-
.../khronos/headers/opencl1.2/CL/opencl.h | 7 +-
.../khronos/headers/opencl1.2/CL/spir.h | 118 -
.../opencl/khronos/headers/opencl2.0/CL/cl.h | 11 +-
.../khronos/headers/opencl2.0/CL/cl.hpp | 225 +-
.../khronos/headers/opencl2.0/CL/cl2.hpp | 262 +-
.../khronos/headers/opencl2.0/CL/cl_d3d10.h | 7 +-
.../khronos/headers/opencl2.0/CL/cl_d3d11.h | 7 +-
.../opencl2.0/CL/cl_dx9_media_sharing.h | 7 +-
.../khronos/headers/opencl2.0/CL/cl_egl.h | 9 +-
.../khronos/headers/opencl2.0/CL/cl_ext.h | 654 +-
.../khronos/headers/opencl2.0/CL/cl_gl.h | 7 +-
.../khronos/headers/opencl2.0/CL/cl_gl_ext.h | 7 +-
.../headers/opencl2.0/CL/cl_platform.h | 271 +-
.../khronos/headers/opencl2.0/CL/opencl.h | 7 +-
.../khronos/headers/opencl2.0/CL/spir.h | 118 -
.../opencl/khronos/headers/opencl2.1/CL/cl.h | 297 +-
.../khronos/headers/opencl2.1/CL/cl.hpp | 2068 ++-
.../khronos/headers/opencl2.1/CL/cl2.hpp | 9575 ++++++++++++
.../khronos/headers/opencl2.1/CL/cl_d3d10.h | 7 +-
.../khronos/headers/opencl2.1/CL/cl_d3d11.h | 7 +-
.../opencl2.1/CL/cl_dx9_media_sharing.h | 9 +-
.../khronos/headers/opencl2.1/CL/cl_egl.h | 9 +-
.../khronos/headers/opencl2.1/CL/cl_ext.h | 493 +-
.../khronos/headers/opencl2.1/CL/cl_gl.h | 7 +-
.../khronos/headers/opencl2.1/CL/cl_gl_ext.h | 7 +-
.../headers/opencl2.1/CL/cl_platform.h | 315 +-
.../khronos/headers/opencl2.1/CL/opencl.h | 7 +-
.../khronos/headers/opencl2.1/CL/spir.h | 118 -
.../opencl/khronos/headers/opencl2.2/CL/cl.h | 1468 ++
.../khronos/headers/opencl2.2/CL/cl.hpp | 12947 ++++++++++++++++
.../khronos/headers/opencl2.2/CL/cl2.hpp | 9575 ++++++++++++
.../khronos/headers/opencl2.2/CL/cl_d3d10.h | 131 +
.../khronos/headers/opencl2.2/CL/cl_d3d11.h | 131 +
.../opencl2.2/CL/cl_dx9_media_sharing.h | 132 +
.../khronos/headers/opencl2.2/CL/cl_egl.h | 136 +
.../khronos/headers/opencl2.2/CL/cl_ext.h | 821 +
.../khronos/headers/opencl2.2/CL/cl_gl.h | 167 +
.../khronos/headers/opencl2.2/CL/cl_gl_ext.h | 74 +
.../headers/opencl2.2/CL/cl_platform.h | 1458 ++
.../khronos/headers/opencl2.2/CL/opencl.h | 59 +
51 files changed, 42091 insertions(+), 3059 deletions(-)
delete mode 100644 opencl/api/opencl/khronos/headers/opencl1.2/CL/spir.h
delete mode 100644 opencl/api/opencl/khronos/headers/opencl2.0/CL/spir.h
create mode 100644 opencl/api/opencl/khronos/headers/opencl2.1/CL/cl2.hpp
delete mode 100644 opencl/api/opencl/khronos/headers/opencl2.1/CL/spir.h
create mode 100644 opencl/api/opencl/khronos/headers/opencl2.2/CL/cl.h
create mode 100644 opencl/api/opencl/khronos/headers/opencl2.2/CL/cl.hpp
create mode 100644 opencl/api/opencl/khronos/headers/opencl2.2/CL/cl2.hpp
create mode 100644 opencl/api/opencl/khronos/headers/opencl2.2/CL/cl_d3d10.h
create mode 100644 opencl/api/opencl/khronos/headers/opencl2.2/CL/cl_d3d11.h
create mode 100644 opencl/api/opencl/khronos/headers/opencl2.2/CL/cl_dx9_media_sharing.h
create mode 100644 opencl/api/opencl/khronos/headers/opencl2.2/CL/cl_egl.h
create mode 100644 opencl/api/opencl/khronos/headers/opencl2.2/CL/cl_ext.h
create mode 100644 opencl/api/opencl/khronos/headers/opencl2.2/CL/cl_gl.h
create mode 100644 opencl/api/opencl/khronos/headers/opencl2.2/CL/cl_gl_ext.h
create mode 100644 opencl/api/opencl/khronos/headers/opencl2.2/CL/cl_platform.h
create mode 100644 opencl/api/opencl/khronos/headers/opencl2.2/CL/opencl.h
diff --git a/opencl/api/opencl/amdocl/cl_context.cpp b/opencl/api/opencl/amdocl/cl_context.cpp
index ffb4ac21ed..2148e4b2b1 100644
--- a/opencl/api/opencl/amdocl/cl_context.cpp
+++ b/opencl/api/opencl/amdocl/cl_context.cpp
@@ -470,15 +470,15 @@ CL_API_ENTRY void* CL_API_CALL clGetExtensionFunctionAddress(const char* func_na
CL_EXTENSION_ENTRYPOINT_CHECK(clCreateFromD3D10Texture3DKHR);
CL_EXTENSION_ENTRYPOINT_CHECK(clCreateFromDX9MediaSurfaceKHR);
#endif //_WIN32
-#ifdef cl_ext_device_fission
+#if defined(cl_ext_device_fission) || defined(CL_VERSION_1_2)
CL_EXTENSION_ENTRYPOINT_CHECK(clCreateSubDevicesEXT);
-#endif // cl_ext_device_fission
+#endif // defined(cl_ext_device_fission) || defined(CL_VERSION_1_2)
CL_EXTENSION_ENTRYPOINT_CHECK(clCreateKeyAMD);
CL_EXTENSION_ENTRYPOINT_CHECK(clConvertImageAMD);
CL_EXTENSION_ENTRYPOINT_CHECK(clCreateBufferFromImageAMD);
-#if cl_khr_il_program
- CL_EXTENSION_ENTRYPOINT_CHECK(clCreateProgramWithILKHR);
-#endif // cl_khr_il_program
+#if defined(cl_khr_il_program) || defined(CL_VERSION_2_1)
+ CL_EXTENSION_ENTRYPOINT_CHECK(clCreateProgramWithILKHR)
+#endif // defined(cl_khr_il_program) || defined(CL_VERSION_2_1)
#if cl_amd_liquid_flash
CL_EXTENSION_ENTRYPOINT_CHECK(clCreateSsgFileObjectAMD);
#endif // cl_amd_liquid_flash
@@ -521,7 +521,9 @@ CL_API_ENTRY void* CL_API_CALL clGetExtensionFunctionAddress(const char* func_na
CL_EXTENSION_ENTRYPOINT_CHECK(clGetDeviceIDsFromDX9MediaAdapterKHR);
CL_EXTENSION_ENTRYPOINT_CHECK(clGetPlaneFromImageAMD);
#endif //_WIN32
+#if defined(cl_khr_sub_groups) || defined(CL_VERSION_2_1)
CL_EXTENSION_ENTRYPOINT_CHECK(clGetKernelSubGroupInfoKHR);
+#endif // defined(cl_khr_sub_groups) || defined(CL_VERSION_2_1)
#if cl_amd_liquid_flash
CL_EXTENSION_ENTRYPOINT_CHECK(clGetSsgFileObjectInfoAMD);
#endif // cl_amd_liquid_flash
@@ -566,10 +568,10 @@ CL_API_ENTRY void* CL_API_CALL clGetExtensionFunctionAddress(const char* func_na
CL_EXTENSION_ENTRYPOINT_CHECK(clRetainPerfCounterAMD);
CL_EXTENSION_ENTRYPOINT_CHECK(clReleaseThreadTraceAMD);
CL_EXTENSION_ENTRYPOINT_CHECK(clRetainThreadTraceAMD);
-#ifdef cl_ext_device_fission
+#if defined(cl_ext_device_fission) || defined(CL_VERSION_1_2)
CL_EXTENSION_ENTRYPOINT_CHECK(clRetainDeviceEXT);
CL_EXTENSION_ENTRYPOINT_CHECK(clReleaseDeviceEXT);
-#endif // cl_ext_device_fission
+#endif // defined(cl_ext_device_fission) || defined(CL_VERSION_1_2)
#if cl_amd_liquid_flash
CL_EXTENSION_ENTRYPOINT_CHECK(clRetainSsgFileObjectAMD);
CL_EXTENSION_ENTRYPOINT_CHECK(clReleaseSsgFileObjectAMD);
diff --git a/opencl/api/opencl/amdocl/cl_icd_amd.h b/opencl/api/opencl/amdocl/cl_icd_amd.h
index 7dd6d61724..26a167652e 100644
--- a/opencl/api/opencl/amdocl/cl_icd_amd.h
+++ b/opencl/api/opencl/amdocl/cl_icd_amd.h
@@ -153,6 +153,11 @@ typedef cl_program(CL_API_CALL* clCreateProgramWithSource_fn)(
cl_context /* context */, cl_uint /* count */, const char** /* strings */,
const size_t* /* lengths */, cl_int* /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
+extern CL_API_ENTRY cl_program CL_API_CALL
+clCreateProgramWithILKHR(cl_context /* context */,
+ const void * /* strings */, size_t /* lengths */,
+ cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_2_0;
+
typedef cl_program(CL_API_CALL* clCreateProgramWithILKHR_fn)(
cl_context /* context */, const void* /* il */, size_t /* length */,
cl_int* /* errcode_ret */) CL_API_SUFFIX__VERSION_1_2;
@@ -550,6 +555,35 @@ typedef cl_int(CL_API_CALL* clGetKernelSubGroupInfoKHR_fn)(
void* /* param_value */, size_t* /* param_value_size_ret */) CL_API_SUFFIX__VERSION_2_0;
+typedef cl_int(CL_API_CALL* clSetDefaultDeviceCommandQueue_fn)(
+ cl_context /* context */, cl_device_id /* device */,
+ cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_2_1;
+
+typedef cl_kernel(CL_API_CALL* clCloneKernel_fn)(
+ cl_kernel /* source_kernel */, cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_2_1;
+
+typedef cl_int (CL_API_CALL* clEnqueueSVMMigrateMem_fn)(
+ cl_command_queue /* command_queue */, cl_uint /* num_svm_pointers */,
+ const void ** /* svm_pointers */, const size_t * /* sizes */,
+ cl_mem_migration_flags /* flags */, cl_uint /* num_events_in_wait_list */,
+ const cl_event * /* event_wait_list */, cl_event * /* event */) CL_API_SUFFIX__VERSION_2_1;
+
+typedef cl_int (CL_API_CALL* clGetDeviceAndHostTimer_fn)(
+ cl_device_id /* device */, cl_ulong * /* device_timestamp */,
+ cl_ulong * /* host_timestamp */) CL_API_SUFFIX__VERSION_2_1;
+
+typedef cl_int (CL_API_CALL* clGetHostTimer_fn)(
+ cl_device_id /* device */, cl_ulong * /* host_timestamp */) CL_API_SUFFIX__VERSION_2_1;
+
+typedef cl_int (CL_API_CALL* clSetProgramSpecializationConstant_fn)(
+ cl_program /* program */, cl_uint /* spec_id */, size_t /* spec_size */,
+ const void* /* spec_value */) CL_API_SUFFIX__VERSION_2_2;
+
+typedef cl_int (CL_API_CALL* clSetProgramReleaseCallback_fn)(
+ cl_program /* program */,
+ void (CL_CALLBACK * /* pfn_notify */)(cl_program program, void * user_data),
+ void * /* user_data */) CL_API_SUFFIX__VERSION_2_2;
+
typedef struct _cl_icd_dispatch_table {
/* OpenCL 1.0 */
clGetPlatformIDs_fn GetPlatformIDs;
@@ -680,11 +714,22 @@ typedef struct _cl_icd_dispatch_table {
clSetKernelArgSVMPointer_fn SetKernelArgSVMPointer;
clSetKernelExecInfo_fn SetKernelExecInfo;
- clGetKernelSubGroupInfoKHR_fn GetKernelSubGroupInfoKHR;
- clTerminateContextKHR_fn TerminateContextKHR;
+ /* cl_khr_sub_groups */
+ clGetKernelSubGroupInfoKHR_fn clGetKernelSubGroupInfoKHR;
+
+ /* OpenCL 2.1 */
+ clCloneKernel_fn clCloneKernel;
+ clCreateProgramWithILKHR_fn clCreateProgramWithIL;
+ clEnqueueSVMMigrateMem_fn clEnqueueSVMMigrateMem;
+ clGetDeviceAndHostTimer_fn clGetDeviceAndHostTimer;
+ clGetHostTimer_fn clGetHostTimer;
+ clGetKernelSubGroupInfoKHR_fn clGetKernelSubGroupInfo;
+ clSetDefaultDeviceCommandQueue_fn clSetDefaultDeviceCommandQueue;
+
+ /* OpenCL 2.2 */
+ clSetProgramReleaseCallback_fn clSetProgramReleaseCallback;
+ clSetProgramSpecializationConstant_fn clSetProgramSpecializationConstant;
- /* cl_khr_il_program */
- clCreateProgramWithILKHR_fn CreateProgramWithILKHR;
} cl_icd_dispatch_table;
#ifdef __cplusplus
diff --git a/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl.h b/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl.h
index 1ade724fe3..9b082480ac 100644
--- a/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl.h
+++ b/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl.h
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 - 2012 The Khronos Group Inc.
+ * Copyright (c) 2008-2015 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
@@ -12,6 +12,11 @@
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
+ * 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.
@@ -255,7 +260,7 @@ typedef struct _cl_buffer_region {
#define CL_DEVICE_EXTENSIONS 0x1030
#define CL_DEVICE_PLATFORM 0x1031
#define CL_DEVICE_DOUBLE_FP_CONFIG 0x1032
-/* 0x1033 reserved for CL_DEVICE_HALF_FP_CONFIG */
+#define CL_DEVICE_HALF_FP_CONFIG 0x1033
#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF 0x1034
#define CL_DEVICE_HOST_UNIFIED_MEMORY 0x1035
#define CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR 0x1036
@@ -280,7 +285,6 @@ typedef struct _cl_buffer_region {
#define CL_DEVICE_PRINTF_BUFFER_SIZE 0x1049
#define CL_DEVICE_IMAGE_PITCH_ALIGNMENT 0x104A
#define CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT 0x104B
-/* 0x104C reserved for CL_DEVICE_SVM_CAPABILITIES */
/* cl_device_fp_config - bitfield */
#define CL_FP_DENORM (1 << 0)
@@ -346,7 +350,7 @@ typedef struct _cl_buffer_region {
#define CL_MEM_USE_HOST_PTR (1 << 3)
#define CL_MEM_ALLOC_HOST_PTR (1 << 4)
#define CL_MEM_COPY_HOST_PTR (1 << 5)
-// reserved (1 << 6)
+/* reserved (1 << 6) */
#define CL_MEM_HOST_WRITE_ONLY (1 << 7)
#define CL_MEM_HOST_READ_ONLY (1 << 8)
#define CL_MEM_HOST_NO_ACCESS (1 << 9)
@@ -502,7 +506,7 @@ typedef struct _cl_buffer_region {
#define CL_KERNEL_ARG_ACCESS_READ_WRITE 0x11A2
#define CL_KERNEL_ARG_ACCESS_NONE 0x11A3
-/* cl_kernel_arg_type_qualifer */
+/* cl_kernel_arg_type_qualifier */
#define CL_KERNEL_ARG_TYPE_NONE 0
#define CL_KERNEL_ARG_TYPE_CONST (1 << 0)
#define CL_KERNEL_ARG_TYPE_RESTRICT (1 << 1)
@@ -549,7 +553,6 @@ typedef struct _cl_buffer_region {
#define CL_COMMAND_MIGRATE_MEM_OBJECTS 0x1206
#define CL_COMMAND_FILL_BUFFER 0x1207
#define CL_COMMAND_FILL_IMAGE 0x1208
-/* 0x1209-0x120F reserved for SVM commands */
/* command execution status */
#define CL_COMPLETE 0x0
@@ -1167,7 +1170,7 @@ clGetExtensionFunctionAddressForPlatform(cl_platform_id /* platform */,
const char * /* func_name */) CL_API_SUFFIX__VERSION_1_2;
-// Deprecated OpenCL 1.1 APIs
+/* Deprecated OpenCL 1.1 APIs */
extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
clCreateImage2D(cl_context /* context */,
cl_mem_flags /* flags */,
diff --git a/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl.hpp b/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl.hpp
index 667526e341..18175abc2a 100644
--- a/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl.hpp
+++ b/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl.hpp
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008-2013 The Khronos Group Inc.
+ * Copyright (c) 2008-2015 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
@@ -12,6 +12,11 @@
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
+ * 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.
@@ -31,9 +36,10 @@
* Brian Cole, March 3rd 2010 and April 2012
* Matt Gruenke, April 2012.
* Bruce Merry, February 2013.
+ * Tom Deakin and Simon McIntosh-Smith, July 2013
*
- * \version 1.2.5
- * \date June 2013
+ * \version 1.2.9
+ * \date December 2015
*
* Optional extension support
*
@@ -146,37 +152,42 @@
#ifdef _WIN32
-#include
#include
-#include
-#include
-#if defined(__CL_ENABLE_EXCEPTIONS)
-#include
-#endif // #if defined(__CL_ENABLE_EXCEPTIONS)
-
-#pragma push_macro("max")
-#undef max
#if defined(USE_DX_INTEROP)
#include
#include
#endif
#endif // _WIN32
+#if defined(_MSC_VER)
+#include
+#endif // _MSC_VER
+
//
#if defined(USE_CL_DEVICE_FISSION)
#include
#endif
#if defined(__APPLE__) || defined(__MACOSX)
-#include
#include
-#include
#else
-#include
#include
#endif // !__APPLE__
+#if (_MSC_VER >= 1700) || (__cplusplus >= 201103L)
+#define CL_HPP_RVALUE_REFERENCES_SUPPORTED
+#define CL_HPP_CPP11_ATOMICS_SUPPORTED
+#include
+#endif
+
+#if (__cplusplus >= 201103L)
+#define CL_HPP_NOEXCEPT noexcept
+#else
+#define CL_HPP_NOEXCEPT
+#endif
+
+
// To avoid accidentally taking ownership of core OpenCL types
// such as cl_kernel constructors are made explicit
// under OpenCL 1.2
@@ -201,6 +212,11 @@
#include
#include
+#include
+
+#if defined(__CL_ENABLE_EXCEPTIONS)
+#include
+#endif // #if defined(__CL_ENABLE_EXCEPTIONS)
#if !defined(__NO_STD_VECTOR)
#include
@@ -210,12 +226,9 @@
#include
#endif
-#if defined(__linux__) || defined(__APPLE__) || defined(__MACOSX)
+#if defined(__ANDROID__) || defined(linux) || defined(__APPLE__) || defined(__MACOSX)
#include
-
-#include
-#include
-#endif // __linux__
+#endif // linux
#include
@@ -388,7 +401,7 @@ static inline cl_int errHandler (cl_int err, const char * errStr = NULL)
#define __BUILD_PROGRAM_ERR __ERR_STR(clBuildProgram)
#if defined(CL_VERSION_1_2)
#define __COMPILE_PROGRAM_ERR __ERR_STR(clCompileProgram)
-
+#define __LINK_PROGRAM_ERR __ERR_STR(clLinkProgram)
#endif // #if defined(CL_VERSION_1_2)
#define __CREATE_KERNELS_IN_PROGRAM_ERR __ERR_STR(clCreateKernelsInProgram)
@@ -473,7 +486,7 @@ typedef std::string STRING_CLASS;
* re-define the string class to match the std::string
* interface by defining STRING_CLASS
*/
-class CL_EXT_PREFIX__VERSION_1_1_DEPRECATED string CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED
+class CL_EXT_PREFIX__VERSION_1_1_DEPRECATED string
{
private:
::size_t size_;
@@ -545,7 +558,7 @@ public:
}
else {
char *newString = new char[n + 1];
- int copySize = n;
+ ::size_t copySize = n;
if( size_ < n ) {
copySize = size_;
}
@@ -639,7 +652,7 @@ public:
* or "" if empty/unset.
*/
const char * c_str(void) const { return (str_) ? str_ : "";}
-};
+} CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
typedef cl::string STRING_CLASS;
#endif // #elif !defined(__USE_DEV_STRING)
@@ -675,7 +688,7 @@ typedef cl::string STRING_CLASS;
* \param N maximum size of the vector.
*/
template
-class CL_EXT_PREFIX__VERSION_1_1_DEPRECATED vector CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED
+class CL_EXT_PREFIX__VERSION_1_1_DEPRECATED vector
{
private:
T data_[N];
@@ -717,7 +730,7 @@ public:
*/
void push_back (const T& x)
{
- if (size() < N) {
+ if (size() < N) {
new (&data_[size_]) T(x);
size_++;
} else {
@@ -738,7 +751,7 @@ public:
detail::errHandler(CL_MEM_OBJECT_ALLOCATION_FAILURE, __VECTOR_CAPACITY_ERR);
}
}
-
+
/*! \brief Constructs with a value copied from another.
*
* \param vec the vector to copy.
@@ -746,7 +759,7 @@ public:
vector(const vector& vec) :
size_(vec.size_)
{
- if (size_ != 0) {
+ if (size_ != 0) {
assign(vec.begin(), vec.end());
}
}
@@ -783,7 +796,7 @@ public:
} else {
clear();
}
-
+
return *this;
}
@@ -829,6 +842,28 @@ public:
return N;
}
+ //! \brief Resizes the vector to the given size
+ void resize(unsigned int newSize, T fill = T())
+ {
+ if (newSize > N)
+ {
+ detail::errHandler(CL_MEM_OBJECT_ALLOCATION_FAILURE, __VECTOR_CAPACITY_ERR);
+ }
+ else
+ {
+ while (size_ < newSize)
+ {
+ new (&data_[size_]) T(fill);
+ size_++;
+ }
+ while (size_ > newSize)
+ {
+ --size_;
+ data_[size_].~T();
+ }
+ }
+ }
+
/*! \brief Returns a reference to a given element.
*
* \param index which element to access. *
@@ -1005,7 +1040,7 @@ public:
{
return data_[size_-1];
}
-};
+} CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
#endif // #if !defined(__USE_DEV_VECTOR) && !defined(__NO_STD_VECTOR)
@@ -1020,25 +1055,39 @@ namespace detail {
/*
* Compare and exchange primitives are needed for handling of defaults
*/
+
+#ifdef CL_HPP_CPP11_ATOMICS_SUPPORTED
+ inline int compare_exchange(std::atomic * dest, int exchange, int comparand)
+#else // !CL_HPP_CPP11_ATOMICS_SUPPORTED
inline int compare_exchange(volatile int * dest, int exchange, int comparand)
+#endif // !CL_HPP_CPP11_ATOMICS_SUPPORTED
{
-#ifdef _WIN32
- return (int)(InterlockedCompareExchange(
- (volatile long*)dest,
- (long)exchange,
- (long)comparand));
-#elif defined(__APPLE__) || defined(__MACOSX)
- return OSAtomicOr32Orig((uint32_t)exchange, (volatile uint32_t*)dest);
-#else // !_WIN32 || defined(__APPLE__) || defined(__MACOSX)
+#ifdef CL_HPP_CPP11_ATOMICS_SUPPORTED
+ std::atomic_compare_exchange_strong(dest, &comparand, exchange);
+ return comparand;
+#elif _MSC_VER
+ return (int)(_InterlockedCompareExchange(
+ (volatile long*)dest,
+ (long)exchange,
+ (long)comparand));
+#else // !_MSC_VER && !CL_HPP_CPP11_ATOMICS_SUPPORTED
return (__sync_val_compare_and_swap(
- dest,
- comparand,
+ dest,
+ comparand,
exchange));
-#endif // !_WIN32
+#endif // !CL_HPP_CPP11_ATOMICS_SUPPORTED
}
- inline void fence() { _mm_mfence(); }
-}; // namespace detail
+ inline void fence() {
+#ifdef CL_HPP_CPP11_ATOMICS_SUPPORTED
+ std::atomic_thread_fence(std::memory_order_seq_cst);
+#elif _MSC_VER // !CL_HPP_CPP11_ATOMICS_SUPPORTED
+ _ReadWriteBarrier();
+#else // !_MSC_VER && !CL_HPP_CPP11_ATOMICS_SUPPORTED
+ __sync_synchronize();
+#endif // !CL_HPP_CPP11_ATOMICS_SUPPORTED
+ }
+} // namespace detail
/*! \brief class used to interface between C++ and
@@ -1162,13 +1211,14 @@ inline cl_int getInfoHelper(Func f, cl_uint name, VECTOR_CLASS* param, i
template
inline cl_int getInfoHelper(Func f, cl_uint name, STRING_CLASS* param, long)
{
+#if defined(__NO_STD_VECTOR) || defined(__NO_STD_STRING)
::size_t required;
cl_int err = f(name, 0, NULL, &required);
if (err != CL_SUCCESS) {
return err;
}
- char* value = (char*) alloca(required);
+ char* value = (char*)alloca(required);
err = f(name, required, value, NULL);
if (err != CL_SUCCESS) {
return err;
@@ -1176,6 +1226,25 @@ inline cl_int getInfoHelper(Func f, cl_uint name, STRING_CLASS* param, long)
*param = value;
return CL_SUCCESS;
+#else
+ ::size_t required;
+ cl_int err = f(name, 0, NULL, &required);
+ if (err != CL_SUCCESS) {
+ return err;
+ }
+
+ // std::string has a constant data member
+ // a char vector does not
+ VECTOR_CLASS value(required);
+ err = f(name, required, value.data(), NULL);
+ if (err != CL_SUCCESS) {
+ return err;
+ }
+ if (param) {
+ param->assign(value.begin(), value.end());
+ }
+#endif
+ return CL_SUCCESS;
}
// Specialized GetInfoHelper for cl::size_t params
@@ -1293,7 +1362,7 @@ inline cl_int getInfoHelper(Func f, cl_uint name, T* param, int, typename T::cl_
F(cl_event_info, CL_EVENT_COMMAND_QUEUE, cl::CommandQueue) \
F(cl_event_info, CL_EVENT_COMMAND_TYPE, cl_command_type) \
F(cl_event_info, CL_EVENT_REFERENCE_COUNT, cl_uint) \
- F(cl_event_info, CL_EVENT_COMMAND_EXECUTION_STATUS, cl_uint) \
+ F(cl_event_info, CL_EVENT_COMMAND_EXECUTION_STATUS, cl_int) \
\
F(cl_profiling_info, CL_PROFILING_COMMAND_QUEUED, cl_ulong) \
F(cl_profiling_info, CL_PROFILING_COMMAND_SUBMIT, cl_ulong) \
@@ -1318,9 +1387,9 @@ inline cl_int getInfoHelper(Func f, cl_uint name, T* param, int, typename T::cl_
\
F(cl_sampler_info, CL_SAMPLER_REFERENCE_COUNT, cl_uint) \
F(cl_sampler_info, CL_SAMPLER_CONTEXT, cl::Context) \
- F(cl_sampler_info, CL_SAMPLER_NORMALIZED_COORDS, cl_addressing_mode) \
- F(cl_sampler_info, CL_SAMPLER_ADDRESSING_MODE, cl_filter_mode) \
- F(cl_sampler_info, CL_SAMPLER_FILTER_MODE, cl_bool) \
+ F(cl_sampler_info, CL_SAMPLER_NORMALIZED_COORDS, cl_bool) \
+ F(cl_sampler_info, CL_SAMPLER_ADDRESSING_MODE, cl_addressing_mode) \
+ F(cl_sampler_info, CL_SAMPLER_FILTER_MODE, cl_filter_mode) \
\
F(cl_program_info, CL_PROGRAM_REFERENCE_COUNT, cl_uint) \
F(cl_program_info, CL_PROGRAM_CONTEXT, cl::Context) \
@@ -1390,6 +1459,7 @@ inline cl_int getInfoHelper(Func f, cl_uint name, T* param, int, typename T::cl_
F(cl_kernel_arg_info, CL_KERNEL_ARG_ACCESS_QUALIFIER, cl_kernel_arg_access_qualifier) \
F(cl_kernel_arg_info, CL_KERNEL_ARG_TYPE_NAME, STRING_CLASS) \
F(cl_kernel_arg_info, CL_KERNEL_ARG_NAME, STRING_CLASS) \
+ F(cl_kernel_arg_info, CL_KERNEL_ARG_TYPE_QUALIFIER, cl_kernel_arg_type_qualifier) \
\
F(cl_device_info, CL_DEVICE_PARENT_DEVICE, cl_device_id) \
F(cl_device_info, CL_DEVICE_PARTITION_PROPERTIES, VECTOR_CLASS) \
@@ -1674,7 +1744,7 @@ static cl_uint getVersion(const char *versionInfo)
++index;
}
++index;
- while(versionInfo[index] != ' ' ) {
+ while(versionInfo[index] != ' ' && versionInfo[index] != '\0') {
lowVersion *= 10;
lowVersion += versionInfo[index]-'0';
++index;
@@ -1738,14 +1808,36 @@ public:
if (object_ != NULL) { detail::errHandler(retain(), __RETAIN_ERR); }
}
+#if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
+ Wrapper(Wrapper&& rhs) CL_HPP_NOEXCEPT
+ {
+ object_ = rhs.object_;
+ rhs.object_ = NULL;
+ }
+#endif
+
Wrapper& operator = (const Wrapper& rhs)
{
- if (object_ != NULL) { detail::errHandler(release(), __RELEASE_ERR); }
- object_ = rhs.object_;
- if (object_ != NULL) { detail::errHandler(retain(), __RETAIN_ERR); }
+ if (this != &rhs) {
+ if (object_ != NULL) { detail::errHandler(release(), __RELEASE_ERR); }
+ object_ = rhs.object_;
+ if (object_ != NULL) { detail::errHandler(retain(), __RETAIN_ERR); }
+ }
return *this;
}
+#if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
+ Wrapper& operator = (Wrapper&& rhs)
+ {
+ if (this != &rhs) {
+ if (object_ != NULL) { detail::errHandler(release(), __RELEASE_ERR); }
+ object_ = rhs.object_;
+ rhs.object_ = NULL;
+ }
+ return *this;
+ }
+#endif
+
Wrapper& operator = (const cl_type &rhs)
{
if (object_ != NULL) { detail::errHandler(release(), __RELEASE_ERR); }
@@ -1816,15 +1908,41 @@ public:
if (object_ != NULL) { detail::errHandler(retain(), __RETAIN_ERR); }
}
- Wrapper& operator = (const Wrapper& rhs)
+#if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
+ Wrapper(Wrapper&& rhs) CL_HPP_NOEXCEPT
{
- if (object_ != NULL) { detail::errHandler(release(), __RELEASE_ERR); }
object_ = rhs.object_;
referenceCountable_ = rhs.referenceCountable_;
- if (object_ != NULL) { detail::errHandler(retain(), __RETAIN_ERR); }
+ rhs.object_ = NULL;
+ rhs.referenceCountable_ = false;
+ }
+#endif
+
+ Wrapper& operator = (const Wrapper& rhs)
+ {
+ if (this != &rhs) {
+ if (object_ != NULL) { detail::errHandler(release(), __RELEASE_ERR); }
+ object_ = rhs.object_;
+ referenceCountable_ = rhs.referenceCountable_;
+ if (object_ != NULL) { detail::errHandler(retain(), __RETAIN_ERR); }
+ }
return *this;
}
+#if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
+ Wrapper& operator = (Wrapper&& rhs)
+ {
+ if (this != &rhs) {
+ if (object_ != NULL) { detail::errHandler(release(), __RELEASE_ERR); }
+ object_ = rhs.object_;
+ referenceCountable_ = rhs.referenceCountable_;
+ rhs.object_ = NULL;
+ rhs.referenceCountable_ = false;
+ }
+ return *this;
+ }
+#endif
+
Wrapper& operator = (const cl_type &rhs)
{
if (object_ != NULL) { detail::errHandler(release(), __RELEASE_ERR); }
@@ -1909,17 +2027,11 @@ public:
//! \brief Default constructor - initializes to NULL.
Device() : detail::Wrapper() { }
- /*! \brief Copy constructor.
- *
- * This simply copies the device ID value, which is an inexpensive operation.
- */
- Device(const Device& device) : detail::Wrapper(device) { }
-
/*! \brief Constructor from cl_device_id.
*
* This simply copies the device ID value, which is an inexpensive operation.
*/
- Device(const cl_device_id &device) : detail::Wrapper(device) { }
+ __CL_EXPLICIT_CONSTRUCTORS Device(const cl_device_id &device) : detail::Wrapper(device) { }
/*! \brief Returns the first device on the default context.
*
@@ -1927,18 +2039,6 @@ public:
*/
static Device getDefault(cl_int * err = NULL);
- /*! \brief Assignment operator from Device.
- *
- * This simply copies the device ID value, which is an inexpensive operation.
- */
- Device& operator = (const Device& rhs)
- {
- if (this != &rhs) {
- detail::Wrapper::operator=(rhs);
- }
- return *this;
- }
-
/*! \brief Assignment operator from cl_device_id.
*
* This simply copies the device ID value, which is an inexpensive operation.
@@ -1949,6 +2049,36 @@ public:
return *this;
}
+ /*! \brief Copy constructor to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ Device(const Device& dev) : detail::Wrapper(dev) {}
+
+ /*! \brief Copy assignment to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ Device& operator = (const Device &dev)
+ {
+ detail::Wrapper::operator=(dev);
+ return *this;
+ }
+
+#if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
+ /*! \brief Move constructor to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ Device(Device&& dev) CL_HPP_NOEXCEPT : detail::Wrapper(std::move(dev)) {}
+
+ /*! \brief Move assignment to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ Device& operator = (Device &&dev)
+ {
+ detail::Wrapper::operator=(std::move(dev));
+ return *this;
+ }
+#endif // #if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
+
//! \brief Wrapper for clGetDeviceInfo().
template
cl_int getInfo(cl_device_info name, T* param) const
@@ -2050,29 +2180,11 @@ public:
//! \brief Default constructor - initializes to NULL.
Platform() : detail::Wrapper() { }
- /*! \brief Copy constructor.
- *
- * This simply copies the platform ID value, which is an inexpensive operation.
- */
- Platform(const Platform& platform) : detail::Wrapper(platform) { }
-
/*! \brief Constructor from cl_platform_id.
*
* This simply copies the platform ID value, which is an inexpensive operation.
*/
- Platform(const cl_platform_id &platform) : detail::Wrapper(platform) { }
-
- /*! \brief Assignment operator from Platform.
- *
- * This simply copies the platform ID value, which is an inexpensive operation.
- */
- Platform& operator = (const Platform& rhs)
- {
- if (this != &rhs) {
- detail::Wrapper::operator=(rhs);
- }
- return *this;
- }
+ __CL_EXPLICIT_CONSTRUCTORS Platform(const cl_platform_id &platform) : detail::Wrapper(platform) { }
/*! \brief Assignment operator from cl_platform_id.
*
@@ -2283,6 +2395,7 @@ public:
if (errResult != NULL) {
*errResult = err;
}
+ return Platform();
}
cl_platform_id* ids = (cl_platform_id*) alloca(
@@ -2291,13 +2404,14 @@ public:
if (err != CL_SUCCESS) {
detail::errHandler(err, __GET_PLATFORM_IDS_ERR);
+ if (errResult != NULL) {
+ *errResult = err;
+ }
+ return Platform();
}
- if (errResult != NULL) {
- *errResult = err;
- }
- return ids[0];
+ return Platform(ids[0]);
}
static Platform getDefault(
@@ -2346,16 +2460,15 @@ class Context
: public detail::Wrapper
{
private:
+
+#ifdef CL_HPP_CPP11_ATOMICS_SUPPORTED
+ static std::atomic default_initialized_;
+#else // !CL_HPP_CPP11_ATOMICS_SUPPORTED
static volatile int default_initialized_;
+#endif // !CL_HPP_CPP11_ATOMICS_SUPPORTED
static Context default_;
static volatile cl_int default_error_;
public:
- /*! \brief Destructor.
- *
- * This calls clReleaseContext() on the value held by this instance.
- */
- ~Context() { }
-
/*! \brief Constructs a context including a list of specified devices.
*
* Wraps clCreateContext().
@@ -2416,7 +2529,7 @@ public:
}
}
- /*! \brief Constructs a context including all devices of a specified type.
+ /*! \brief Constructs a context including all or a subset of devices of a specified type.
*
* Wraps clCreateContextFromType().
*/
@@ -2433,18 +2546,62 @@ public:
{
cl_int error;
-#if !defined(__APPLE__) || !defined(__MACOS)
- cl_context_properties prop[4] = {CL_CONTEXT_PLATFORM, 0, 0, 0 };
+#if !defined(__APPLE__) && !defined(__MACOS)
+ cl_context_properties prop[4] = {CL_CONTEXT_PLATFORM, 0, 0, 0 };
+
if (properties == NULL) {
- prop[1] = (cl_context_properties)Platform::get(&error)();
+ // Get a valid platform ID as we cannot send in a blank one
+ VECTOR_CLASS platforms;
+ error = Platform::get(&platforms);
if (error != CL_SUCCESS) {
detail::errHandler(error, __CREATE_CONTEXT_FROM_TYPE_ERR);
if (err != NULL) {
*err = error;
- return;
+ }
+ return;
+ }
+
+ // Check the platforms we found for a device of our specified type
+ cl_context_properties platform_id = 0;
+ for (unsigned int i = 0; i < platforms.size(); i++) {
+
+ VECTOR_CLASS devices;
+
+#if defined(__CL_ENABLE_EXCEPTIONS)
+ try {
+#endif
+
+ error = platforms[i].getDevices(type, &devices);
+
+#if defined(__CL_ENABLE_EXCEPTIONS)
+ } catch (Error) {}
+ // Catch if exceptions are enabled as we don't want to exit if first platform has no devices of type
+ // We do error checking next anyway, and can throw there if needed
+#endif
+
+ // Only squash CL_SUCCESS and CL_DEVICE_NOT_FOUND
+ if (error != CL_SUCCESS && error != CL_DEVICE_NOT_FOUND) {
+ detail::errHandler(error, __CREATE_CONTEXT_FROM_TYPE_ERR);
+ if (err != NULL) {
+ *err = error;
+ }
+ }
+
+ if (devices.size() > 0) {
+ platform_id = (cl_context_properties)platforms[i]();
+ break;
}
}
+ if (platform_id == 0) {
+ detail::errHandler(CL_DEVICE_NOT_FOUND, __CREATE_CONTEXT_FROM_TYPE_ERR);
+ if (err != NULL) {
+ *err = CL_DEVICE_NOT_FOUND;
+ }
+ return;
+ }
+
+ prop[1] = platform_id;
properties = &prop[0];
}
#endif
@@ -2457,6 +2614,36 @@ public:
}
}
+ /*! \brief Copy constructor to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ Context(const Context& ctx) : detail::Wrapper(ctx) {}
+
+ /*! \brief Copy assignment to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ Context& operator = (const Context &ctx)
+ {
+ detail::Wrapper::operator=(ctx);
+ return *this;
+ }
+
+#if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
+ /*! \brief Move constructor to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ Context(Context&& ctx) CL_HPP_NOEXCEPT : detail::Wrapper(std::move(ctx)) {}
+
+ /*! \brief Move assignment to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ Context& operator = (Context &&ctx)
+ {
+ detail::Wrapper::operator=(std::move(ctx));
+ return *this;
+ }
+#endif // #if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
+
/*! \brief Returns a singleton context including all devices of CL_DEVICE_TYPE_DEFAULT.
*
* \note All calls to this function return the same cl_context as the first.
@@ -2512,12 +2699,6 @@ public:
//! \brief Default constructor - initializes to NULL.
Context() : detail::Wrapper() { }
- /*! \brief Copy constructor.
- *
- * This calls clRetainContext() on the parameter's cl_context.
- */
- Context(const Context& context) : detail::Wrapper(context) { }
-
/*! \brief Constructor from cl_context - takes ownership.
*
* This effectively transfers ownership of a refcount on the cl_context
@@ -2525,19 +2706,6 @@ public:
*/
__CL_EXPLICIT_CONSTRUCTORS Context(const cl_context& context) : detail::Wrapper(context) { }
- /*! \brief Assignment operator from Context.
- *
- * This calls clRetainContext() on the parameter and clReleaseContext() on
- * the previous value held by this instance.
- */
- Context& operator = (const Context& rhs)
- {
- if (this != &rhs) {
- detail::Wrapper::operator=(rhs);
- }
- return *this;
- }
-
/*! \brief Assignment operator from cl_context - takes ownership.
*
* This effectively transfers ownership of a refcount on the rhs and calls
@@ -2582,31 +2750,41 @@ public:
VECTOR_CLASS* formats) const
{
cl_uint numEntries;
+
+ if (!formats) {
+ return CL_SUCCESS;
+ }
+
cl_int err = ::clGetSupportedImageFormats(
- object_,
- flags,
- type,
- 0,
- NULL,
- &numEntries);
+ object_,
+ flags,
+ type,
+ 0,
+ NULL,
+ &numEntries);
if (err != CL_SUCCESS) {
return detail::errHandler(err, __GET_SUPPORTED_IMAGE_FORMATS_ERR);
}
- ImageFormat* value = (ImageFormat*)
- alloca(numEntries * sizeof(ImageFormat));
- err = ::clGetSupportedImageFormats(
- object_,
- flags,
- type,
- numEntries,
- (cl_image_format*) value,
- NULL);
- if (err != CL_SUCCESS) {
- return detail::errHandler(err, __GET_SUPPORTED_IMAGE_FORMATS_ERR);
- }
+ if (numEntries > 0) {
+ ImageFormat* value = (ImageFormat*)
+ alloca(numEntries * sizeof(ImageFormat));
+ err = ::clGetSupportedImageFormats(
+ object_,
+ flags,
+ type,
+ numEntries,
+ (cl_image_format*)value,
+ NULL);
+ if (err != CL_SUCCESS) {
+ return detail::errHandler(err, __GET_SUPPORTED_IMAGE_FORMATS_ERR);
+ }
- formats->assign(&value[0], &value[numEntries]);
+ formats->assign(&value[0], &value[numEntries]);
+ }
+ else {
+ formats->clear();
+ }
return CL_SUCCESS;
}
};
@@ -2617,7 +2795,7 @@ inline Device Device::getDefault(cl_int * err)
Device device;
Context context = Context::getDefault(&error);
- detail::errHandler(error, __CREATE_COMMAND_QUEUE_ERR);
+ detail::errHandler(error, __CREATE_CONTEXT_ERR);
if (error != CL_SUCCESS) {
if (err != NULL) {
@@ -2636,14 +2814,22 @@ inline Device Device::getDefault(cl_int * err)
#ifdef _WIN32
+#ifdef CL_HPP_CPP11_ATOMICS_SUPPORTED
+__declspec(selectany) std::atomic Context::default_initialized_;
+#else // !CL_HPP_CPP11_ATOMICS_SUPPORTED
__declspec(selectany) volatile int Context::default_initialized_ = __DEFAULT_NOT_INITIALIZED;
+#endif // !CL_HPP_CPP11_ATOMICS_SUPPORTED
__declspec(selectany) Context Context::default_;
__declspec(selectany) volatile cl_int Context::default_error_ = CL_SUCCESS;
-#else
+#else // !_WIN32
+#ifdef CL_HPP_CPP11_ATOMICS_SUPPORTED
+__attribute__((weak)) std::atomic Context::default_initialized_;
+#else // !CL_HPP_CPP11_ATOMICS_SUPPORTED
__attribute__((weak)) volatile int Context::default_initialized_ = __DEFAULT_NOT_INITIALIZED;
+#endif // !CL_HPP_CPP11_ATOMICS_SUPPORTED
__attribute__((weak)) Context Context::default_;
__attribute__((weak)) volatile cl_int Context::default_error_ = CL_SUCCESS;
-#endif
+#endif // !_WIN32
/*! \brief Class interface for cl_event.
*
@@ -2656,46 +2842,21 @@ __attribute__((weak)) volatile cl_int Context::default_error_ = CL_SUCCESS;
class Event : public detail::Wrapper
{
public:
- /*! \brief Destructor.
- *
- * This calls clReleaseEvent() on the value held by this instance.
- */
- ~Event() { }
-
//! \brief Default constructor - initializes to NULL.
Event() : detail::Wrapper() { }
- /*! \brief Copy constructor.
- *
- * This calls clRetainEvent() on the parameter's cl_event.
- */
- Event(const Event& event) : detail::Wrapper(event) { }
-
/*! \brief Constructor from cl_event - takes ownership.
*
* This effectively transfers ownership of a refcount on the cl_event
* into the new Event object.
*/
- Event(const cl_event& event) : detail::Wrapper(event) { }
+ __CL_EXPLICIT_CONSTRUCTORS Event(const cl_event& event) : detail::Wrapper(event) { }
/*! \brief Assignment operator from cl_event - takes ownership.
*
* This effectively transfers ownership of a refcount on the rhs and calls
* clReleaseEvent() on the value previously held by this instance.
*/
- Event& operator = (const Event& rhs)
- {
- if (this != &rhs) {
- detail::Wrapper::operator=(rhs);
- }
- return *this;
- }
-
- /*! \brief Assignment operator from cl_event.
- *
- * This calls clRetainEvent() on the parameter and clReleaseEvent() on
- * the previous value held by this instance.
- */
Event& operator = (const cl_event& rhs)
{
detail::Wrapper::operator=(rhs);
@@ -2788,7 +2949,7 @@ public:
{
return detail::errHandler(
::clWaitForEvents(
- (cl_uint) events.size(), (cl_event*)&events.front()),
+ (cl_uint) events.size(), (events.size() > 0) ? (cl_event*)&events.front() : NULL),
__WAIT_FOR_EVENTS_ERR);
}
};
@@ -2823,18 +2984,6 @@ public:
//! \brief Default constructor - initializes to NULL.
UserEvent() : Event() { }
- //! \brief Copy constructor - performs shallow copy.
- UserEvent(const UserEvent& event) : Event(event) { }
-
- //! \brief Assignment Operator - performs shallow copy.
- UserEvent& operator = (const UserEvent& rhs)
- {
- if (this != &rhs) {
- Event::operator=(rhs);
- }
- return *this;
- }
-
/*! \brief Sets the execution status of a user event object.
*
* Wraps clSetUserEventStatus().
@@ -2857,7 +3006,7 @@ WaitForEvents(const VECTOR_CLASS& events)
{
return detail::errHandler(
::clWaitForEvents(
- (cl_uint) events.size(), (cl_event*)&events.front()),
+ (cl_uint) events.size(), (events.size() > 0) ? (cl_event*)&events.front() : NULL),
__WAIT_FOR_EVENTS_ERR);
}
@@ -2872,22 +3021,9 @@ WaitForEvents(const VECTOR_CLASS& events)
class Memory : public detail::Wrapper
{
public:
-
- /*! \brief Destructor.
- *
- * This calls clReleaseMemObject() on the value held by this instance.
- */
- ~Memory() {}
-
//! \brief Default constructor - initializes to NULL.
Memory() : detail::Wrapper() { }
- /*! \brief Copy constructor - performs shallow copy.
- *
- * This calls clRetainMemObject() on the parameter's cl_mem.
- */
- Memory(const Memory& memory) : detail::Wrapper(memory) { }
-
/*! \brief Constructor from cl_mem - takes ownership.
*
* This effectively transfers ownership of a refcount on the cl_mem
@@ -2895,19 +3031,6 @@ public:
*/
__CL_EXPLICIT_CONSTRUCTORS Memory(const cl_mem& memory) : detail::Wrapper(memory) { }
- /*! \brief Assignment operator from Memory.
- *
- * This calls clRetainMemObject() on the parameter and clReleaseMemObject()
- * on the previous value held by this instance.
- */
- Memory& operator = (const Memory& rhs)
- {
- if (this != &rhs) {
- detail::Wrapper::operator=(rhs);
- }
- return *this;
- }
-
/*! \brief Assignment operator from cl_mem - takes ownership.
*
* This effectively transfers ownership of a refcount on the rhs and calls
@@ -2919,6 +3042,36 @@ public:
return *this;
}
+ /*! \brief Copy constructor to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ Memory(const Memory& mem) : detail::Wrapper(mem) {}
+
+ /*! \brief Copy assignment to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ Memory& operator = (const Memory &mem)
+ {
+ detail::Wrapper::operator=(mem);
+ return *this;
+ }
+
+#if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
+ /*! \brief Move constructor to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ Memory(Memory&& mem) CL_HPP_NOEXCEPT : detail::Wrapper(std::move(mem)) {}
+
+ /*! \brief Move assignment to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ Memory& operator = (Memory &&mem)
+ {
+ detail::Wrapper::operator=(std::move(mem));
+ return *this;
+ }
+#endif // #if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
+
//! \brief Wrapper for clGetMemObjectInfo().
template
cl_int getInfo(cl_mem_info name, T* param) const
@@ -2977,6 +3130,11 @@ template< typename IteratorType >
cl_int copy( IteratorType startIterator, IteratorType endIterator, cl::Buffer &buffer );
template< typename IteratorType >
cl_int copy( const cl::Buffer &buffer, IteratorType startIterator, IteratorType endIterator );
+template< typename IteratorType >
+cl_int copy( const CommandQueue &queue, IteratorType startIterator, IteratorType endIterator, cl::Buffer &buffer );
+template< typename IteratorType >
+cl_int copy( const CommandQueue &queue, const cl::Buffer &buffer, IteratorType startIterator, IteratorType endIterator );
+
/*! \brief Class interface for Buffer Memory Objects.
*
@@ -3040,7 +3198,8 @@ public:
/*!
* \brief Construct a Buffer from a host container via iterators.
- * If useHostPtr is specified iterators must be random access.
+ * IteratorType must be random access.
+ * If useHostPtr is specified iterators must represent contiguous data.
*/
template< typename IteratorType >
Buffer(
@@ -3088,33 +3247,32 @@ public:
}
}
+ /*!
+ * \brief Construct a Buffer from a host container via iterators using a specified context.
+ * IteratorType must be random access.
+ * If useHostPtr is specified iterators must represent contiguous data.
+ */
+ template< typename IteratorType >
+ Buffer(const Context &context, IteratorType startIterator, IteratorType endIterator,
+ bool readOnly, bool useHostPtr = false, cl_int* err = NULL);
+
+ /*!
+ * \brief Construct a Buffer from a host container via iterators using a specified queue.
+ * If useHostPtr is specified iterators must represent contiguous data.
+ */
+ template< typename IteratorType >
+ Buffer(const CommandQueue &queue, IteratorType startIterator, IteratorType endIterator,
+ bool readOnly, bool useHostPtr = false, cl_int* err = NULL);
+
//! \brief Default constructor - initializes to NULL.
Buffer() : Memory() { }
- /*! \brief Copy constructor - performs shallow copy.
- *
- * See Memory for further details.
- */
- Buffer(const Buffer& buffer) : Memory(buffer) { }
-
/*! \brief Constructor from cl_mem - takes ownership.
*
* See Memory for further details.
*/
__CL_EXPLICIT_CONSTRUCTORS Buffer(const cl_mem& buffer) : Memory(buffer) { }
- /*! \brief Assignment from Buffer - performs shallow copy.
- *
- * See Memory for further details.
- */
- Buffer& operator = (const Buffer& rhs)
- {
- if (this != &rhs) {
- Memory::operator=(rhs);
- }
- return *this;
- }
-
/*! \brief Assignment from cl_mem - performs shallow copy.
*
* See Memory for further details.
@@ -3124,6 +3282,36 @@ public:
Memory::operator=(rhs);
return *this;
}
+
+ /*! \brief Copy constructor to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ Buffer(const Buffer& buf) : Memory(buf) {}
+
+ /*! \brief Copy assignment to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ Buffer& operator = (const Buffer &buf)
+ {
+ Memory::operator=(buf);
+ return *this;
+ }
+
+#if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
+ /*! \brief Move constructor to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ Buffer(Buffer&& buf) CL_HPP_NOEXCEPT : Memory(std::move(buf)) {}
+
+ /*! \brief Move assignment to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ Buffer& operator = (Buffer &&buf)
+ {
+ Memory::operator=(std::move(buf));
+ return *this;
+ }
+#endif // #if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
#if defined(CL_VERSION_1_1)
/*! \brief Creates a new buffer object from this.
@@ -3214,30 +3402,12 @@ public:
//! \brief Default constructor - initializes to NULL.
BufferD3D10() : Buffer() { }
- /*! \brief Copy constructor - performs shallow copy.
- *
- * See Memory for further details.
- */
- BufferD3D10(const BufferD3D10& buffer) : Buffer(buffer) { }
-
/*! \brief Constructor from cl_mem - takes ownership.
*
* See Memory for further details.
*/
__CL_EXPLICIT_CONSTRUCTORS BufferD3D10(const cl_mem& buffer) : Buffer(buffer) { }
- /*! \brief Assignment from BufferD3D10 - performs shallow copy.
- *
- * See Memory for further details.
- */
- BufferD3D10& operator = (const BufferD3D10& rhs)
- {
- if (this != &rhs) {
- Buffer::operator=(rhs);
- }
- return *this;
- }
-
/*! \brief Assignment from cl_mem - performs shallow copy.
*
* See Memory for further details.
@@ -3247,6 +3417,36 @@ public:
Buffer::operator=(rhs);
return *this;
}
+
+ /*! \brief Copy constructor to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ BufferD3D10(const BufferD3D10& buf) : Buffer(buf) {}
+
+ /*! \brief Copy assignment to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ BufferD3D10& operator = (const BufferD3D10 &buf)
+ {
+ Buffer::operator=(buf);
+ return *this;
+ }
+
+#if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
+ /*! \brief Move constructor to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ BufferD3D10(BufferD3D10&& buf) CL_HPP_NOEXCEPT : Buffer(std::move(buf)) {}
+
+ /*! \brief Move assignment to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ BufferD3D10& operator = (BufferD3D10 &&buf)
+ {
+ Buffer::operator=(std::move(buf));
+ return *this;
+ }
+#endif // #if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
};
#endif
@@ -3269,7 +3469,7 @@ public:
BufferGL(
const Context& context,
cl_mem_flags flags,
- GLuint bufobj,
+ cl_GLuint bufobj,
cl_int * err = NULL)
{
cl_int error;
@@ -3288,30 +3488,12 @@ public:
//! \brief Default constructor - initializes to NULL.
BufferGL() : Buffer() { }
- /*! \brief Copy constructor - performs shallow copy.
- *
- * See Memory for further details.
- */
- BufferGL(const BufferGL& buffer) : Buffer(buffer) { }
-
/*! \brief Constructor from cl_mem - takes ownership.
*
* See Memory for further details.
*/
__CL_EXPLICIT_CONSTRUCTORS BufferGL(const cl_mem& buffer) : Buffer(buffer) { }
- /*! \brief Assignment from BufferGL - performs shallow copy.
- *
- * See Memory for further details.
- */
- BufferGL& operator = (const BufferGL& rhs)
- {
- if (this != &rhs) {
- Buffer::operator=(rhs);
- }
- return *this;
- }
-
/*! \brief Assignment from cl_mem - performs shallow copy.
*
* See Memory for further details.
@@ -3322,93 +3504,40 @@ public:
return *this;
}
- //! \brief Wrapper for clGetGLObjectInfo().
- cl_int getObjectInfo(
- cl_gl_object_type *type,
- GLuint * gl_object_name)
+ /*! \brief Copy constructor to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ BufferGL(const BufferGL& buf) : Buffer(buf) {}
+
+ /*! \brief Copy assignment to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ BufferGL& operator = (const BufferGL &buf)
{
- return detail::errHandler(
- ::clGetGLObjectInfo(object_,type,gl_object_name),
- __GET_GL_OBJECT_INFO_ERR);
- }
-};
-
-/*! \brief Class interface for GL Render Buffer Memory Objects.
- *
- * This is provided to facilitate interoperability with OpenGL.
- *
- * See Memory for details about copy semantics, etc.
- *
- * \see Memory
- */
-class BufferRenderGL : public Buffer
-{
-public:
- /*! \brief Constructs a BufferRenderGL in a specified context, from a given
- * GL Renderbuffer.
- *
- * Wraps clCreateFromGLRenderbuffer().
- */
- BufferRenderGL(
- const Context& context,
- cl_mem_flags flags,
- GLuint bufobj,
- cl_int * err = NULL)
- {
- cl_int error;
- object_ = ::clCreateFromGLRenderbuffer(
- context(),
- flags,
- bufobj,
- &error);
-
- detail::errHandler(error, __CREATE_GL_RENDER_BUFFER_ERR);
- if (err != NULL) {
- *err = error;
- }
- }
-
- //! \brief Default constructor - initializes to NULL.
- BufferRenderGL() : Buffer() { }
-
- /*! \brief Copy constructor - performs shallow copy.
- *
- * See Memory for further details.
- */
- BufferRenderGL(const BufferGL& buffer) : Buffer(buffer) { }
-
- /*! \brief Constructor from cl_mem - takes ownership.
- *
- * See Memory for further details.
- */
- __CL_EXPLICIT_CONSTRUCTORS BufferRenderGL(const cl_mem& buffer) : Buffer(buffer) { }
-
- /*! \brief Assignment from BufferGL - performs shallow copy.
- *
- * See Memory for further details.
- */
- BufferRenderGL& operator = (const BufferRenderGL& rhs)
- {
- if (this != &rhs) {
- Buffer::operator=(rhs);
- }
+ Buffer::operator=(buf);
return *this;
}
- /*! \brief Assignment from cl_mem - performs shallow copy.
- *
- * See Memory for further details.
- */
- BufferRenderGL& operator = (const cl_mem& rhs)
+#if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
+ /*! \brief Move constructor to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ BufferGL(BufferGL&& buf) CL_HPP_NOEXCEPT : Buffer(std::move(buf)) {}
+
+ /*! \brief Move assignment to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ BufferGL& operator = (BufferGL &&buf)
{
- Buffer::operator=(rhs);
+ Buffer::operator=(std::move(buf));
return *this;
}
+#endif // #if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
//! \brief Wrapper for clGetGLObjectInfo().
cl_int getObjectInfo(
cl_gl_object_type *type,
- GLuint * gl_object_name)
+ cl_GLuint * gl_object_name)
{
return detail::errHandler(
::clGetGLObjectInfo(object_,type,gl_object_name),
@@ -3428,30 +3557,12 @@ protected:
//! \brief Default constructor - initializes to NULL.
Image() : Memory() { }
- /*! \brief Copy constructor - performs shallow copy.
- *
- * See Memory for further details.
- */
- Image(const Image& image) : Memory(image) { }
-
/*! \brief Constructor from cl_mem - takes ownership.
*
* See Memory for further details.
*/
__CL_EXPLICIT_CONSTRUCTORS Image(const cl_mem& image) : Memory(image) { }
- /*! \brief Assignment from Image - performs shallow copy.
- *
- * See Memory for further details.
- */
- Image& operator = (const Image& rhs)
- {
- if (this != &rhs) {
- Memory::operator=(rhs);
- }
- return *this;
- }
-
/*! \brief Assignment from cl_mem - performs shallow copy.
*
* See Memory for further details.
@@ -3462,6 +3573,36 @@ protected:
return *this;
}
+ /*! \brief Copy constructor to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image(const Image& img) : Memory(img) {}
+
+ /*! \brief Copy assignment to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image& operator = (const Image &img)
+ {
+ Memory::operator=(img);
+ return *this;
+ }
+
+#if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
+ /*! \brief Move constructor to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image(Image&& img) CL_HPP_NOEXCEPT : Memory(std::move(img)) {}
+
+ /*! \brief Move assignment to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image& operator = (Image &&img)
+ {
+ Memory::operator=(std::move(img));
+ return *this;
+ }
+#endif // #if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
+
public:
//! \brief Wrapper for clGetImageInfo().
template
@@ -3510,13 +3651,12 @@ public:
cl_int* err = NULL)
{
cl_int error;
- cl_image_desc desc;
- desc.image_type = CL_MEM_OBJECT_IMAGE1D;
- desc.image_width = width;
- desc.image_row_pitch = 0;
- desc.num_mip_levels = 0;
- desc.num_samples = 0;
- desc.buffer = 0;
+ cl_image_desc desc =
+ {
+ CL_MEM_OBJECT_IMAGE1D,
+ width,
+ 0, 0, 0, 0, 0, 0, 0, 0
+ };
object_ = ::clCreateImage(
context(),
flags,
@@ -3534,30 +3674,12 @@ public:
//! \brief Default constructor - initializes to NULL.
Image1D() { }
- /*! \brief Copy constructor - performs shallow copy.
- *
- * See Memory for further details.
- */
- Image1D(const Image1D& image1D) : Image(image1D) { }
-
/*! \brief Constructor from cl_mem - takes ownership.
*
* See Memory for further details.
*/
__CL_EXPLICIT_CONSTRUCTORS Image1D(const cl_mem& image1D) : Image(image1D) { }
- /*! \brief Assignment from Image1D - performs shallow copy.
- *
- * See Memory for further details.
- */
- Image1D& operator = (const Image1D& rhs)
- {
- if (this != &rhs) {
- Image::operator=(rhs);
- }
- return *this;
- }
-
/*! \brief Assignment from cl_mem - performs shallow copy.
*
* See Memory for further details.
@@ -3567,6 +3689,36 @@ public:
Image::operator=(rhs);
return *this;
}
+
+ /*! \brief Copy constructor to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image1D(const Image1D& img) : Image(img) {}
+
+ /*! \brief Copy assignment to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image1D& operator = (const Image1D &img)
+ {
+ Image::operator=(img);
+ return *this;
+ }
+
+#if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
+ /*! \brief Move constructor to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image1D(Image1D&& img) CL_HPP_NOEXCEPT : Image(std::move(img)) {}
+
+ /*! \brief Move assignment to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image1D& operator = (Image1D &&img)
+ {
+ Image::operator=(std::move(img));
+ return *this;
+ }
+#endif // #if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
};
/*! \class Image1DBuffer
@@ -3584,13 +3736,13 @@ public:
cl_int* err = NULL)
{
cl_int error;
- cl_image_desc desc;
- desc.image_type = CL_MEM_OBJECT_IMAGE1D_BUFFER;
- desc.image_width = width;
- desc.image_row_pitch = 0;
- desc.num_mip_levels = 0;
- desc.num_samples = 0;
- desc.buffer = buffer();
+ cl_image_desc desc =
+ {
+ CL_MEM_OBJECT_IMAGE1D_BUFFER,
+ width,
+ 0, 0, 0, 0, 0, 0, 0,
+ buffer()
+ };
object_ = ::clCreateImage(
context(),
flags,
@@ -3607,23 +3759,43 @@ public:
Image1DBuffer() { }
- Image1DBuffer(const Image1DBuffer& image1D) : Image(image1D) { }
-
__CL_EXPLICIT_CONSTRUCTORS Image1DBuffer(const cl_mem& image1D) : Image(image1D) { }
- Image1DBuffer& operator = (const Image1DBuffer& rhs)
- {
- if (this != &rhs) {
- Image::operator=(rhs);
- }
- return *this;
- }
-
Image1DBuffer& operator = (const cl_mem& rhs)
{
Image::operator=(rhs);
return *this;
}
+
+ /*! \brief Copy constructor to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image1DBuffer(const Image1DBuffer& img) : Image(img) {}
+
+ /*! \brief Copy assignment to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image1DBuffer& operator = (const Image1DBuffer &img)
+ {
+ Image::operator=(img);
+ return *this;
+ }
+
+#if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
+ /*! \brief Move constructor to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image1DBuffer(Image1DBuffer&& img) CL_HPP_NOEXCEPT : Image(std::move(img)) {}
+
+ /*! \brief Move assignment to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image1DBuffer& operator = (Image1DBuffer &&img)
+ {
+ Image::operator=(std::move(img));
+ return *this;
+ }
+#endif // #if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
};
/*! \class Image1DArray
@@ -3643,14 +3815,15 @@ public:
cl_int* err = NULL)
{
cl_int error;
- cl_image_desc desc;
- desc.image_type = CL_MEM_OBJECT_IMAGE1D_ARRAY;
- desc.image_array_size = arraySize;
- desc.image_width = width;
- desc.image_row_pitch = rowPitch;
- desc.num_mip_levels = 0;
- desc.num_samples = 0;
- desc.buffer = 0;
+ cl_image_desc desc =
+ {
+ CL_MEM_OBJECT_IMAGE1D_ARRAY,
+ width,
+ 0, 0, // height, depth (unused)
+ arraySize,
+ rowPitch,
+ 0, 0, 0, 0
+ };
object_ = ::clCreateImage(
context(),
flags,
@@ -3667,23 +3840,43 @@ public:
Image1DArray() { }
- Image1DArray(const Image1DArray& imageArray) : Image(imageArray) { }
-
__CL_EXPLICIT_CONSTRUCTORS Image1DArray(const cl_mem& imageArray) : Image(imageArray) { }
- Image1DArray& operator = (const Image1DArray& rhs)
- {
- if (this != &rhs) {
- Image::operator=(rhs);
- }
- return *this;
- }
-
Image1DArray& operator = (const cl_mem& rhs)
{
Image::operator=(rhs);
return *this;
}
+
+ /*! \brief Copy constructor to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image1DArray(const Image1DArray& img) : Image(img) {}
+
+ /*! \brief Copy assignment to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image1DArray& operator = (const Image1DArray &img)
+ {
+ Image::operator=(img);
+ return *this;
+ }
+
+#if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
+ /*! \brief Move constructor to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image1DArray(Image1DArray&& img) CL_HPP_NOEXCEPT : Image(std::move(img)) {}
+
+ /*! \brief Move assignment to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image1DArray& operator = (Image1DArray &&img)
+ {
+ Image::operator=(std::move(img));
+ return *this;
+ }
+#endif // #if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
};
#endif // #if defined(CL_VERSION_1_2)
@@ -3729,14 +3922,15 @@ public:
#if defined(CL_VERSION_1_2)
if (useCreateImage)
{
- cl_image_desc desc;
- desc.image_type = CL_MEM_OBJECT_IMAGE2D;
- desc.image_width = width;
- desc.image_height = height;
- desc.image_row_pitch = row_pitch;
- desc.num_mip_levels = 0;
- desc.num_samples = 0;
- desc.buffer = 0;
+ cl_image_desc desc =
+ {
+ CL_MEM_OBJECT_IMAGE2D,
+ width,
+ height,
+ 0, 0, // depth, array size (unused)
+ row_pitch,
+ 0, 0, 0, 0
+ };
object_ = ::clCreateImage(
context(),
flags,
@@ -3768,30 +3962,12 @@ public:
//! \brief Default constructor - initializes to NULL.
Image2D() { }
- /*! \brief Copy constructor - performs shallow copy.
- *
- * See Memory for further details.
- */
- Image2D(const Image2D& image2D) : Image(image2D) { }
-
/*! \brief Constructor from cl_mem - takes ownership.
*
* See Memory for further details.
*/
__CL_EXPLICIT_CONSTRUCTORS Image2D(const cl_mem& image2D) : Image(image2D) { }
- /*! \brief Assignment from Image2D - performs shallow copy.
- *
- * See Memory for further details.
- */
- Image2D& operator = (const Image2D& rhs)
- {
- if (this != &rhs) {
- Image::operator=(rhs);
- }
- return *this;
- }
-
/*! \brief Assignment from cl_mem - performs shallow copy.
*
* See Memory for further details.
@@ -3801,6 +3977,36 @@ public:
Image::operator=(rhs);
return *this;
}
+
+ /*! \brief Copy constructor to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image2D(const Image2D& img) : Image(img) {}
+
+ /*! \brief Copy assignment to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image2D& operator = (const Image2D &img)
+ {
+ Image::operator=(img);
+ return *this;
+ }
+
+#if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
+ /*! \brief Move constructor to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image2D(Image2D&& img) CL_HPP_NOEXCEPT : Image(std::move(img)) {}
+
+ /*! \brief Move assignment to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image2D& operator = (Image2D &&img)
+ {
+ Image::operator=(std::move(img));
+ return *this;
+ }
+#endif // #if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
};
@@ -3825,9 +4031,9 @@ public:
Image2DGL(
const Context& context,
cl_mem_flags flags,
- GLenum target,
- GLint miplevel,
- GLuint texobj,
+ cl_GLenum target,
+ cl_GLint miplevel,
+ cl_GLuint texobj,
cl_int * err = NULL)
{
cl_int error;
@@ -3849,30 +4055,12 @@ public:
//! \brief Default constructor - initializes to NULL.
Image2DGL() : Image2D() { }
- /*! \brief Copy constructor - performs shallow copy.
- *
- * See Memory for further details.
- */
- Image2DGL(const Image2DGL& image) : Image2D(image) { }
-
/*! \brief Constructor from cl_mem - takes ownership.
*
* See Memory for further details.
*/
__CL_EXPLICIT_CONSTRUCTORS Image2DGL(const cl_mem& image) : Image2D(image) { }
- /*! \brief Assignment from Image2DGL - performs shallow copy.
- *
- * See Memory for further details.
- */
- Image2DGL& operator = (const Image2DGL& rhs)
- {
- if (this != &rhs) {
- Image2D::operator=(rhs);
- }
- return *this;
- }
-
/*! \brief Assignment from cl_mem - performs shallow copy.
*
* See Memory for further details.
@@ -3882,6 +4070,36 @@ public:
Image2D::operator=(rhs);
return *this;
}
+
+ /*! \brief Copy constructor to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image2DGL(const Image2DGL& img) : Image2D(img) {}
+
+ /*! \brief Copy assignment to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image2DGL& operator = (const Image2DGL &img)
+ {
+ Image2D::operator=(img);
+ return *this;
+ }
+
+#if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
+ /*! \brief Move constructor to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image2DGL(Image2DGL&& img) CL_HPP_NOEXCEPT : Image2D(std::move(img)) {}
+
+ /*! \brief Move assignment to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image2DGL& operator = (Image2DGL &&img)
+ {
+ Image2D::operator=(std::move(img));
+ return *this;
+ }
+#endif // #if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
};
#endif // #if !defined(CL_VERSION_1_2)
@@ -3905,16 +4123,17 @@ public:
cl_int* err = NULL)
{
cl_int error;
- cl_image_desc desc;
- desc.image_type = CL_MEM_OBJECT_IMAGE2D_ARRAY;
- desc.image_array_size = arraySize;
- desc.image_width = width;
- desc.image_height = height;
- desc.image_row_pitch = rowPitch;
- desc.image_slice_pitch = slicePitch;
- desc.num_mip_levels = 0;
- desc.num_samples = 0;
- desc.buffer = 0;
+ cl_image_desc desc =
+ {
+ CL_MEM_OBJECT_IMAGE2D_ARRAY,
+ width,
+ height,
+ 0, // depth (unused)
+ arraySize,
+ rowPitch,
+ slicePitch,
+ 0, 0, 0
+ };
object_ = ::clCreateImage(
context(),
flags,
@@ -3931,23 +4150,43 @@ public:
Image2DArray() { }
- Image2DArray(const Image2DArray& imageArray) : Image(imageArray) { }
-
__CL_EXPLICIT_CONSTRUCTORS Image2DArray(const cl_mem& imageArray) : Image(imageArray) { }
- Image2DArray& operator = (const Image2DArray& rhs)
- {
- if (this != &rhs) {
- Image::operator=(rhs);
- }
- return *this;
- }
-
Image2DArray& operator = (const cl_mem& rhs)
{
Image::operator=(rhs);
return *this;
}
+
+ /*! \brief Copy constructor to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image2DArray(const Image2DArray& img) : Image(img) {}
+
+ /*! \brief Copy assignment to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image2DArray& operator = (const Image2DArray &img)
+ {
+ Image::operator=(img);
+ return *this;
+ }
+
+#if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
+ /*! \brief Move constructor to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image2DArray(Image2DArray&& img) CL_HPP_NOEXCEPT : Image(std::move(img)) {}
+
+ /*! \brief Move assignment to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image2DArray& operator = (Image2DArray &&img)
+ {
+ Image::operator=(std::move(img));
+ return *this;
+ }
+#endif // #if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
};
#endif // #if defined(CL_VERSION_1_2)
@@ -3994,16 +4233,17 @@ public:
#if defined(CL_VERSION_1_2)
if (useCreateImage)
{
- cl_image_desc desc;
- desc.image_type = CL_MEM_OBJECT_IMAGE3D;
- desc.image_width = width;
- desc.image_height = height;
- desc.image_depth = depth;
- desc.image_row_pitch = row_pitch;
- desc.image_slice_pitch = slice_pitch;
- desc.num_mip_levels = 0;
- desc.num_samples = 0;
- desc.buffer = 0;
+ cl_image_desc desc =
+ {
+ CL_MEM_OBJECT_IMAGE3D,
+ width,
+ height,
+ depth,
+ 0, // array size (unused)
+ row_pitch,
+ slice_pitch,
+ 0, 0, 0
+ };
object_ = ::clCreateImage(
context(),
flags,
@@ -4034,13 +4274,7 @@ public:
}
//! \brief Default constructor - initializes to NULL.
- Image3D() { }
-
- /*! \brief Copy constructor - performs shallow copy.
- *
- * See Memory for further details.
- */
- Image3D(const Image3D& image3D) : Image(image3D) { }
+ Image3D() : Image() { }
/*! \brief Constructor from cl_mem - takes ownership.
*
@@ -4048,18 +4282,6 @@ public:
*/
__CL_EXPLICIT_CONSTRUCTORS Image3D(const cl_mem& image3D) : Image(image3D) { }
- /*! \brief Assignment from Image3D - performs shallow copy.
- *
- * See Memory for further details.
- */
- Image3D& operator = (const Image3D& rhs)
- {
- if (this != &rhs) {
- Image::operator=(rhs);
- }
- return *this;
- }
-
/*! \brief Assignment from cl_mem - performs shallow copy.
*
* See Memory for further details.
@@ -4069,6 +4291,36 @@ public:
Image::operator=(rhs);
return *this;
}
+
+ /*! \brief Copy constructor to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image3D(const Image3D& img) : Image(img) {}
+
+ /*! \brief Copy assignment to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image3D& operator = (const Image3D &img)
+ {
+ Image::operator=(img);
+ return *this;
+ }
+
+#if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
+ /*! \brief Move constructor to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image3D(Image3D&& img) CL_HPP_NOEXCEPT : Image(std::move(img)) {}
+
+ /*! \brief Move assignment to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image3D& operator = (Image3D &&img)
+ {
+ Image::operator=(std::move(img));
+ return *this;
+ }
+#endif // #if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
};
#if !defined(CL_VERSION_1_2)
@@ -4091,9 +4343,9 @@ public:
Image3DGL(
const Context& context,
cl_mem_flags flags,
- GLenum target,
- GLint miplevel,
- GLuint texobj,
+ cl_GLenum target,
+ cl_GLint miplevel,
+ cl_GLuint texobj,
cl_int * err = NULL)
{
cl_int error;
@@ -4114,30 +4366,12 @@ public:
//! \brief Default constructor - initializes to NULL.
Image3DGL() : Image3D() { }
- /*! \brief Copy constructor - performs shallow copy.
- *
- * See Memory for further details.
- */
- Image3DGL(const Image3DGL& image) : Image3D(image) { }
-
/*! \brief Constructor from cl_mem - takes ownership.
*
* See Memory for further details.
*/
__CL_EXPLICIT_CONSTRUCTORS Image3DGL(const cl_mem& image) : Image3D(image) { }
- /*! \brief Assignment from Image3DGL - performs shallow copy.
- *
- * See Memory for further details.
- */
- Image3DGL& operator = (const Image3DGL& rhs)
- {
- if (this != &rhs) {
- Image3D::operator=(rhs);
- }
- return *this;
- }
-
/*! \brief Assignment from cl_mem - performs shallow copy.
*
* See Memory for further details.
@@ -4147,6 +4381,36 @@ public:
Image3D::operator=(rhs);
return *this;
}
+
+ /*! \brief Copy constructor to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image3DGL(const Image3DGL& img) : Image3D(img) {}
+
+ /*! \brief Copy assignment to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image3DGL& operator = (const Image3DGL &img)
+ {
+ Image3D::operator=(img);
+ return *this;
+ }
+
+#if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
+ /*! \brief Move constructor to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image3DGL(Image3DGL&& img) CL_HPP_NOEXCEPT : Image3D(std::move(img)) {}
+
+ /*! \brief Move assignment to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ Image3DGL& operator = (Image3DGL &&img)
+ {
+ Image3D::operator=(std::move(img));
+ return *this;
+ }
+#endif // #if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
};
#endif // #if !defined(CL_VERSION_1_2)
@@ -4163,9 +4427,9 @@ public:
ImageGL(
const Context& context,
cl_mem_flags flags,
- GLenum target,
- GLint miplevel,
- GLuint texobj,
+ cl_GLenum target,
+ cl_GLint miplevel,
+ cl_GLuint texobj,
cl_int * err = NULL)
{
cl_int error;
@@ -4185,26 +4449,178 @@ public:
ImageGL() : Image() { }
- ImageGL(const ImageGL& image) : Image(image) { }
-
__CL_EXPLICIT_CONSTRUCTORS ImageGL(const cl_mem& image) : Image(image) { }
- ImageGL& operator = (const ImageGL& rhs)
- {
- if (this != &rhs) {
- Image::operator=(rhs);
- }
- return *this;
- }
-
ImageGL& operator = (const cl_mem& rhs)
{
Image::operator=(rhs);
return *this;
}
+
+ /*! \brief Copy constructor to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ ImageGL(const ImageGL& img) : Image(img) {}
+
+ /*! \brief Copy assignment to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ ImageGL& operator = (const ImageGL &img)
+ {
+ Image::operator=(img);
+ return *this;
+ }
+
+#if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
+ /*! \brief Move constructor to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ ImageGL(ImageGL&& img) CL_HPP_NOEXCEPT : Image(std::move(img)) {}
+
+ /*! \brief Move assignment to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ ImageGL& operator = (ImageGL &&img)
+ {
+ Image::operator=(std::move(img));
+ return *this;
+ }
+#endif // #if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
};
#endif // #if defined(CL_VERSION_1_2)
+/*! \brief Class interface for GL Render Buffer Memory Objects.
+*
+* This is provided to facilitate interoperability with OpenGL.
+*
+* See Memory for details about copy semantics, etc.
+*
+* \see Memory
+*/
+class BufferRenderGL :
+#if defined(CL_VERSION_1_2)
+ public ImageGL
+#else // #if defined(CL_VERSION_1_2)
+ public Image2DGL
+#endif //#if defined(CL_VERSION_1_2)
+{
+public:
+ /*! \brief Constructs a BufferRenderGL in a specified context, from a given
+ * GL Renderbuffer.
+ *
+ * Wraps clCreateFromGLRenderbuffer().
+ */
+ BufferRenderGL(
+ const Context& context,
+ cl_mem_flags flags,
+ cl_GLuint bufobj,
+ cl_int * err = NULL)
+ {
+ cl_int error;
+ object_ = ::clCreateFromGLRenderbuffer(
+ context(),
+ flags,
+ bufobj,
+ &error);
+
+ detail::errHandler(error, __CREATE_GL_RENDER_BUFFER_ERR);
+ if (err != NULL) {
+ *err = error;
+ }
+ }
+
+ //! \brief Default constructor - initializes to NULL.
+#if defined(CL_VERSION_1_2)
+ BufferRenderGL() : ImageGL() {};
+#else // #if defined(CL_VERSION_1_2)
+ BufferRenderGL() : Image2DGL() {};
+#endif //#if defined(CL_VERSION_1_2)
+
+ /*! \brief Constructor from cl_mem - takes ownership.
+ *
+ * See Memory for further details.
+ */
+#if defined(CL_VERSION_1_2)
+ __CL_EXPLICIT_CONSTRUCTORS BufferRenderGL(const cl_mem& buffer) : ImageGL(buffer) { }
+#else // #if defined(CL_VERSION_1_2)
+ __CL_EXPLICIT_CONSTRUCTORS BufferRenderGL(const cl_mem& buffer) : Image2DGL(buffer) { }
+#endif //#if defined(CL_VERSION_1_2)
+
+
+ /*! \brief Assignment from cl_mem - performs shallow copy.
+ *
+ * See Memory for further details.
+ */
+ BufferRenderGL& operator = (const cl_mem& rhs)
+ {
+#if defined(CL_VERSION_1_2)
+ ImageGL::operator=(rhs);
+#else // #if defined(CL_VERSION_1_2)
+ Image2DGL::operator=(rhs);
+#endif //#if defined(CL_VERSION_1_2)
+
+ return *this;
+ }
+
+ /*! \brief Copy constructor to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+#if defined(CL_VERSION_1_2)
+ BufferRenderGL(const BufferRenderGL& buf) : ImageGL(buf) {}
+#else // #if defined(CL_VERSION_1_2)
+ BufferRenderGL(const BufferRenderGL& buf) : Image2DGL(buf) {}
+#endif //#if defined(CL_VERSION_1_2)
+
+ /*! \brief Copy assignment to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ BufferRenderGL& operator = (const BufferRenderGL &rhs)
+ {
+#if defined(CL_VERSION_1_2)
+ ImageGL::operator=(rhs);
+#else // #if defined(CL_VERSION_1_2)
+ Image2DGL::operator=(rhs);
+#endif //#if defined(CL_VERSION_1_2)
+ return *this;
+ }
+
+#if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
+ /*! \brief Move constructor to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+#if defined(CL_VERSION_1_2)
+ BufferRenderGL(BufferRenderGL&& buf) CL_HPP_NOEXCEPT : ImageGL(std::move(buf)) {}
+#else // #if defined(CL_VERSION_1_2)
+ BufferRenderGL(BufferRenderGL&& buf) CL_HPP_NOEXCEPT : Image2DGL(std::move(buf)) {}
+#endif //#if defined(CL_VERSION_1_2)
+
+
+ /*! \brief Move assignment to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ BufferRenderGL& operator = (BufferRenderGL &&buf)
+ {
+#if defined(CL_VERSION_1_2)
+ ImageGL::operator=(std::move(buf));
+#else // #if defined(CL_VERSION_1_2)
+ Image2DGL::operator=(std::move(buf));
+#endif //#if defined(CL_VERSION_1_2)
+
+ return *this;
+ }
+#endif // #if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
+
+ //! \brief Wrapper for clGetGLObjectInfo().
+ cl_int getObjectInfo(
+ cl_gl_object_type *type,
+ cl_GLuint * gl_object_name)
+ {
+ return detail::errHandler(
+ ::clGetGLObjectInfo(object_, type, gl_object_name),
+ __GET_GL_OBJECT_INFO_ERR);
+ }
+};
+
/*! \brief Class interface for cl_sampler.
*
* \note Copies of these objects are shallow, meaning that the copy will refer
@@ -4216,12 +4632,6 @@ public:
class Sampler : public detail::Wrapper
{
public:
- /*! \brief Destructor.
- *
- * This calls clReleaseSampler() on the value held by this instance.
- */
- ~Sampler() { }
-
//! \brief Default constructor - initializes to NULL.
Sampler() { }
@@ -4250,31 +4660,12 @@ public:
}
}
- /*! \brief Copy constructor - performs shallow copy.
- *
- * This calls clRetainSampler() on the parameter's cl_sampler.
- */
- Sampler(const Sampler& sampler) : detail::Wrapper(sampler) { }
-
/*! \brief Constructor from cl_sampler - takes ownership.
*
* This effectively transfers ownership of a refcount on the cl_sampler
* into the new Sampler object.
*/
- Sampler(const cl_sampler& sampler) : detail::Wrapper(sampler) { }
-
- /*! \brief Assignment operator from Sampler.
- *
- * This calls clRetainSampler() on the parameter and clReleaseSampler()
- * on the previous value held by this instance.
- */
- Sampler& operator = (const Sampler& rhs)
- {
- if (this != &rhs) {
- detail::Wrapper::operator=(rhs);
- }
- return *this;
- }
+ __CL_EXPLICIT_CONSTRUCTORS Sampler(const cl_sampler& sampler) : detail::Wrapper(sampler) { }
/*! \brief Assignment operator from cl_sampler - takes ownership.
*
@@ -4287,6 +4678,36 @@ public:
return *this;
}
+ /*! \brief Copy constructor to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ Sampler(const Sampler& sam) : detail::Wrapper(sam) {}
+
+ /*! \brief Copy assignment to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ Sampler& operator = (const Sampler &sam)
+ {
+ detail::Wrapper::operator=(sam);
+ return *this;
+ }
+
+#if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
+ /*! \brief Move constructor to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ Sampler(Sampler&& sam) CL_HPP_NOEXCEPT : detail::Wrapper(std::move(sam)) {}
+
+ /*! \brief Move assignment to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ Sampler& operator = (Sampler &&sam)
+ {
+ detail::Wrapper::operator=(std::move(sam));
+ return *this;
+ }
+#endif // #if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
+
//! \brief Wrapper for clGetSamplerInfo().
template
cl_int getInfo(cl_sampler_info name, T* param) const
@@ -4379,14 +4800,14 @@ template
struct KernelArgumentHandler
{
static ::size_t size(const T&) { return sizeof(T); }
- static T* ptr(T& value) { return &value; }
+ static const T* ptr(const T& value) { return &value; }
};
template <>
struct KernelArgumentHandler
{
static ::size_t size(const LocalSpaceArg& value) { return value.size_; }
- static void* ptr(LocalSpaceArg&) { return NULL; }
+ static const void* ptr(const LocalSpaceArg&) { return NULL; }
};
}
@@ -4430,21 +4851,9 @@ class Kernel : public detail::Wrapper
public:
inline Kernel(const Program& program, const char* name, cl_int* err = NULL);
- /*! \brief Destructor.
- *
- * This calls clReleaseKernel() on the value held by this instance.
- */
- ~Kernel() { }
-
//! \brief Default constructor - initializes to NULL.
Kernel() { }
- /*! \brief Copy constructor - performs shallow copy.
- *
- * This calls clRetainKernel() on the parameter's cl_kernel.
- */
- Kernel(const Kernel& kernel) : detail::Wrapper(kernel) { }
-
/*! \brief Constructor from cl_kernel - takes ownership.
*
* This effectively transfers ownership of a refcount on the cl_kernel
@@ -4452,19 +4861,6 @@ public:
*/
__CL_EXPLICIT_CONSTRUCTORS Kernel(const cl_kernel& kernel) : detail::Wrapper(kernel) { }
- /*! \brief Assignment operator from Kernel.
- *
- * This calls clRetainKernel() on the parameter and clReleaseKernel()
- * on the previous value held by this instance.
- */
- Kernel& operator = (const Kernel& rhs)
- {
- if (this != &rhs) {
- detail::Wrapper::operator=(rhs);
- }
- return *this;
- }
-
/*! \brief Assignment operator from cl_kernel - takes ownership.
*
* This effectively transfers ownership of a refcount on the rhs and calls
@@ -4476,6 +4872,36 @@ public:
return *this;
}
+ /*! \brief Copy constructor to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ Kernel(const Kernel& kernel) : detail::Wrapper(kernel) {}
+
+ /*! \brief Copy assignment to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ Kernel& operator = (const Kernel &kernel)
+ {
+ detail::Wrapper::operator=(kernel);
+ return *this;
+ }
+
+#if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
+ /*! \brief Move constructor to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ Kernel(Kernel&& kernel) CL_HPP_NOEXCEPT : detail::Wrapper(std::move(kernel)) {}
+
+ /*! \brief Move assignment to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ Kernel& operator = (Kernel &&kernel)
+ {
+ detail::Wrapper::operator=(std::move(kernel));
+ return *this;
+ }
+#endif // #if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
+
template
cl_int getInfo(cl_kernel_info name, T* param) const
{
@@ -4544,7 +4970,7 @@ public:
}
template
- cl_int setArg(cl_uint index, T value)
+ cl_int setArg(cl_uint index, const T &value)
{
return detail::errHandler(
::clSetKernelArg(
@@ -4555,7 +4981,7 @@ public:
__SET_KERNEL_ARGS_ERR);
}
- cl_int setArg(cl_uint index, ::size_t size, void* argPtr)
+ cl_int setArg(cl_uint index, ::size_t size, const void* argPtr)
{
return detail::errHandler(
::clSetKernelArg(object_, index, size, argPtr),
@@ -4574,41 +5000,7 @@ public:
Program(
const STRING_CLASS& source,
- cl_int* err = NULL)
- {
- cl_int error;
-
- const char * strings = source.c_str();
- const ::size_t length = source.size();
-
- Context context = Context::getDefault(err);
-
- object_ = ::clCreateProgramWithSource(
- context(), (cl_uint)1, &strings, &length, &error);
-
- detail::errHandler(error, __CREATE_PROGRAM_WITH_SOURCE_ERR);
-
- if (error == CL_SUCCESS) {
-
- error = ::clBuildProgram(
- object_,
- 0,
- NULL,
- "",
- NULL,
- NULL);
-
- detail::errHandler(error, __BUILD_PROGRAM_ERR);
- }
-
- if (err != NULL) {
- *err = error;
- }
- }
-
- Program(
- const STRING_CLASS& source,
- bool build,
+ bool build = false,
cl_int* err = NULL)
{
cl_int error;
@@ -4760,7 +5152,7 @@ public:
object_ = ::clCreateProgramWithBinary(
context(), (cl_uint) devices.size(),
deviceIDs,
- lengths, images, binaryStatus != NULL
+ lengths, images, (binaryStatus != NULL && numDevices > 0)
? &binaryStatus->front()
: NULL, &error);
@@ -4807,24 +5199,44 @@ public:
Program() { }
- Program(const Program& program) : detail::Wrapper(program) { }
-
__CL_EXPLICIT_CONSTRUCTORS Program(const cl_program& program) : detail::Wrapper(program) { }
- Program& operator = (const Program& rhs)
- {
- if (this != &rhs) {
- detail::Wrapper::operator=(rhs);
- }
- return *this;
- }
-
Program& operator = (const cl_program& rhs)
{
detail::Wrapper::operator=(rhs);
return *this;
}
+ /*! \brief Copy constructor to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ Program(const Program& program) : detail::Wrapper(program) {}
+
+ /*! \brief Copy assignment to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ Program& operator = (const Program &program)
+ {
+ detail::Wrapper::operator=(program);
+ return *this;
+ }
+
+#if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
+ /*! \brief Move constructor to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ Program(Program&& program) CL_HPP_NOEXCEPT : detail::Wrapper(std::move(program)) {}
+
+ /*! \brief Move assignment to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ Program& operator = (Program &&program)
+ {
+ detail::Wrapper::operator=(std::move(program));
+ return *this;
+ }
+#endif // #if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
+
cl_int build(
const VECTOR_CLASS& devices,
const char* options = NULL,
@@ -4866,7 +5278,7 @@ public:
}
#if defined(CL_VERSION_1_2)
- cl_int compile(
+ cl_int compile(
const char* options = NULL,
void (CL_CALLBACK * notifyFptr)(cl_program, void *) = NULL,
void* data = NULL) const
@@ -4877,9 +5289,9 @@ public:
0,
NULL,
options,
- 0,
- NULL,
- NULL,
+ 0,
+ NULL,
+ NULL,
notifyFptr,
data),
__COMPILE_PROGRAM_ERR);
@@ -4959,11 +5371,14 @@ inline Program linkProgram(
void* data = NULL,
cl_int* err = NULL)
{
- cl_int err_local = CL_SUCCESS;
+ cl_int error_local = CL_SUCCESS;
cl_program programs[2] = { input1(), input2() };
- Context ctx = input1.getInfo();
+ Context ctx = input1.getInfo(&error_local);
+ if(error_local!=CL_SUCCESS) {
+ detail::errHandler(error_local, __LINK_PROGRAM_ERR);
+ }
cl_program prog = ::clLinkProgram(
ctx(),
@@ -4974,11 +5389,11 @@ inline Program linkProgram(
programs,
notifyFptr,
data,
- &err_local);
+ &error_local);
- detail::errHandler(err_local,__COMPILE_PROGRAM_ERR);
+ detail::errHandler(error_local,__COMPILE_PROGRAM_ERR);
if (err != NULL) {
- *err = err_local;
+ *err = error_local;
}
return Program(prog);
@@ -4991,7 +5406,7 @@ inline Program linkProgram(
void* data = NULL,
cl_int* err = NULL)
{
- cl_int err_local = CL_SUCCESS;
+ cl_int error_local = CL_SUCCESS;
cl_program * programs = (cl_program*) alloca(inputPrograms.size() * sizeof(cl_program));
@@ -5001,8 +5416,15 @@ inline Program linkProgram(
}
}
+ Context ctx;
+ if(inputPrograms.size() > 0) {
+ ctx = inputPrograms[0].getInfo(&error_local);
+ if(error_local!=CL_SUCCESS) {
+ detail::errHandler(error_local, __LINK_PROGRAM_ERR);
+ }
+ }
cl_program prog = ::clLinkProgram(
- Context::getDefault()(),
+ ctx(),
0,
NULL,
options,
@@ -5010,11 +5432,11 @@ inline Program linkProgram(
programs,
notifyFptr,
data,
- &err_local);
+ &error_local);
- detail::errHandler(err_local,__COMPILE_PROGRAM_ERR);
+ detail::errHandler(error_local,__COMPILE_PROGRAM_ERR);
if (err != NULL) {
- *err = err_local;
+ *err = error_local;
}
return Program(prog);
@@ -5060,7 +5482,11 @@ inline Kernel::Kernel(const Program& program, const char* name, cl_int* err)
class CommandQueue : public detail::Wrapper
{
private:
+#ifdef CL_HPP_CPP11_ATOMICS_SUPPORTED
+ static std::atomic default_initialized_;
+#else // !CL_HPP_CPP11_ATOMICS_SUPPORTED
static volatile int default_initialized_;
+#endif // !CL_HPP_CPP11_ATOMICS_SUPPORTED
static CommandQueue default_;
static volatile cl_int default_error_;
public:
@@ -5071,7 +5497,7 @@ public:
cl_int error;
Context context = Context::getDefault(&error);
- detail::errHandler(error, __CREATE_COMMAND_QUEUE_ERR);
+ detail::errHandler(error, __CREATE_CONTEXT_ERR);
if (error != CL_SUCCESS) {
if (err != NULL) {
@@ -5090,6 +5516,37 @@ public:
}
}
}
+ /*!
+ * \brief Constructs a CommandQueue for an implementation defined device in the given context
+ */
+ explicit CommandQueue(
+ const Context& context,
+ cl_command_queue_properties properties = 0,
+ cl_int* err = NULL)
+ {
+ cl_int error;
+ VECTOR_CLASS devices;
+ error = context.getInfo(CL_CONTEXT_DEVICES, &devices);
+
+ detail::errHandler(error, __CREATE_CONTEXT_ERR);
+
+ if (error != CL_SUCCESS)
+ {
+ if (err != NULL) {
+ *err = error;
+ }
+ return;
+ }
+
+ object_ = ::clCreateCommandQueue(context(), devices[0](), properties, &error);
+
+ detail::errHandler(error, __CREATE_COMMAND_QUEUE_ERR);
+
+ if (err != NULL) {
+ *err = error;
+ }
+
+ }
CommandQueue(
const Context& context,
@@ -5107,6 +5564,36 @@ public:
}
}
+ /*! \brief Copy constructor to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ CommandQueue(const CommandQueue& queue) : detail::Wrapper(queue) {}
+
+ /*! \brief Copy assignment to forward copy to the superclass correctly.
+ * Required for MSVC.
+ */
+ CommandQueue& operator = (const CommandQueue &queue)
+ {
+ detail::Wrapper::operator=(queue);
+ return *this;
+ }
+
+#if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
+ /*! \brief Move constructor to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ CommandQueue(CommandQueue&& queue) CL_HPP_NOEXCEPT : detail::Wrapper(std::move(queue)) {}
+
+ /*! \brief Move assignment to forward move to the superclass correctly.
+ * Required for MSVC.
+ */
+ CommandQueue& operator = (CommandQueue &&queue)
+ {
+ detail::Wrapper::operator=(std::move(queue));
+ return *this;
+ }
+#endif // #if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
+
static CommandQueue getDefault(cl_int * err = NULL)
{
int state = detail::compare_exchange(
@@ -5170,17 +5657,7 @@ public:
CommandQueue() { }
- CommandQueue(const CommandQueue& commandQueue) : detail::Wrapper(commandQueue) { }
-
- CommandQueue(const cl_command_queue& commandQueue) : detail::Wrapper(commandQueue) { }
-
- CommandQueue& operator = (const CommandQueue& rhs)
- {
- if (this != &rhs) {
- detail::Wrapper::operator=(rhs);
- }
- return *this;
- }
+ __CL_EXPLICIT_CONSTRUCTORS CommandQueue(const cl_command_queue& commandQueue) : detail::Wrapper(commandQueue) { }
CommandQueue& operator = (const cl_command_queue& rhs)
{
@@ -5333,7 +5810,7 @@ public:
::size_t buffer_slice_pitch,
::size_t host_row_pitch,
::size_t host_slice_pitch,
- void *ptr,
+ const void *ptr,
const VECTOR_CLASS* events = NULL,
Event* event = NULL) const
{
@@ -5470,7 +5947,7 @@ public:
const size_t<3>& region,
::size_t row_pitch,
::size_t slice_pitch,
- void* ptr,
+ const void* ptr,
const VECTOR_CLASS* events = NULL,
Event* event = NULL) const
{
@@ -5679,18 +6156,22 @@ public:
Event* event = NULL,
cl_int* err = NULL) const
{
+ cl_event tmp;
cl_int error;
void * result = ::clEnqueueMapBuffer(
object_, buffer(), blocking, flags, offset, size,
(events != NULL) ? (cl_uint) events->size() : 0,
(events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL,
- (cl_event*) event,
+ (event != NULL) ? &tmp : NULL,
&error);
detail::errHandler(error, __ENQUEUE_MAP_BUFFER_ERR);
if (err != NULL) {
*err = error;
}
+ if (event != NULL && error == CL_SUCCESS)
+ *event = tmp;
+
return result;
}
@@ -5706,6 +6187,7 @@ public:
Event* event = NULL,
cl_int* err = NULL) const
{
+ cl_event tmp;
cl_int error;
void * result = ::clEnqueueMapImage(
object_, buffer(), blocking, flags,
@@ -5713,13 +6195,15 @@ public:
row_pitch, slice_pitch,
(events != NULL) ? (cl_uint) events->size() : 0,
(events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL,
- (cl_event*) event,
+ (event != NULL) ? &tmp : NULL,
&error);
detail::errHandler(error, __ENQUEUE_MAP_IMAGE_ERR);
if (err != NULL) {
*err = error;
}
+ if (event != NULL && error == CL_SUCCESS)
+ *event = tmp;
return result;
}
@@ -5758,7 +6242,7 @@ public:
*/
cl_int enqueueMarkerWithWaitList(
const VECTOR_CLASS *events = 0,
- Event *event = 0)
+ Event *event = 0) const
{
cl_event tmp;
cl_int err = detail::errHandler(
@@ -5788,7 +6272,7 @@ public:
*/
cl_int enqueueBarrierWithWaitList(
const VECTOR_CLASS *events = 0,
- Event *event = 0)
+ Event *event = 0) const
{
cl_event tmp;
cl_int err = detail::errHandler(
@@ -5814,7 +6298,7 @@ public:
cl_mem_migration_flags flags,
const VECTOR_CLASS* events = NULL,
Event* event = NULL
- )
+ ) const
{
cl_event tmp;
@@ -5912,7 +6396,7 @@ public:
object_, userFptr, args.first, args.second,
(mem_objects != NULL) ? (cl_uint) mem_objects->size() : 0,
mems,
- (mem_locs != NULL) ? (const void **) &mem_locs->front() : NULL,
+ (mem_locs != NULL && mem_locs->size() > 0) ? (const void **) &mem_locs->front() : NULL,
(events != NULL) ? (cl_uint) events->size() : 0,
(events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL,
(event != NULL) ? &tmp : NULL),
@@ -5931,9 +6415,17 @@ public:
CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
cl_int enqueueMarker(Event* event = NULL) const CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED
{
- return detail::errHandler(
- ::clEnqueueMarker(object_, (cl_event*) event),
+ cl_event tmp;
+ cl_int err = detail::errHandler(
+ ::clEnqueueMarker(
+ object_,
+ (event != NULL) ? &tmp : NULL),
__ENQUEUE_MARKER_ERR);
+
+ if (event != NULL && err == CL_SUCCESS)
+ *event = tmp;
+
+ return err;
}
CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
@@ -5943,7 +6435,7 @@ public:
::clEnqueueWaitForEvents(
object_,
(cl_uint) events.size(),
- (const cl_event*) &events.front()),
+ events.size() > 0 ? (const cl_event*) &events.front() : NULL),
__ENQUEUE_WAIT_FOR_EVENTS_ERR);
}
#endif // #if defined(CL_VERSION_1_1)
@@ -5958,7 +6450,7 @@ public:
::clEnqueueAcquireGLObjects(
object_,
(mem_objects != NULL) ? (cl_uint) mem_objects->size() : 0,
- (mem_objects != NULL) ? (const cl_mem *) &mem_objects->front(): NULL,
+ (mem_objects != NULL && mem_objects->size() > 0) ? (const cl_mem *) &mem_objects->front(): NULL,
(events != NULL) ? (cl_uint) events->size() : 0,
(events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL,
(event != NULL) ? &tmp : NULL),
@@ -5980,7 +6472,7 @@ public:
::clEnqueueReleaseGLObjects(
object_,
(mem_objects != NULL) ? (cl_uint) mem_objects->size() : 0,
- (mem_objects != NULL) ? (const cl_mem *) &mem_objects->front(): NULL,
+ (mem_objects != NULL && mem_objects->size() > 0) ? (const cl_mem *) &mem_objects->front(): NULL,
(events != NULL) ? (cl_uint) events->size() : 0,
(events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL,
(event != NULL) ? &tmp : NULL),
@@ -6023,7 +6515,7 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *PFN_clEnqueueReleaseD3D10ObjectsKHR)(
pfn_clEnqueueAcquireD3D10ObjectsKHR(
object_,
(mem_objects != NULL) ? (cl_uint) mem_objects->size() : 0,
- (mem_objects != NULL) ? (const cl_mem *) &mem_objects->front(): NULL,
+ (mem_objects != NULL && mem_objects->size() > 0) ? (const cl_mem *) &mem_objects->front(): NULL,
(events != NULL) ? (cl_uint) events->size() : 0,
(events != NULL) ? (cl_event*) &events->front() : NULL,
(event != NULL) ? &tmp : NULL),
@@ -6056,9 +6548,9 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *PFN_clEnqueueReleaseD3D10ObjectsKHR)(
pfn_clEnqueueReleaseD3D10ObjectsKHR(
object_,
(mem_objects != NULL) ? (cl_uint) mem_objects->size() : 0,
- (mem_objects != NULL) ? (const cl_mem *) &mem_objects->front(): NULL,
+ (mem_objects != NULL && mem_objects->size() > 0) ? (const cl_mem *) &mem_objects->front(): NULL,
(events != NULL) ? (cl_uint) events->size() : 0,
- (events != NULL) ? (cl_event*) &events->front() : NULL,
+ (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL,
(event != NULL) ? &tmp : NULL),
__ENQUEUE_RELEASE_GL_ERR);
@@ -6094,14 +6586,121 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *PFN_clEnqueueReleaseD3D10ObjectsKHR)(
};
#ifdef _WIN32
+#ifdef CL_HPP_CPP11_ATOMICS_SUPPORTED
+__declspec(selectany) std::atomic CommandQueue::default_initialized_;
+#else // !CL_HPP_CPP11_ATOMICS_SUPPORTED
__declspec(selectany) volatile int CommandQueue::default_initialized_ = __DEFAULT_NOT_INITIALIZED;
+#endif // !CL_HPP_CPP11_ATOMICS_SUPPORTED
__declspec(selectany) CommandQueue CommandQueue::default_;
__declspec(selectany) volatile cl_int CommandQueue::default_error_ = CL_SUCCESS;
-#else
+#else // !_WIN32
+#ifdef CL_HPP_CPP11_ATOMICS_SUPPORTED
+__attribute__((weak)) std::atomic CommandQueue::default_initialized_;
+#else // !CL_HPP_CPP11_ATOMICS_SUPPORTED
__attribute__((weak)) volatile int CommandQueue::default_initialized_ = __DEFAULT_NOT_INITIALIZED;
+#endif // !CL_HPP_CPP11_ATOMICS_SUPPORTED
__attribute__((weak)) CommandQueue CommandQueue::default_;
__attribute__((weak)) volatile cl_int CommandQueue::default_error_ = CL_SUCCESS;
-#endif
+#endif // !_WIN32
+
+template< typename IteratorType >
+Buffer::Buffer(
+ const Context &context,
+ IteratorType startIterator,
+ IteratorType endIterator,
+ bool readOnly,
+ bool useHostPtr,
+ cl_int* err)
+{
+ typedef typename std::iterator_traits::value_type DataType;
+ cl_int error;
+
+ cl_mem_flags flags = 0;
+ if( readOnly ) {
+ flags |= CL_MEM_READ_ONLY;
+ }
+ else {
+ flags |= CL_MEM_READ_WRITE;
+ }
+ if( useHostPtr ) {
+ flags |= CL_MEM_USE_HOST_PTR;
+ }
+
+ ::size_t size = sizeof(DataType)*(endIterator - startIterator);
+
+ if( useHostPtr ) {
+ object_ = ::clCreateBuffer(context(), flags, size, static_cast(&*startIterator), &error);
+ } else {
+ object_ = ::clCreateBuffer(context(), flags, size, 0, &error);
+ }
+
+ detail::errHandler(error, __CREATE_BUFFER_ERR);
+ if (err != NULL) {
+ *err = error;
+ }
+
+ if( !useHostPtr ) {
+ CommandQueue queue(context, 0, &error);
+ detail::errHandler(error, __CREATE_BUFFER_ERR);
+ if (err != NULL) {
+ *err = error;
+ }
+
+ error = cl::copy(queue, startIterator, endIterator, *this);
+ detail::errHandler(error, __CREATE_BUFFER_ERR);
+ if (err != NULL) {
+ *err = error;
+ }
+ }
+}
+
+template< typename IteratorType >
+Buffer::Buffer(
+ const CommandQueue &queue,
+ IteratorType startIterator,
+ IteratorType endIterator,
+ bool readOnly,
+ bool useHostPtr,
+ cl_int* err)
+{
+ typedef typename std::iterator_traits::value_type DataType;
+ cl_int error;
+
+ cl_mem_flags flags = 0;
+ if (readOnly) {
+ flags |= CL_MEM_READ_ONLY;
+ }
+ else {
+ flags |= CL_MEM_READ_WRITE;
+ }
+ if (useHostPtr) {
+ flags |= CL_MEM_USE_HOST_PTR;
+ }
+
+ ::size_t size = sizeof(DataType)*(endIterator - startIterator);
+
+ Context context = queue.getInfo();
+
+ if (useHostPtr) {
+ object_ = ::clCreateBuffer(context(), flags, size, static_cast(&*startIterator), &error);
+ }
+ else {
+ object_ = ::clCreateBuffer(context(), flags, size, 0, &error);
+ }
+
+ detail::errHandler(error, __CREATE_BUFFER_ERR);
+ if (err != NULL) {
+ *err = error;
+ }
+
+ if (!useHostPtr) {
+ error = cl::copy(queue, startIterator, endIterator, *this);
+ detail::errHandler(error, __CREATE_BUFFER_ERR);
+ if (err != NULL) {
+ *err = error;
+ }
+ }
+}
inline cl_int enqueueReadBuffer(
const Buffer& buffer,
@@ -6221,9 +6820,43 @@ inline cl_int enqueueCopyBuffer(
/**
* Blocking copy operation between iterators and a buffer.
+ * Host to Device.
+ * Uses default command queue.
*/
template< typename IteratorType >
inline cl_int copy( IteratorType startIterator, IteratorType endIterator, cl::Buffer &buffer )
+{
+ cl_int error;
+ CommandQueue queue = CommandQueue::getDefault(&error);
+ if (error != CL_SUCCESS)
+ return error;
+
+ return cl::copy(queue, startIterator, endIterator, buffer);
+}
+
+/**
+ * Blocking copy operation between iterators and a buffer.
+ * Device to Host.
+ * Uses default command queue.
+ */
+template< typename IteratorType >
+inline cl_int copy( const cl::Buffer &buffer, IteratorType startIterator, IteratorType endIterator )
+{
+ cl_int error;
+ CommandQueue queue = CommandQueue::getDefault(&error);
+ if (error != CL_SUCCESS)
+ return error;
+
+ return cl::copy(queue, buffer, startIterator, endIterator);
+}
+
+/**
+ * Blocking copy operation between iterators and a buffer.
+ * Host to Device.
+ * Uses specified queue.
+ */
+template< typename IteratorType >
+inline cl_int copy( const CommandQueue &queue, IteratorType startIterator, IteratorType endIterator, cl::Buffer &buffer )
{
typedef typename std::iterator_traits::value_type DataType;
cl_int error;
@@ -6232,7 +6865,7 @@ inline cl_int copy( IteratorType startIterator, IteratorType endIterator, cl::Bu
::size_t byteLength = length*sizeof(DataType);
DataType *pointer =
- static_cast(enqueueMapBuffer(buffer, CL_TRUE, CL_MAP_WRITE, 0, byteLength, 0, 0, &error));
+ static_cast(queue.enqueueMapBuffer(buffer, CL_TRUE, CL_MAP_WRITE, 0, byteLength, 0, 0, &error));
// if exceptions enabled, enqueueMapBuffer will throw
if( error != CL_SUCCESS ) {
return error;
@@ -6247,7 +6880,7 @@ inline cl_int copy( IteratorType startIterator, IteratorType endIterator, cl::Bu
std::copy(startIterator, endIterator, pointer);
#endif
Event endEvent;
- error = enqueueUnmapMemObject(buffer, pointer, 0, &endEvent);
+ error = queue.enqueueUnmapMemObject(buffer, pointer, 0, &endEvent);
// if exceptions enabled, enqueueUnmapMemObject will throw
if( error != CL_SUCCESS ) {
return error;
@@ -6258,9 +6891,11 @@ inline cl_int copy( IteratorType startIterator, IteratorType endIterator, cl::Bu
/**
* Blocking copy operation between iterators and a buffer.
+ * Device to Host.
+ * Uses specified queue.
*/
template< typename IteratorType >
-inline cl_int copy( const cl::Buffer &buffer, IteratorType startIterator, IteratorType endIterator )
+inline cl_int copy( const CommandQueue &queue, const cl::Buffer &buffer, IteratorType startIterator, IteratorType endIterator )
{
typedef typename std::iterator_traits::value_type DataType;
cl_int error;
@@ -6269,14 +6904,14 @@ inline cl_int copy( const cl::Buffer &buffer, IteratorType startIterator, Iterat
::size_t byteLength = length*sizeof(DataType);
DataType *pointer =
- static_cast(enqueueMapBuffer(buffer, CL_TRUE, CL_MAP_READ, 0, byteLength, 0, 0, &error));
+ static_cast(queue.enqueueMapBuffer(buffer, CL_TRUE, CL_MAP_READ, 0, byteLength, 0, 0, &error));
// if exceptions enabled, enqueueMapBuffer will throw
if( error != CL_SUCCESS ) {
return error;
}
std::copy(pointer, pointer + length, startIterator);
Event endEvent;
- error = enqueueUnmapMemObject(buffer, pointer, 0, &endEvent);
+ error = queue.enqueueUnmapMemObject(buffer, pointer, 0, &endEvent);
// if exceptions enabled, enqueueUnmapMemObject will throw
if( error != CL_SUCCESS ) {
return error;
@@ -6332,7 +6967,7 @@ inline cl_int enqueueWriteBufferRect(
::size_t buffer_slice_pitch,
::size_t host_row_pitch,
::size_t host_slice_pitch,
- void *ptr,
+ const void *ptr,
const VECTOR_CLASS* events = NULL,
Event* event = NULL)
{
@@ -6430,7 +7065,7 @@ inline cl_int enqueueWriteImage(
const size_t<3>& region,
::size_t row_pitch,
::size_t slice_pitch,
- void* ptr,
+ const void* ptr,
const VECTOR_CLASS* events = NULL,
Event* event = NULL)
{
@@ -6769,6 +7404,7 @@ template <
typename T20, typename T21, typename T22, typename T23,
typename T24, typename T25, typename T26, typename T27,
typename T28, typename T29, typename T30, typename T31
+
>
class KernelFunctorGlobal
{
@@ -6822,6 +7458,7 @@ public:
T29 t29 = NullType(),
T30 t30 = NullType(),
T31 t31 = NullType()
+
)
{
Event event;
@@ -6857,6 +7494,7 @@ public:
SetArg<29, T29>::set(kernel_, t29);
SetArg<30, T30>::set(kernel_, t30);
SetArg<31, T31>::set(kernel_, t31);
+
args.queue_.enqueueNDRangeKernel(
kernel_,
@@ -12147,6 +12785,7 @@ template <
typename T27 = detail::NullType, typename T28 = detail::NullType,
typename T29 = detail::NullType, typename T30 = detail::NullType,
typename T31 = detail::NullType
+
>
struct make_kernel :
public detail::functionImplementation_<
@@ -12158,11 +12797,12 @@ struct make_kernel :
T20, T21, T22, T23,
T24, T25, T26, T27,
T28, T29, T30, T31
+
>
{
public:
- typedef detail::KernelFunctorGlobal<
- T0, T1, T2, T3,
+ typedef detail::KernelFunctorGlobal<
+ T0, T1, T2, T3,
T4, T5, T6, T7,
T8, T9, T10, T11,
T12, T13, T14, T15,
@@ -12170,6 +12810,7 @@ public:
T20, T21, T22, T23,
T24, T25, T26, T27,
T28, T29, T30, T31
+
> FunctorType;
make_kernel(
@@ -12185,6 +12826,7 @@ public:
T20, T21, T22, T23,
T24, T25, T26, T27,
T28, T29, T30, T31
+
>(
FunctorType(program, name, err))
{}
@@ -12200,6 +12842,7 @@ public:
T20, T21, T22, T23,
T24, T25, T26, T27,
T28, T29, T30, T31
+
>(
FunctorType(kernel))
{}
@@ -12296,10 +12939,9 @@ public:
#undef __DEFAULT_BEING_INITIALIZED
#undef __DEFAULT_INITIALIZED
+#undef CL_HPP_RVALUE_REFERENCES_SUPPORTED
+#undef CL_HPP_NOEXCEPT
+
} // namespace cl
-#ifdef _WIN32
-#pragma pop_macro("max")
-#endif // _WIN32
-
#endif // CL_HPP_
diff --git a/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_d3d10.h b/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_d3d10.h
index 81b0d37214..d5960a43f7 100644
--- a/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_d3d10.h
+++ b/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_d3d10.h
@@ -1,5 +1,5 @@
/**********************************************************************************
- * Copyright (c) 2008-2012 The Khronos Group Inc.
+ * Copyright (c) 2008-2015 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
@@ -12,6 +12,11 @@
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
+ * 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.
@@ -43,31 +48,31 @@ typedef cl_uint cl_d3d10_device_set_khr;
/******************************************************************************/
-// Error Codes
+/* Error Codes */
#define CL_INVALID_D3D10_DEVICE_KHR -1002
#define CL_INVALID_D3D10_RESOURCE_KHR -1003
#define CL_D3D10_RESOURCE_ALREADY_ACQUIRED_KHR -1004
#define CL_D3D10_RESOURCE_NOT_ACQUIRED_KHR -1005
-// cl_d3d10_device_source_nv
+/* cl_d3d10_device_source_nv */
#define CL_D3D10_DEVICE_KHR 0x4010
#define CL_D3D10_DXGI_ADAPTER_KHR 0x4011
-// cl_d3d10_device_set_nv
+/* cl_d3d10_device_set_nv */
#define CL_PREFERRED_DEVICES_FOR_D3D10_KHR 0x4012
#define CL_ALL_DEVICES_FOR_D3D10_KHR 0x4013
-// cl_context_info
+/* cl_context_info */
#define CL_CONTEXT_D3D10_DEVICE_KHR 0x4014
#define CL_CONTEXT_D3D10_PREFER_SHARED_RESOURCES_KHR 0x402C
-// cl_mem_info
+/* cl_mem_info */
#define CL_MEM_D3D10_RESOURCE_KHR 0x4015
-// cl_image_info
+/* cl_image_info */
#define CL_IMAGE_D3D10_SUBRESOURCE_KHR 0x4016
-// cl_command_type
+/* cl_command_type */
#define CL_COMMAND_ACQUIRE_D3D10_OBJECTS_KHR 0x4017
#define CL_COMMAND_RELEASE_D3D10_OBJECTS_KHR 0x4018
@@ -122,5 +127,5 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseD3D10ObjectsKHR_fn)(
}
#endif
-#endif // __OPENCL_CL_D3D10_H
+#endif /* __OPENCL_CL_D3D10_H */
diff --git a/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_d3d11.h b/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_d3d11.h
index d3c8bdc2b1..39f9072398 100644
--- a/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_d3d11.h
+++ b/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_d3d11.h
@@ -1,5 +1,5 @@
/**********************************************************************************
- * Copyright (c) 2008-2012 The Khronos Group Inc.
+ * Copyright (c) 2008-2015 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
@@ -12,6 +12,11 @@
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
+ * 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.
@@ -43,31 +48,31 @@ typedef cl_uint cl_d3d11_device_set_khr;
/******************************************************************************/
-// Error Codes
+/* Error Codes */
#define CL_INVALID_D3D11_DEVICE_KHR -1006
#define CL_INVALID_D3D11_RESOURCE_KHR -1007
#define CL_D3D11_RESOURCE_ALREADY_ACQUIRED_KHR -1008
#define CL_D3D11_RESOURCE_NOT_ACQUIRED_KHR -1009
-// cl_d3d11_device_source
+/* cl_d3d11_device_source */
#define CL_D3D11_DEVICE_KHR 0x4019
#define CL_D3D11_DXGI_ADAPTER_KHR 0x401A
-// cl_d3d11_device_set
+/* cl_d3d11_device_set */
#define CL_PREFERRED_DEVICES_FOR_D3D11_KHR 0x401B
#define CL_ALL_DEVICES_FOR_D3D11_KHR 0x401C
-// cl_context_info
+/* cl_context_info */
#define CL_CONTEXT_D3D11_DEVICE_KHR 0x401D
#define CL_CONTEXT_D3D11_PREFER_SHARED_RESOURCES_KHR 0x402D
-// cl_mem_info
+/* cl_mem_info */
#define CL_MEM_D3D11_RESOURCE_KHR 0x401E
-// cl_image_info
+/* cl_image_info */
#define CL_IMAGE_D3D11_SUBRESOURCE_KHR 0x401F
-// cl_command_type
+/* cl_command_type */
#define CL_COMMAND_ACQUIRE_D3D11_OBJECTS_KHR 0x4020
#define CL_COMMAND_RELEASE_D3D11_OBJECTS_KHR 0x4021
@@ -122,5 +127,5 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseD3D11ObjectsKHR_fn)(
}
#endif
-#endif // __OPENCL_CL_D3D11_H
+#endif /* __OPENCL_CL_D3D11_H */
diff --git a/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_dx9_media_sharing.h b/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_dx9_media_sharing.h
index 1ef543a5af..7c217b880a 100644
--- a/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_dx9_media_sharing.h
+++ b/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_dx9_media_sharing.h
@@ -1,5 +1,5 @@
/**********************************************************************************
- * Copyright (c) 2008-2012 The Khronos Group Inc.
+ * Copyright (c) 2008-2015 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
@@ -12,6 +12,11 @@
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
+ * 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.
@@ -52,34 +57,34 @@ typedef struct _cl_dx9_surface_info_khr
/******************************************************************************/
-// Error Codes
+/* Error Codes */
#define CL_INVALID_DX9_MEDIA_ADAPTER_KHR -1010
#define CL_INVALID_DX9_MEDIA_SURFACE_KHR -1011
#define CL_DX9_MEDIA_SURFACE_ALREADY_ACQUIRED_KHR -1012
#define CL_DX9_MEDIA_SURFACE_NOT_ACQUIRED_KHR -1013
-// cl_media_adapter_type_khr
+/* cl_media_adapter_type_khr */
#define CL_ADAPTER_D3D9_KHR 0x2020
#define CL_ADAPTER_D3D9EX_KHR 0x2021
#define CL_ADAPTER_DXVA_KHR 0x2022
-// cl_media_adapter_set_khr
+/* cl_media_adapter_set_khr */
#define CL_PREFERRED_DEVICES_FOR_DX9_MEDIA_ADAPTER_KHR 0x2023
#define CL_ALL_DEVICES_FOR_DX9_MEDIA_ADAPTER_KHR 0x2024
-// cl_context_info
+/* cl_context_info */
#define CL_CONTEXT_ADAPTER_D3D9_KHR 0x2025
#define CL_CONTEXT_ADAPTER_D3D9EX_KHR 0x2026
#define CL_CONTEXT_ADAPTER_DXVA_KHR 0x2027
-// cl_mem_info
+/* cl_mem_info */
#define CL_MEM_DX9_MEDIA_ADAPTER_TYPE_KHR 0x2028
#define CL_MEM_DX9_MEDIA_SURFACE_INFO_KHR 0x2029
-// cl_image_info
+/* cl_image_info */
#define CL_IMAGE_DX9_MEDIA_PLANE_KHR 0x202A
-// cl_command_type
+/* cl_command_type */
#define CL_COMMAND_ACQUIRE_DX9_MEDIA_SURFACES_KHR 0x202B
#define CL_COMMAND_RELEASE_DX9_MEDIA_SURFACES_KHR 0x202C
@@ -123,5 +128,5 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseDX9MediaSurfacesKHR_fn
}
#endif
-#endif // __OPENCL_CL_DX9_MEDIA_SHARING_H
+#endif /* __OPENCL_CL_DX9_MEDIA_SHARING_H */
diff --git a/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_ext.h b/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_ext.h
index 6a12cd6ea0..8106804802 100644
--- a/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_ext.h
+++ b/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_ext.h
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008-2013 The Khronos Group Inc.
+ * Copyright (c) 2008-2015 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
@@ -12,6 +12,11 @@
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
+ * 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.
@@ -21,7 +26,7 @@
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
******************************************************************************/
-/* $Revision: 14835 $ on $Date: 2011-05-26 11:32:00 -0700 (Thu, 26 May 2011) $ */
+/* $Revision: 11928 $ on $Date: 2010-07-13 09:04:56 -0700 (Tue, 13 Jul 2010) $ */
/* cl_ext.h contains OpenCL extensions which don't have external */
/* (OpenGL, D3D) dependencies. */
@@ -149,40 +154,7 @@ extern CL_API_ENTRY cl_int CL_API_CALL clTerminateContextKHR(cl_context /* conte
typedef CL_API_ENTRY cl_int (CL_API_CALL *clTerminateContextKHR_fn)(cl_context /* context */) CL_EXT_SUFFIX__VERSION_1_2;
-//
-/******************************
- * cl_khr_subgroups extension *
- ******************************/
-
-#define cl_khr_subgroups 1
-
-typedef cl_uint cl_kernel_sub_group_info;
-
-#define CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE 0x2011
-#define CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE 0x2012
-
-extern CL_API_ENTRY cl_int CL_API_CALL
-clGetKernelSubGroupInfoKHR(cl_kernel /* kernel */,
- cl_device_id /* device */,
- cl_kernel_sub_group_info /* param_name */,
- size_t /* input_value_size */,
- const void * /* input_value */,
- size_t /* param_value_size */,
- void * /* param_value */,
- size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_2;
-
-typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetKernelSubGroupInfoKHR_fn)(
- cl_kernel /* kernel */,
- cl_device_id /* device */,
- cl_kernel_sub_group_info /* param_name */,
- size_t /* input_value_size */,
- const void * /* input_value */,
- size_t /* param_value_size */,
- void * /* param_value */,
- size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_2;
-
-//
-
+
/*
* Extension: cl_khr_spir
*
@@ -190,11 +162,10 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetKernelSubGroupInfoKHR_fn)(
* Standard Portable Intermediate Representation (SPIR) instance
*/
-// KHR SPIR extension (Section 9.15.2 in the extension SPEC)
-// TODO: The values have been approved by khronos and waiting to be updated in official header file.
#define CL_DEVICE_SPIR_VERSIONS 0x40E0
#define CL_PROGRAM_BINARY_TYPE_INTERMEDIATE 0x40E1
+
/******************************************
* cl_nv_device_attribute_query extension *
******************************************/
@@ -245,6 +216,138 @@ typedef union
#define CL_DEVICE_TOPOLOGY_TYPE_PCIE_AMD 1
+/**************************
+* cl_amd_offline_devices *
+**************************/
+#define CL_CONTEXT_OFFLINE_DEVICES_AMD 0x403F
+
+/********************************
+* cl_amd_bus_addressable_memory *
+********************************/
+
+/* cl_mem flag - bitfield */
+#define CL_MEM_BUS_ADDRESSABLE_AMD (1<<30)
+#define CL_MEM_EXTERNAL_PHYSICAL_AMD (1<<31)
+
+#define CL_COMMAND_WAIT_SIGNAL_AMD 0x4080
+#define CL_COMMAND_WRITE_SIGNAL_AMD 0x4081
+#define CL_COMMAND_MAKE_BUFFERS_RESIDENT_AMD 0x4082
+
+typedef struct _cl_bus_address_amd
+{
+ cl_ulong surface_bus_address;
+ cl_ulong marker_bus_address;
+} cl_bus_address_amd;
+
+typedef CL_API_ENTRY cl_int
+(CL_API_CALL * clEnqueueWaitSignalAMD_fn)( cl_command_queue /*command_queue*/,
+ cl_mem /*mem_object*/,
+ cl_uint /*value*/,
+ cl_uint /*num_events*/,
+ const cl_event * /*event_wait_list*/,
+ cl_event * /*event*/) CL_EXT_SUFFIX__VERSION_1_2;
+
+typedef CL_API_ENTRY cl_int
+(CL_API_CALL * clEnqueueWriteSignalAMD_fn)( cl_command_queue /*command_queue*/,
+ cl_mem /*mem_object*/,
+ cl_uint /*value*/,
+ cl_ulong /*offset*/,
+ cl_uint /*num_events*/,
+ const cl_event * /*event_list*/,
+ cl_event * /*event*/) CL_EXT_SUFFIX__VERSION_1_2;
+
+typedef CL_API_ENTRY cl_int
+(CL_API_CALL * clEnqueueMakeBuffersResidentAMD_fn)( cl_command_queue /*command_queue*/,
+ cl_uint /*num_mem_objs*/,
+ cl_mem * /*mem_objects*/,
+ cl_bool /*blocking_make_resident*/,
+ cl_bus_address_amd * /*bus_addresses*/,
+ cl_uint /*num_events*/,
+ const cl_event * /*event_list*/,
+ cl_event * /*event*/) CL_EXT_SUFFIX__VERSION_1_2;
+
+/**********************
+* cl_amd_liquid_flash *
+***********************/
+#define cl_amd_liquid_flash 1
+
+#define CL_COMMAND_READ_SSG_FILE_AMD 0x4083
+#define CL_COMMAND_WRITE_SSG_FILE_AMD 0x4087
+
+#define CL_INVALID_FILE_OBJECT_AMD 0x4084
+
+typedef struct _cl_file_amd * cl_file_amd;
+
+typedef cl_uint cl_file_flags_amd;
+#define CL_FILE_READ_ONLY_AMD (1 << 0)
+#define CL_FILE_WRITE_ONLY_AMD (1 << 1)
+#define CL_FILE_READ_WRITE_AMD (1 << 2)
+
+typedef cl_uint cl_file_info_amd;
+#define CL_FILE_BLOCK_SIZE_AMD 0x4085
+#define CL_FILE_SIZE_AMD 0x4086
+
+typedef CL_API_ENTRY cl_file_amd
+(CL_API_CALL * clCreateSsgFileObjectAMD_fn)(cl_context /*context*/,
+ cl_file_flags_amd /*flags*/,
+ const wchar_t * /*file_name*/,
+ cl_int * /*errcode_ret*/) CL_EXT_SUFFIX__VERSION_1_2;
+
+typedef CL_API_ENTRY cl_int
+(CL_API_CALL * clGetSsgFileObjectInfoAMD_fn)(cl_file_amd /* file */,
+ cl_file_info_amd /* param_name */,
+ size_t /* param_value_size */,
+ void * /* param_value */,
+ size_t * /* param_value_size_ret */) CL_EXT_SUFFIX__VERSION_1_2;
+
+typedef CL_API_ENTRY cl_int
+(CL_API_CALL * clRetainSsgFileObjectAMD_fn)( cl_file_amd /*file*/) CL_EXT_SUFFIX__VERSION_1_2;
+
+typedef CL_API_ENTRY cl_int
+(CL_API_CALL * clReleaseSsgFileObjectAMD_fn)( cl_file_amd /*file*/) CL_EXT_SUFFIX__VERSION_1_2;
+
+typedef CL_API_ENTRY cl_int
+(CL_API_CALL * clEnqueueReadSsgFileAMD_fn)(cl_command_queue /*command_queue*/,
+ cl_mem /*buffer*/,
+ cl_bool /*blocking_write*/,
+ size_t /*buffer_offset*/,
+ size_t /*cb*/,
+ cl_file_amd /*file*/,
+ size_t /*file_offset*/,
+ cl_uint /*num_events_in_wait_list*/,
+ const cl_event * /*event_wait_list*/,
+ cl_event * /*event*/) CL_EXT_SUFFIX__VERSION_1_2;
+
+typedef CL_API_ENTRY cl_int
+(CL_API_CALL * clEnqueueWriteSsgFileAMD_fn)(cl_command_queue /*command_queue*/,
+ cl_mem /*buffer*/,
+ cl_bool /*blocking_read*/,
+ size_t /*buffer_offset*/,
+ size_t /*cb*/,
+ cl_file_amd /*file*/,
+ size_t /*file_offset*/,
+ cl_uint /*num_events_in_wait_list*/,
+ const cl_event * /*event_wait_list*/,
+ cl_event * /*event*/) CL_EXT_SUFFIX__VERSION_1_2;
+
+/*************************
+* cl_amd_copy_buffer_p2p *
+**************************/
+#define CL_DEVICE_NUM_P2P_DEVICES_AMD 0x4088
+#define CL_DEVICE_P2P_DEVICES_AMD 0x4089
+
+#define cl_amd_copy_buffer_p2p 1
+
+typedef CL_API_ENTRY cl_int
+(CL_API_CALL * clEnqueueCopyBufferP2PAMD_fn)(cl_command_queue /*command_queue*/,
+ cl_mem /*src_buffer*/,
+ cl_mem /*dst_buffer*/,
+ size_t /*src_offset*/,
+ size_t /*dst_offset*/,
+ size_t /*cb*/,
+ cl_uint /*num_events_in_wait_list*/,
+ const cl_event* /*event_wait_list*/,
+ cl_event* /*event*/) CL_EXT_SUFFIX__VERSION_1_2;
//
/***************************
@@ -264,36 +367,54 @@ typedef cl_int (CL_CALLBACK * intercept_callback_fn)(cl_event, cl_int *);
#define CL_KERNEL_EXEC_INFO_NEW_VCOP_AMD 0x4120
#define CL_KERNEL_EXEC_INFO_PFPA_VCOP_AMD 0x4121
-/***************************************
-* cl-gl depth buffer interop extension *
-****************************************/
+/*************************
+* cl_amd_object_metadata *
+**************************/
+#define cl_amd_object_metadata 1
-#define CL_DEPTH 0x10BD
-#define CL_DEPTH_STENCIL 0x10BE
-#define CL_UNORM_INT24 0x10DF
-#define CL_GL_NUM_SAMPLES 0x2012
+typedef size_t cl_key_amd;
+
+#define CL_INVALID_OBJECT_AMD 0x403A
+#define CL_INVALID_KEY_AMD 0x403B
+#define CL_PLATFORM_MAX_KEYS_AMD 0x403C
+
+typedef CL_API_ENTRY cl_key_amd (CL_API_CALL * clCreateKeyAMD_fn)(
+ cl_platform_id /* platform */,
+ void (CL_CALLBACK * /* destructor */)( void* /* old_value */),
+ cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_1;
+
+typedef CL_API_ENTRY cl_int (CL_API_CALL * clObjectGetValueForKeyAMD_fn)(
+ void * /* object */,
+ cl_key_amd /* key */,
+ void ** /* ret_val */) CL_API_SUFFIX__VERSION_1_1;
+
+typedef CL_API_ENTRY cl_int (CL_API_CALL * clObjectSetValueForKeyAMD_fn)(
+ void * /* object */,
+ cl_key_amd /* key */,
+ void * /* value */) CL_API_SUFFIX__VERSION_1_1;
//
-/**************************
-* cl_amd_offline_devices *
-**************************/
-#define CL_CONTEXT_OFFLINE_DEVICES_AMD 0x403F
+/*********************************
+* cl_arm_printf extension
+*********************************/
+#define CL_PRINTF_CALLBACK_ARM 0x40B0
+#define CL_PRINTF_BUFFERSIZE_ARM 0x40B1
#ifdef CL_VERSION_1_1
/***********************************
* cl_ext_device_fission extension *
***********************************/
#define cl_ext_device_fission 1
-
+
extern CL_API_ENTRY cl_int CL_API_CALL
clReleaseDeviceEXT( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1;
-
+
typedef CL_API_ENTRY cl_int
(CL_API_CALL *clReleaseDeviceEXT_fn)( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1;
extern CL_API_ENTRY cl_int CL_API_CALL
clRetainDeviceEXT( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1;
-
+
typedef CL_API_ENTRY cl_int
(CL_API_CALL *clRetainDeviceEXT_fn)( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1;
@@ -317,14 +438,14 @@ typedef cl_int (CL_CALLBACK * intercept_callback_fn)(cl_event, cl_int *);
#define CL_DEVICE_PARTITION_BY_COUNTS_EXT 0x4051
#define CL_DEVICE_PARTITION_BY_NAMES_EXT 0x4052
#define CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN_EXT 0x4053
-
+
/* clDeviceGetInfo selectors */
#define CL_DEVICE_PARENT_DEVICE_EXT 0x4054
#define CL_DEVICE_PARTITION_TYPES_EXT 0x4055
#define CL_DEVICE_AFFINITY_DOMAINS_EXT 0x4056
#define CL_DEVICE_REFERENCE_COUNT_EXT 0x4057
#define CL_DEVICE_PARTITION_STYLE_EXT 0x4058
-
+
/* clGetImageInfo enum */
#define CL_IMAGE_BYTE_PITCH_AMD 0x4059
@@ -332,7 +453,7 @@ typedef cl_int (CL_CALLBACK * intercept_callback_fn)(cl_event, cl_int *);
#define CL_DEVICE_PARTITION_FAILED_EXT -1057
#define CL_INVALID_PARTITION_COUNT_EXT -1058
#define CL_INVALID_PARTITION_NAME_EXT -1059
-
+
/* CL_AFFINITY_DOMAINs */
#define CL_AFFINITY_DOMAIN_L1_CACHE_EXT 0x1
#define CL_AFFINITY_DOMAIN_L2_CACHE_EXT 0x2
@@ -340,6 +461,7 @@ typedef cl_int (CL_CALLBACK * intercept_callback_fn)(cl_event, cl_int *);
#define CL_AFFINITY_DOMAIN_L4_CACHE_EXT 0x4
#define CL_AFFINITY_DOMAIN_NUMA_EXT 0x10
#define CL_AFFINITY_DOMAIN_NEXT_FISSIONABLE_EXT 0x100
+
/* cl_device_partition_property_ext list terminators */
#define CL_PROPERTIES_LIST_END_EXT ((cl_device_partition_property_ext) 0)
#define CL_PARTITION_BY_COUNTS_LIST_END_EXT ((cl_device_partition_property_ext) 0)
@@ -374,11 +496,11 @@ clGetDeviceImageInfoQCOM(cl_device_id device,
typedef struct _cl_mem_ext_host_ptr
{
- // Type of external memory allocation.
- // Legal values will be defined in layered extensions.
+ /* Type of external memory allocation. */
+ /* Legal values will be defined in layered extensions. */
cl_uint allocation_type;
- // Host cache policy for this external memory allocation.
+ /* Host cache policy for this external memory allocation. */
cl_uint host_cache_policy;
} cl_mem_ext_host_ptr;
@@ -391,111 +513,223 @@ typedef struct _cl_mem_ext_host_ptr
typedef struct _cl_mem_ion_host_ptr
{
- // Type of external memory allocation.
- // Must be CL_MEM_ION_HOST_PTR_QCOM for ION allocations.
+ /* Type of external memory allocation. */
+ /* Must be CL_MEM_ION_HOST_PTR_QCOM for ION allocations. */
cl_mem_ext_host_ptr ext_host_ptr;
- // ION file descriptor
+ /* ION file descriptor */
int ion_filedesc;
- // Host pointer to the ION allocated memory
+ /* Host pointer to the ION allocated memory */
void* ion_hostptr;
} cl_mem_ion_host_ptr;
- //
- /*************************
- * cl_amd_object_metadata *
- **************************/
- #define cl_amd_object_metadata 1
-
- typedef size_t cl_key_amd;
-
- #define CL_INVALID_OBJECT_AMD 0x403A
- #define CL_INVALID_KEY_AMD 0x403B
- #define CL_PLATFORM_MAX_KEYS_AMD 0x403C
-
- typedef CL_API_ENTRY cl_key_amd (CL_API_CALL * clCreateKeyAMD_fn)(
- cl_platform_id /* platform */,
- void (CL_CALLBACK * /* destructor */)( void* /* old_value */),
- cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_1;
-
- typedef CL_API_ENTRY cl_int (CL_API_CALL * clObjectGetValueForKeyAMD_fn)(
- void * /* object */,
- cl_key_amd /* key */,
- void ** /* ret_val */) CL_API_SUFFIX__VERSION_1_1;
-
- typedef CL_API_ENTRY cl_int (CL_API_CALL * clObjectSetValueForKeyAMD_fn)(
- void * /* object */,
- cl_key_amd /* key */,
- void * /* value */) CL_API_SUFFIX__VERSION_1_1;
-//
#endif /* CL_VERSION_1_1 */
-#ifdef CL_VERSION_1_2
- /********************************
- * cl_amd_bus_addressable_memory *
- ********************************/
+#if defined(CL_VERSION_1_2)
- /* cl_mem flag - bitfield */
- #define CL_MEM_BUS_ADDRESSABLE_AMD (1<<30)
- #define CL_MEM_EXTERNAL_PHYSICAL_AMD (1<<31)
+/******************************************
+ * cl_img_yuv_image extension *
+ ******************************************/
- #define CL_COMMAND_WAIT_SIGNAL_AMD 0x4080
- #define CL_COMMAND_WRITE_SIGNAL_AMD 0x4081
- #define CL_COMMAND_MAKE_BUFFERS_RESIDENT_AMD 0x4082
+/* Image formats used in clCreateImage */
+#define CL_NV21_IMG 0x40D0
+#define CL_YV12_IMG 0x40D1
- typedef struct _cl_bus_address_amd
- {
- cl_ulong surface_bus_address;
- cl_ulong marker_bus_address;
- } cl_bus_address_amd;
+/******************************************
+ * cl_img_cached_allocations extension *
+ ******************************************/
- typedef CL_API_ENTRY cl_int
- (CL_API_CALL * clEnqueueWaitSignalAMD_fn)( cl_command_queue /*command_queue*/,
- cl_mem /*mem_object*/,
- cl_uint /*value*/,
- cl_uint /*num_events*/,
- const cl_event * /*event_wait_list*/,
- cl_event * /*event*/) CL_EXT_SUFFIX__VERSION_1_2;
+/* Flag values used by clCreteBuffer */
+#define CL_MEM_USE_UNCACHED_CPU_MEMORY_IMG (1 << 26)
+#define CL_MEM_USE_CACHED_CPU_MEMORY_IMG (1 << 27)
- typedef CL_API_ENTRY cl_int
- (CL_API_CALL * clEnqueueWriteSignalAMD_fn)( cl_command_queue /*command_queue*/,
- cl_mem /*mem_object*/,
- cl_uint /*value*/,
- cl_ulong /*offset*/,
- cl_uint /*num_events*/,
- const cl_event * /*event_list*/,
- cl_event * /*event*/) CL_EXT_SUFFIX__VERSION_1_2;
+/******************************************
+ * cl_img_use_gralloc_ptr extension *
+ ******************************************/
- typedef CL_API_ENTRY cl_int
- (CL_API_CALL * clEnqueueMakeBuffersResidentAMD_fn)( cl_command_queue /*command_queue*/,
- cl_uint /*num_mem_objs*/,
- cl_mem * /*mem_objects*/,
- cl_bool /*blocking_make_resident*/,
- cl_bus_address_amd * /*bus_addresses*/,
- cl_uint /*num_events*/,
- const cl_event * /*event_list*/,
- cl_event * /*event*/) CL_EXT_SUFFIX__VERSION_1_2;
+/* Flag values used by clCreteBuffer */
+#define CL_MEM_USE_GRALLOC_PTR_IMG (1 << 28)
+
+/* To be used by clGetEventInfo: */
+#define CL_COMMAND_ACQUIRE_GRALLOC_OBJECTS_IMG 0x40D2
+#define CL_COMMAND_RELEASE_GRALLOC_OBJECTS_IMG 0x40D3
+
+/* Error code from clEnqueueReleaseGrallocObjectsIMG */
+#define CL_GRALLOC_RESOURCE_NOT_ACQUIRED_IMG 0x40D4
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clEnqueueAcquireGrallocObjectsIMG(cl_command_queue /* command_queue */,
+ cl_uint /* num_objects */,
+ const cl_mem * /* mem_objects */,
+ cl_uint /* num_events_in_wait_list */,
+ const cl_event * /* event_wait_list */,
+ cl_event * /* event */) CL_EXT_SUFFIX__VERSION_1_2;
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clEnqueueReleaseGrallocObjectsIMG(cl_command_queue /* command_queue */,
+ cl_uint /* num_objects */,
+ const cl_mem * /* mem_objects */,
+ cl_uint /* num_events_in_wait_list */,
+ const cl_event * /* event_wait_list */,
+ cl_event * /* event */) CL_EXT_SUFFIX__VERSION_1_2;
#endif /* CL_VERSION_1_2 */
+
+/**********************************
+ * cl_arm_import_memory extension *
+ **********************************/
+
+#ifdef CL_VERSION_1_0
+
+typedef intptr_t cl_import_properties_arm;
+
+/* Default and valid proporties name for cl_arm_import_memory */
+#define CL_IMPORT_TYPE_ARM 0x40B2
+
+/* Host process memory type default value for CL_IMPORT_TYPE_ARM property */
+#define CL_IMPORT_TYPE_HOST_ARM 0x40B3
+
+/* DMA BUF memory type value for CL_IMPORT_TYPE_ARM property */
+#define CL_IMPORT_TYPE_DMA_BUF_ARM 0x40B4
+
+/* Secure DMA BUF memory type value for CL_IMPORT_TYPE_ARM property */
+#define CL_IMPORT_TYPE_SECURE_ARM 0x40B5
+
+/* This extension adds a new function that allows for direct memory import into
+ * OpenCL via the clImportMemoryARM function.
+ *
+ * Memory imported through this interface will be mapped into the device's page
+ * tables directly, providing zero copy access. It will never fall back to copy
+ * operations and aliased buffers.
+ *
+ * Types of memory supported for import are specified as additional extension
+ * strings.
+ *
+ * This extension produces cl_mem allocations which are compatible with all other
+ * users of cl_mem in the standard API.
+ *
+ * This extension maps pages with the same properties as the normal buffer creation
+ * function clCreateBuffer.
+ */
+extern CL_API_ENTRY cl_mem CL_API_CALL
+clImportMemoryARM( cl_context context,
+ cl_mem_flags flags,
+ const cl_import_properties_arm *properties,
+ void *memory,
+ size_t size,
+ cl_int *errcode_ret) CL_EXT_SUFFIX__VERSION_1_0;
+
+
+#endif /* CL_VERSION_1_0 */
+
+/******************************************
+ * cl_arm_shared_virtual_memory extension *
+ ******************************************/
+
#ifdef CL_VERSION_1_2
-/*********************************
-* cl_khr_il_program extension
-*********************************/
-#define cl_khr_il_program 1
-extern CL_API_ENTRY cl_program CL_API_CALL
-clCreateProgramWithILKHR(cl_context /* context */,
- const void * /* strings */,
- size_t /* lengths */,
- cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_2;
+/* Used by clGetDeviceInfo */
+#define CL_DEVICE_SVM_CAPABILITIES_ARM 0x40B6
-typedef CL_API_ENTRY cl_program
- ( CL_API_CALL * clCreateProgramWithILKHR_fn)(cl_context /* context */,
- const void * /* strings */,
- size_t /* lengths */,
- cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_2;
+/* Used by clGetMemObjectInfo */
+#define CL_MEM_USES_SVM_POINTER_ARM 0x40B7
+
+/* Used by clSetKernelExecInfoARM: */
+#define CL_KERNEL_EXEC_INFO_SVM_PTRS_ARM 0x40B8
+#define CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM_ARM 0x40B9
+
+/* To be used by clGetEventInfo: */
+#define CL_COMMAND_SVM_FREE_ARM 0x40BA
+#define CL_COMMAND_SVM_MEMCPY_ARM 0x40BB
+#define CL_COMMAND_SVM_MEMFILL_ARM 0x40BC
+#define CL_COMMAND_SVM_MAP_ARM 0x40BD
+#define CL_COMMAND_SVM_UNMAP_ARM 0x40BE
+
+/* Flag values returned by clGetDeviceInfo with CL_DEVICE_SVM_CAPABILITIES_ARM as the param_name. */
+#define CL_DEVICE_SVM_COARSE_GRAIN_BUFFER_ARM (1 << 0)
+#define CL_DEVICE_SVM_FINE_GRAIN_BUFFER_ARM (1 << 1)
+#define CL_DEVICE_SVM_FINE_GRAIN_SYSTEM_ARM (1 << 2)
+#define CL_DEVICE_SVM_ATOMICS_ARM (1 << 3)
+
+/* Flag values used by clSVMAllocARM: */
+#define CL_MEM_SVM_FINE_GRAIN_BUFFER_ARM (1 << 10)
+#define CL_MEM_SVM_ATOMICS_ARM (1 << 11)
+
+typedef cl_bitfield cl_svm_mem_flags_arm;
+typedef cl_uint cl_kernel_exec_info_arm;
+typedef cl_bitfield cl_device_svm_capabilities_arm;
+
+extern CL_API_ENTRY void * CL_API_CALL
+clSVMAllocARM(cl_context /* context */,
+ cl_svm_mem_flags_arm /* flags */,
+ size_t /* size */,
+ cl_uint /* alignment */) CL_EXT_SUFFIX__VERSION_1_2;
+
+extern CL_API_ENTRY void CL_API_CALL
+clSVMFreeARM(cl_context /* context */,
+ void * /* svm_pointer */) CL_EXT_SUFFIX__VERSION_1_2;
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clEnqueueSVMFreeARM(cl_command_queue /* command_queue */,
+ cl_uint /* num_svm_pointers */,
+ void *[] /* svm_pointers[] */,
+ void (CL_CALLBACK * /*pfn_free_func*/)(cl_command_queue /* queue */,
+ cl_uint /* num_svm_pointers */,
+ void *[] /* svm_pointers[] */,
+ void * /* user_data */),
+ void * /* user_data */,
+ cl_uint /* num_events_in_wait_list */,
+ const cl_event * /* event_wait_list */,
+ cl_event * /* event */) CL_EXT_SUFFIX__VERSION_1_2;
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clEnqueueSVMMemcpyARM(cl_command_queue /* command_queue */,
+ cl_bool /* blocking_copy */,
+ 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 */) CL_EXT_SUFFIX__VERSION_1_2;
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clEnqueueSVMMemFillARM(cl_command_queue /* command_queue */,
+ void * /* svm_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 */) CL_EXT_SUFFIX__VERSION_1_2;
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clEnqueueSVMMapARM(cl_command_queue /* command_queue */,
+ cl_bool /* blocking_map */,
+ cl_map_flags /* flags */,
+ void * /* svm_ptr */,
+ size_t /* size */,
+ cl_uint /* num_events_in_wait_list */,
+ const cl_event * /* event_wait_list */,
+ cl_event * /* event */) CL_EXT_SUFFIX__VERSION_1_2;
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clEnqueueSVMUnmapARM(cl_command_queue /* command_queue */,
+ void * /* svm_ptr */,
+ cl_uint /* num_events_in_wait_list */,
+ const cl_event * /* event_wait_list */,
+ cl_event * /* event */) CL_EXT_SUFFIX__VERSION_1_2;
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clSetKernelArgSVMPointerARM(cl_kernel /* kernel */,
+ cl_uint /* arg_index */,
+ const void * /* arg_value */) CL_EXT_SUFFIX__VERSION_1_2;
+extern CL_API_ENTRY cl_int CL_API_CALL
+clSetKernelExecInfoARM(cl_kernel /* kernel */,
+ cl_kernel_exec_info_arm /* param_name */,
+ size_t /* param_value_size */,
+ const void * /* param_value */) CL_EXT_SUFFIX__VERSION_1_2;
#endif /* CL_VERSION_1_2 */
diff --git a/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_gl.h b/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_gl.h
index af2036cc99..945daa83d7 100644
--- a/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_gl.h
+++ b/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_gl.h
@@ -1,5 +1,5 @@
/**********************************************************************************
- * Copyright (c) 2008 - 2012 The Khronos Group Inc.
+ * Copyright (c) 2008-2015 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
@@ -12,6 +12,11 @@
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
+ * 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.
@@ -104,7 +109,7 @@ clEnqueueReleaseGLObjects(cl_command_queue /* command_queue */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
-// Deprecated OpenCL 1.1 APIs
+/* Deprecated OpenCL 1.1 APIs */
extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
clCreateFromGLTexture2D(cl_context /* context */,
cl_mem_flags /* flags */,
diff --git a/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_gl_ext.h b/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_gl_ext.h
index eafab15cf1..e3c14c6408 100644
--- a/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_gl_ext.h
+++ b/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_gl_ext.h
@@ -1,5 +1,5 @@
/**********************************************************************************
- * Copyright (c) 2008-2012 The Khronos Group Inc.
+ * Copyright (c) 2008-2015 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
@@ -12,6 +12,11 @@
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
+ * 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.
@@ -21,7 +26,7 @@
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
**********************************************************************************/
-/* $Revision: 14826 $ on $Date: 2011-05-26 07:40:43 -0700 (Thu, 26 May 2011) $ */
+/* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */
/* cl_gl_ext.h contains vendor (non-KHR) OpenCL extensions which have */
/* OpenGL dependencies. */
diff --git a/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_platform.h b/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_platform.h
index e39ad9282a..19c54340c6 100644
--- a/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_platform.h
+++ b/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_platform.h
@@ -1,5 +1,5 @@
/**********************************************************************************
- * Copyright (c) 2008-2012 The Khronos Group Inc.
+ * Copyright (c) 2008-2015 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
@@ -12,6 +12,11 @@
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
+ * 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.
@@ -21,7 +26,7 @@
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
**********************************************************************************/
-/* $Revision: 14829 $ on $Date: 2011-05-26 08:22:50 -0700 (Thu, 26 May 2011) $ */
+/* $Revision: 11803 $ on $Date: 2010-06-25 10:02:12 -0700 (Fri, 25 Jun 2010) $ */
#ifndef __CL_PLATFORM_H
#define __CL_PLATFORM_H
@@ -31,17 +36,11 @@
#include
#endif
-#if !defined(_WIN32) || !defined(_MSC_VER)
-# include
-#endif /* !_WIN32 */
-#include
-#include
-
#ifdef __cplusplus
extern "C" {
#endif
-#if defined(_WIN32) || defined(__CYGWIN__)
+#if defined(_WIN32)
#define CL_API_ENTRY
#define CL_API_CALL __stdcall
#define CL_CALLBACK __stdcall
@@ -98,7 +97,7 @@ extern "C" {
#define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED __attribute__((deprecated))
#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
#endif
- #elif _WIN32
+ #elif defined(_WIN32)
#ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS
#define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED
#define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED
@@ -136,21 +135,10 @@ typedef signed __int64 cl_long;
typedef unsigned __int64 cl_ulong;
typedef unsigned __int16 cl_half;
-#else /* !_WIN32 */
-typedef int8_t cl_char;
-typedef uint8_t cl_uchar;
-typedef int16_t cl_short;
-typedef uint16_t cl_ushort;
-typedef int32_t cl_int;
-typedef uint32_t cl_uint;
-typedef int64_t cl_long;
-typedef uint64_t cl_ulong;
-
-typedef uint16_t cl_half;
-#endif /* !_WIN32 */
typedef float cl_float;
typedef double cl_double;
+/* Macro names and corresponding values defined by OpenCL */
#define CL_CHAR_BIT 8
#define CL_SCHAR_MAX 127
#define CL_SCHAR_MIN (-127-1)
@@ -174,9 +162,20 @@ typedef double cl_double;
#define CL_FLT_MIN_10_EXP -37
#define CL_FLT_MIN_EXP -125
#define CL_FLT_RADIX 2
-#define CL_FLT_MAX FLT_MAX
-#define CL_FLT_MIN FLT_MIN
-#define CL_FLT_EPSILON FLT_EPSILON
+#define CL_FLT_MAX 340282346638528859811704183484516925440.0f
+#define CL_FLT_MIN 1.175494350822287507969e-38f
+#define CL_FLT_EPSILON 1.1920928955078125e-7f
+
+#define CL_HALF_DIG 3
+#define CL_HALF_MANT_DIG 11
+#define CL_HALF_MAX_10_EXP +4
+#define CL_HALF_MAX_EXP +16
+#define CL_HALF_MIN_10_EXP -4
+#define CL_HALF_MIN_EXP -13
+#define CL_HALF_RADIX 2
+#define CL_HALF_MAX 65504.0f
+#define CL_HALF_MIN 6.103515625e-05f
+#define CL_HALF_EPSILON 9.765625e-04f
#define CL_DBL_DIG 15
#define CL_DBL_MANT_DIG 53
@@ -185,37 +184,37 @@ typedef double cl_double;
#define CL_DBL_MIN_10_EXP -307
#define CL_DBL_MIN_EXP -1021
#define CL_DBL_RADIX 2
-#define CL_DBL_MAX DBL_MAX
-#define CL_DBL_MIN DBL_MIN
-#define CL_DBL_EPSILON DBL_EPSILON
+#define CL_DBL_MAX 1.7976931348623158e+308
+#define CL_DBL_MIN 2.225073858507201383090e-308
+#define CL_DBL_EPSILON 2.220446049250313080847e-16
-#define CL_M_E 2.718281828459045090796
-#define CL_M_LOG2E 1.442695040888963387005
-#define CL_M_LOG10E 0.434294481903251816668
-#define CL_M_LN2 0.693147180559945286227
-#define CL_M_LN10 2.302585092994045901094
-#define CL_M_PI 3.141592653589793115998
-#define CL_M_PI_2 1.570796326794896557999
-#define CL_M_PI_4 0.785398163397448278999
-#define CL_M_1_PI 0.318309886183790691216
-#define CL_M_2_PI 0.636619772367581382433
-#define CL_M_2_SQRTPI 1.128379167095512558561
-#define CL_M_SQRT2 1.414213562373095145475
-#define CL_M_SQRT1_2 0.707106781186547572737
+#define CL_M_E 2.7182818284590452354
+#define CL_M_LOG2E 1.4426950408889634074
+#define CL_M_LOG10E 0.43429448190325182765
+#define CL_M_LN2 0.69314718055994530942
+#define CL_M_LN10 2.30258509299404568402
+#define CL_M_PI 3.14159265358979323846
+#define CL_M_PI_2 1.57079632679489661923
+#define CL_M_PI_4 0.78539816339744830962
+#define CL_M_1_PI 0.31830988618379067154
+#define CL_M_2_PI 0.63661977236758134308
+#define CL_M_2_SQRTPI 1.12837916709551257390
+#define CL_M_SQRT2 1.41421356237309504880
+#define CL_M_SQRT1_2 0.70710678118654752440
-#define CL_M_E_F 2.71828174591064f
-#define CL_M_LOG2E_F 1.44269502162933f
-#define CL_M_LOG10E_F 0.43429449200630f
-#define CL_M_LN2_F 0.69314718246460f
-#define CL_M_LN10_F 2.30258512496948f
-#define CL_M_PI_F 3.14159274101257f
-#define CL_M_PI_2_F 1.57079637050629f
-#define CL_M_PI_4_F 0.78539818525314f
-#define CL_M_1_PI_F 0.31830987334251f
-#define CL_M_2_PI_F 0.63661974668503f
-#define CL_M_2_SQRTPI_F 1.12837922573090f
-#define CL_M_SQRT2_F 1.41421353816986f
-#define CL_M_SQRT1_2_F 0.70710676908493f
+#define CL_M_E_F 2.718281828f
+#define CL_M_LOG2E_F 1.442695041f
+#define CL_M_LOG10E_F 0.434294482f
+#define CL_M_LN2_F 0.693147181f
+#define CL_M_LN10_F 2.302585093f
+#define CL_M_PI_F 3.141592654f
+#define CL_M_PI_2_F 1.570796327f
+#define CL_M_PI_4_F 0.785398163f
+#define CL_M_1_PI_F 0.318309886f
+#define CL_M_2_PI_F 0.636619772f
+#define CL_M_2_SQRTPI_F 1.128379167f
+#define CL_M_SQRT2_F 1.414213562f
+#define CL_M_SQRT1_2_F 0.707106781f
#define CL_NAN (CL_INFINITY - CL_INFINITY)
#define CL_HUGE_VALF ((cl_float) 1e50)
@@ -223,6 +222,117 @@ typedef double cl_double;
#define CL_MAXFLOAT CL_FLT_MAX
#define CL_INFINITY CL_HUGE_VALF
+#else
+
+#include
+
+/* scalar types */
+typedef int8_t cl_char;
+typedef uint8_t cl_uchar;
+typedef int16_t cl_short __attribute__((aligned(2)));
+typedef uint16_t cl_ushort __attribute__((aligned(2)));
+typedef int32_t cl_int __attribute__((aligned(4)));
+typedef uint32_t cl_uint __attribute__((aligned(4)));
+typedef int64_t cl_long __attribute__((aligned(8)));
+typedef uint64_t cl_ulong __attribute__((aligned(8)));
+
+typedef uint16_t cl_half __attribute__((aligned(2)));
+typedef float cl_float __attribute__((aligned(4)));
+typedef double cl_double __attribute__((aligned(8)));
+
+/* Macro names and corresponding values defined by OpenCL */
+#define CL_CHAR_BIT 8
+#define CL_SCHAR_MAX 127
+#define CL_SCHAR_MIN (-127-1)
+#define CL_CHAR_MAX CL_SCHAR_MAX
+#define CL_CHAR_MIN CL_SCHAR_MIN
+#define CL_UCHAR_MAX 255
+#define CL_SHRT_MAX 32767
+#define CL_SHRT_MIN (-32767-1)
+#define CL_USHRT_MAX 65535
+#define CL_INT_MAX 2147483647
+#define CL_INT_MIN (-2147483647-1)
+#define CL_UINT_MAX 0xffffffffU
+#define CL_LONG_MAX ((cl_long) 0x7FFFFFFFFFFFFFFFLL)
+#define CL_LONG_MIN ((cl_long) -0x7FFFFFFFFFFFFFFFLL - 1LL)
+#define CL_ULONG_MAX ((cl_ulong) 0xFFFFFFFFFFFFFFFFULL)
+
+#define CL_FLT_DIG 6
+#define CL_FLT_MANT_DIG 24
+#define CL_FLT_MAX_10_EXP +38
+#define CL_FLT_MAX_EXP +128
+#define CL_FLT_MIN_10_EXP -37
+#define CL_FLT_MIN_EXP -125
+#define CL_FLT_RADIX 2
+#define CL_FLT_MAX 340282346638528859811704183484516925440.0f
+#define CL_FLT_MIN 1.175494350822287507969e-38f
+#define CL_FLT_EPSILON 1.1920928955078125e-7f
+
+#define CL_HALF_DIG 3
+#define CL_HALF_MANT_DIG 11
+#define CL_HALF_MAX_10_EXP +4
+#define CL_HALF_MAX_EXP +16
+#define CL_HALF_MIN_10_EXP -4
+#define CL_HALF_MIN_EXP -13
+#define CL_HALF_RADIX 2
+#define CL_HALF_MAX 65504.0f
+#define CL_HALF_MIN 6.103515625e-05f
+#define CL_HALF_EPSILON 9.765625e-04f
+
+#define CL_DBL_DIG 15
+#define CL_DBL_MANT_DIG 53
+#define CL_DBL_MAX_10_EXP +308
+#define CL_DBL_MAX_EXP +1024
+#define CL_DBL_MIN_10_EXP -307
+#define CL_DBL_MIN_EXP -1021
+#define CL_DBL_RADIX 2
+#define CL_DBL_MAX 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0
+#define CL_DBL_MIN 2.225073858507201383090e-308
+#define CL_DBL_EPSILON 2.220446049250313080847e-16
+
+#define CL_M_E 2.7182818284590452354
+#define CL_M_LOG2E 1.4426950408889634074
+#define CL_M_LOG10E 0.43429448190325182765
+#define CL_M_LN2 0.69314718055994530942
+#define CL_M_LN10 2.30258509299404568402
+#define CL_M_PI 3.14159265358979323846
+#define CL_M_PI_2 1.57079632679489661923
+#define CL_M_PI_4 0.78539816339744830962
+#define CL_M_1_PI 0.31830988618379067154
+#define CL_M_2_PI 0.63661977236758134308
+#define CL_M_2_SQRTPI 1.12837916709551257390
+#define CL_M_SQRT2 1.41421356237309504880
+#define CL_M_SQRT1_2 0.70710678118654752440
+
+#define CL_M_E_F 2.718281828f
+#define CL_M_LOG2E_F 1.442695041f
+#define CL_M_LOG10E_F 0.434294482f
+#define CL_M_LN2_F 0.693147181f
+#define CL_M_LN10_F 2.302585093f
+#define CL_M_PI_F 3.141592654f
+#define CL_M_PI_2_F 1.570796327f
+#define CL_M_PI_4_F 0.785398163f
+#define CL_M_1_PI_F 0.318309886f
+#define CL_M_2_PI_F 0.636619772f
+#define CL_M_2_SQRTPI_F 1.128379167f
+#define CL_M_SQRT2_F 1.414213562f
+#define CL_M_SQRT1_2_F 0.707106781f
+
+#if defined( __GNUC__ )
+ #define CL_HUGE_VALF __builtin_huge_valf()
+ #define CL_HUGE_VAL __builtin_huge_val()
+ #define CL_NAN __builtin_nanf( "" )
+#else
+ #define CL_HUGE_VALF ((cl_float) 1e50)
+ #define CL_HUGE_VAL ((cl_double) 1e500)
+ float nanf( const char * );
+ #define CL_NAN nanf( "" )
+#endif
+#define CL_MAXFLOAT CL_FLT_MAX
+#define CL_INFINITY CL_HUGE_VALF
+
+#endif
+
#include
/* Mirror types to GL types. Mirror types allow us to avoid deciding which 87s to load based on whether we are using GL or GLES here. */
@@ -271,7 +381,7 @@ typedef unsigned int cl_GLenum;
#else
#include
#endif
- #if defined( __GNUC__ ) && !defined( __ICC )
+ #if defined( __GNUC__ )
typedef float __cl_float4 __attribute__((vector_size(16)));
#else
typedef __m128 __cl_float4;
@@ -285,7 +395,7 @@ typedef unsigned int cl_GLenum;
#else
#include
#endif
- #if defined( __GNUC__ ) && !defined( __ICC )
+ #if defined( __GNUC__ )
typedef cl_uchar __cl_uchar16 __attribute__((vector_size(16)));
typedef cl_char __cl_char16 __attribute__((vector_size(16)));
typedef cl_ushort __cl_ushort8 __attribute__((vector_size(16)));
@@ -319,7 +429,7 @@ typedef unsigned int cl_GLenum;
#if defined( __MMX__ )
#include
- #if defined( __GNUC__ ) && !defined( __ICC )
+ #if defined( __GNUC__ )
typedef cl_uchar __cl_uchar8 __attribute__((vector_size(8)));
typedef cl_char __cl_char8 __attribute__((vector_size(8)));
typedef cl_ushort __cl_ushort4 __attribute__((vector_size(8)));
@@ -357,7 +467,7 @@ typedef unsigned int cl_GLenum;
#else
#include
#endif
- #if defined( __GNUC__ ) && !defined( __ICC )
+ #if defined( __GNUC__ )
typedef cl_float __cl_float8 __attribute__((vector_size(32)));
typedef cl_double __cl_double4 __attribute__((vector_size(32)));
#else
@@ -368,8 +478,31 @@ typedef unsigned int cl_GLenum;
#define __CL_DOUBLE4__ 1
#endif
+/* Define capabilities for anonymous struct members. */
+#if !defined(__cplusplus) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
+#define __CL_HAS_ANON_STRUCT__ 1
+#define __CL_ANON_STRUCT__
+#elif defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
+#define __CL_HAS_ANON_STRUCT__ 1
+#define __CL_ANON_STRUCT__ __extension__
+#elif defined( _WIN32) && defined(_MSC_VER)
+ #if _MSC_VER >= 1500
+ /* Microsoft Developer Studio 2008 supports anonymous structs, but
+ * complains by default. */
+ #define __CL_HAS_ANON_STRUCT__ 1
+ #define __CL_ANON_STRUCT__
+ /* Disable warning C4201: nonstandard extension used : nameless
+ * struct/union */
+ #pragma warning( push )
+ #pragma warning( disable : 4201 )
+ #endif
+#else
+#define __CL_HAS_ANON_STRUCT__ 0
+#define __CL_ANON_STRUCT__
+#endif
+
/* Define alignment keys */
-#if (defined( __GNUC__ ) || defined( __IBMC__ ))
+#if defined( __GNUC__ )
#define CL_ALIGNED(_x) __attribute__ ((aligned(_x)))
#elif defined( _WIN32) && (_MSC_VER)
/* Alignment keys neutered on windows because MSVC can't swallow function arguments with alignment requirements */
@@ -383,7 +516,7 @@ typedef unsigned int cl_GLenum;
#endif
/* Indicate whether .xyzw, .s0123 and .hi.lo are supported */
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
+#if __CL_HAS_ANON_STRUCT__
/* .xyzw and .s0123...{f|F} are supported */
#define CL_HAS_NAMED_VECTOR_FIELDS 1
/* .hi and .lo are supported */
@@ -396,10 +529,10 @@ typedef unsigned int cl_GLenum;
typedef union
{
cl_char CL_ALIGNED(2) s[2];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_char x, y; };
- __extension__ struct{ cl_char s0, s1; };
- __extension__ struct{ cl_char lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_char x, y; };
+ __CL_ANON_STRUCT__ struct{ cl_char s0, s1; };
+ __CL_ANON_STRUCT__ struct{ cl_char lo, hi; };
#endif
#if defined( __CL_CHAR2__)
__cl_char2 v2;
@@ -409,10 +542,10 @@ typedef union
typedef union
{
cl_char CL_ALIGNED(4) s[4];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_char x, y, z, w; };
- __extension__ struct{ cl_char s0, s1, s2, s3; };
- __extension__ struct{ cl_char2 lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_char x, y, z, w; };
+ __CL_ANON_STRUCT__ struct{ cl_char s0, s1, s2, s3; };
+ __CL_ANON_STRUCT__ struct{ cl_char2 lo, hi; };
#endif
#if defined( __CL_CHAR2__)
__cl_char2 v2[2];
@@ -428,10 +561,10 @@ typedef cl_char4 cl_char3;
typedef union
{
cl_char CL_ALIGNED(8) s[8];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_char x, y, z, w; };
- __extension__ struct{ cl_char s0, s1, s2, s3, s4, s5, s6, s7; };
- __extension__ struct{ cl_char4 lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_char x, y, z, w; };
+ __CL_ANON_STRUCT__ struct{ cl_char s0, s1, s2, s3, s4, s5, s6, s7; };
+ __CL_ANON_STRUCT__ struct{ cl_char4 lo, hi; };
#endif
#if defined( __CL_CHAR2__)
__cl_char2 v2[4];
@@ -447,10 +580,10 @@ typedef union
typedef union
{
cl_char CL_ALIGNED(16) s[16];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_char x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
- __extension__ struct{ cl_char s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
- __extension__ struct{ cl_char8 lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_char x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
+ __CL_ANON_STRUCT__ struct{ cl_char s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
+ __CL_ANON_STRUCT__ struct{ cl_char8 lo, hi; };
#endif
#if defined( __CL_CHAR2__)
__cl_char2 v2[8];
@@ -471,10 +604,10 @@ typedef union
typedef union
{
cl_uchar CL_ALIGNED(2) s[2];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_uchar x, y; };
- __extension__ struct{ cl_uchar s0, s1; };
- __extension__ struct{ cl_uchar lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_uchar x, y; };
+ __CL_ANON_STRUCT__ struct{ cl_uchar s0, s1; };
+ __CL_ANON_STRUCT__ struct{ cl_uchar lo, hi; };
#endif
#if defined( __cl_uchar2__)
__cl_uchar2 v2;
@@ -484,10 +617,10 @@ typedef union
typedef union
{
cl_uchar CL_ALIGNED(4) s[4];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_uchar x, y, z, w; };
- __extension__ struct{ cl_uchar s0, s1, s2, s3; };
- __extension__ struct{ cl_uchar2 lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_uchar x, y, z, w; };
+ __CL_ANON_STRUCT__ struct{ cl_uchar s0, s1, s2, s3; };
+ __CL_ANON_STRUCT__ struct{ cl_uchar2 lo, hi; };
#endif
#if defined( __CL_UCHAR2__)
__cl_uchar2 v2[2];
@@ -503,10 +636,10 @@ typedef cl_uchar4 cl_uchar3;
typedef union
{
cl_uchar CL_ALIGNED(8) s[8];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_uchar x, y, z, w; };
- __extension__ struct{ cl_uchar s0, s1, s2, s3, s4, s5, s6, s7; };
- __extension__ struct{ cl_uchar4 lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_uchar x, y, z, w; };
+ __CL_ANON_STRUCT__ struct{ cl_uchar s0, s1, s2, s3, s4, s5, s6, s7; };
+ __CL_ANON_STRUCT__ struct{ cl_uchar4 lo, hi; };
#endif
#if defined( __CL_UCHAR2__)
__cl_uchar2 v2[4];
@@ -522,10 +655,10 @@ typedef union
typedef union
{
cl_uchar CL_ALIGNED(16) s[16];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_uchar x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
- __extension__ struct{ cl_uchar s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
- __extension__ struct{ cl_uchar8 lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_uchar x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
+ __CL_ANON_STRUCT__ struct{ cl_uchar s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
+ __CL_ANON_STRUCT__ struct{ cl_uchar8 lo, hi; };
#endif
#if defined( __CL_UCHAR2__)
__cl_uchar2 v2[8];
@@ -546,10 +679,10 @@ typedef union
typedef union
{
cl_short CL_ALIGNED(4) s[2];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_short x, y; };
- __extension__ struct{ cl_short s0, s1; };
- __extension__ struct{ cl_short lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_short x, y; };
+ __CL_ANON_STRUCT__ struct{ cl_short s0, s1; };
+ __CL_ANON_STRUCT__ struct{ cl_short lo, hi; };
#endif
#if defined( __CL_SHORT2__)
__cl_short2 v2;
@@ -559,10 +692,10 @@ typedef union
typedef union
{
cl_short CL_ALIGNED(8) s[4];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_short x, y, z, w; };
- __extension__ struct{ cl_short s0, s1, s2, s3; };
- __extension__ struct{ cl_short2 lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_short x, y, z, w; };
+ __CL_ANON_STRUCT__ struct{ cl_short s0, s1, s2, s3; };
+ __CL_ANON_STRUCT__ struct{ cl_short2 lo, hi; };
#endif
#if defined( __CL_SHORT2__)
__cl_short2 v2[2];
@@ -578,10 +711,10 @@ typedef cl_short4 cl_short3;
typedef union
{
cl_short CL_ALIGNED(16) s[8];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_short x, y, z, w; };
- __extension__ struct{ cl_short s0, s1, s2, s3, s4, s5, s6, s7; };
- __extension__ struct{ cl_short4 lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_short x, y, z, w; };
+ __CL_ANON_STRUCT__ struct{ cl_short s0, s1, s2, s3, s4, s5, s6, s7; };
+ __CL_ANON_STRUCT__ struct{ cl_short4 lo, hi; };
#endif
#if defined( __CL_SHORT2__)
__cl_short2 v2[4];
@@ -597,10 +730,10 @@ typedef union
typedef union
{
cl_short CL_ALIGNED(32) s[16];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_short x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
- __extension__ struct{ cl_short s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
- __extension__ struct{ cl_short8 lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_short x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
+ __CL_ANON_STRUCT__ struct{ cl_short s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
+ __CL_ANON_STRUCT__ struct{ cl_short8 lo, hi; };
#endif
#if defined( __CL_SHORT2__)
__cl_short2 v2[8];
@@ -621,10 +754,10 @@ typedef union
typedef union
{
cl_ushort CL_ALIGNED(4) s[2];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_ushort x, y; };
- __extension__ struct{ cl_ushort s0, s1; };
- __extension__ struct{ cl_ushort lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_ushort x, y; };
+ __CL_ANON_STRUCT__ struct{ cl_ushort s0, s1; };
+ __CL_ANON_STRUCT__ struct{ cl_ushort lo, hi; };
#endif
#if defined( __CL_USHORT2__)
__cl_ushort2 v2;
@@ -634,10 +767,10 @@ typedef union
typedef union
{
cl_ushort CL_ALIGNED(8) s[4];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_ushort x, y, z, w; };
- __extension__ struct{ cl_ushort s0, s1, s2, s3; };
- __extension__ struct{ cl_ushort2 lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_ushort x, y, z, w; };
+ __CL_ANON_STRUCT__ struct{ cl_ushort s0, s1, s2, s3; };
+ __CL_ANON_STRUCT__ struct{ cl_ushort2 lo, hi; };
#endif
#if defined( __CL_USHORT2__)
__cl_ushort2 v2[2];
@@ -653,10 +786,10 @@ typedef cl_ushort4 cl_ushort3;
typedef union
{
cl_ushort CL_ALIGNED(16) s[8];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_ushort x, y, z, w; };
- __extension__ struct{ cl_ushort s0, s1, s2, s3, s4, s5, s6, s7; };
- __extension__ struct{ cl_ushort4 lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_ushort x, y, z, w; };
+ __CL_ANON_STRUCT__ struct{ cl_ushort s0, s1, s2, s3, s4, s5, s6, s7; };
+ __CL_ANON_STRUCT__ struct{ cl_ushort4 lo, hi; };
#endif
#if defined( __CL_USHORT2__)
__cl_ushort2 v2[4];
@@ -672,10 +805,10 @@ typedef union
typedef union
{
cl_ushort CL_ALIGNED(32) s[16];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_ushort x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
- __extension__ struct{ cl_ushort s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
- __extension__ struct{ cl_ushort8 lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_ushort x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
+ __CL_ANON_STRUCT__ struct{ cl_ushort s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
+ __CL_ANON_STRUCT__ struct{ cl_ushort8 lo, hi; };
#endif
#if defined( __CL_USHORT2__)
__cl_ushort2 v2[8];
@@ -691,14 +824,89 @@ typedef union
#endif
}cl_ushort16;
+
+/* ---- cl_halfn ---- */
+typedef union
+{
+ cl_half CL_ALIGNED(4) s[2];
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_half x, y; };
+ __CL_ANON_STRUCT__ struct{ cl_half s0, s1; };
+ __CL_ANON_STRUCT__ struct{ cl_half lo, hi; };
+#endif
+#if defined( __CL_HALF2__)
+ __cl_half2 v2;
+#endif
+}cl_half2;
+
+typedef union
+{
+ cl_half CL_ALIGNED(8) s[4];
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_half x, y, z, w; };
+ __CL_ANON_STRUCT__ struct{ cl_half s0, s1, s2, s3; };
+ __CL_ANON_STRUCT__ struct{ cl_half2 lo, hi; };
+#endif
+#if defined( __CL_HALF2__)
+ __cl_half2 v2[2];
+#endif
+#if defined( __CL_HALF4__)
+ __cl_half4 v4;
+#endif
+}cl_half4;
+
+/* cl_half3 is identical in size, alignment and behavior to cl_half4. See section 6.1.5. */
+typedef cl_half4 cl_half3;
+
+typedef union
+{
+ cl_half CL_ALIGNED(16) s[8];
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_half x, y, z, w; };
+ __CL_ANON_STRUCT__ struct{ cl_half s0, s1, s2, s3, s4, s5, s6, s7; };
+ __CL_ANON_STRUCT__ struct{ cl_half4 lo, hi; };
+#endif
+#if defined( __CL_HALF2__)
+ __cl_half2 v2[4];
+#endif
+#if defined( __CL_HALF4__)
+ __cl_half4 v4[2];
+#endif
+#if defined( __CL_HALF8__ )
+ __cl_half8 v8;
+#endif
+}cl_half8;
+
+typedef union
+{
+ cl_half CL_ALIGNED(32) s[16];
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_half x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
+ __CL_ANON_STRUCT__ struct{ cl_half s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
+ __CL_ANON_STRUCT__ struct{ cl_half8 lo, hi; };
+#endif
+#if defined( __CL_HALF2__)
+ __cl_half2 v2[8];
+#endif
+#if defined( __CL_HALF4__)
+ __cl_half4 v4[4];
+#endif
+#if defined( __CL_HALF8__ )
+ __cl_half8 v8[2];
+#endif
+#if defined( __CL_HALF16__ )
+ __cl_half16 v16;
+#endif
+}cl_half16;
+
/* ---- cl_intn ---- */
typedef union
{
cl_int CL_ALIGNED(8) s[2];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_int x, y; };
- __extension__ struct{ cl_int s0, s1; };
- __extension__ struct{ cl_int lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_int x, y; };
+ __CL_ANON_STRUCT__ struct{ cl_int s0, s1; };
+ __CL_ANON_STRUCT__ struct{ cl_int lo, hi; };
#endif
#if defined( __CL_INT2__)
__cl_int2 v2;
@@ -708,10 +916,10 @@ typedef union
typedef union
{
cl_int CL_ALIGNED(16) s[4];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_int x, y, z, w; };
- __extension__ struct{ cl_int s0, s1, s2, s3; };
- __extension__ struct{ cl_int2 lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_int x, y, z, w; };
+ __CL_ANON_STRUCT__ struct{ cl_int s0, s1, s2, s3; };
+ __CL_ANON_STRUCT__ struct{ cl_int2 lo, hi; };
#endif
#if defined( __CL_INT2__)
__cl_int2 v2[2];
@@ -727,10 +935,10 @@ typedef cl_int4 cl_int3;
typedef union
{
cl_int CL_ALIGNED(32) s[8];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_int x, y, z, w; };
- __extension__ struct{ cl_int s0, s1, s2, s3, s4, s5, s6, s7; };
- __extension__ struct{ cl_int4 lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_int x, y, z, w; };
+ __CL_ANON_STRUCT__ struct{ cl_int s0, s1, s2, s3, s4, s5, s6, s7; };
+ __CL_ANON_STRUCT__ struct{ cl_int4 lo, hi; };
#endif
#if defined( __CL_INT2__)
__cl_int2 v2[4];
@@ -746,10 +954,10 @@ typedef union
typedef union
{
cl_int CL_ALIGNED(64) s[16];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_int x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
- __extension__ struct{ cl_int s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
- __extension__ struct{ cl_int8 lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_int x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
+ __CL_ANON_STRUCT__ struct{ cl_int s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
+ __CL_ANON_STRUCT__ struct{ cl_int8 lo, hi; };
#endif
#if defined( __CL_INT2__)
__cl_int2 v2[8];
@@ -770,10 +978,10 @@ typedef union
typedef union
{
cl_uint CL_ALIGNED(8) s[2];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_uint x, y; };
- __extension__ struct{ cl_uint s0, s1; };
- __extension__ struct{ cl_uint lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_uint x, y; };
+ __CL_ANON_STRUCT__ struct{ cl_uint s0, s1; };
+ __CL_ANON_STRUCT__ struct{ cl_uint lo, hi; };
#endif
#if defined( __CL_UINT2__)
__cl_uint2 v2;
@@ -783,10 +991,10 @@ typedef union
typedef union
{
cl_uint CL_ALIGNED(16) s[4];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_uint x, y, z, w; };
- __extension__ struct{ cl_uint s0, s1, s2, s3; };
- __extension__ struct{ cl_uint2 lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_uint x, y, z, w; };
+ __CL_ANON_STRUCT__ struct{ cl_uint s0, s1, s2, s3; };
+ __CL_ANON_STRUCT__ struct{ cl_uint2 lo, hi; };
#endif
#if defined( __CL_UINT2__)
__cl_uint2 v2[2];
@@ -802,10 +1010,10 @@ typedef cl_uint4 cl_uint3;
typedef union
{
cl_uint CL_ALIGNED(32) s[8];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_uint x, y, z, w; };
- __extension__ struct{ cl_uint s0, s1, s2, s3, s4, s5, s6, s7; };
- __extension__ struct{ cl_uint4 lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_uint x, y, z, w; };
+ __CL_ANON_STRUCT__ struct{ cl_uint s0, s1, s2, s3, s4, s5, s6, s7; };
+ __CL_ANON_STRUCT__ struct{ cl_uint4 lo, hi; };
#endif
#if defined( __CL_UINT2__)
__cl_uint2 v2[4];
@@ -821,10 +1029,10 @@ typedef union
typedef union
{
cl_uint CL_ALIGNED(64) s[16];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_uint x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
- __extension__ struct{ cl_uint s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
- __extension__ struct{ cl_uint8 lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_uint x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
+ __CL_ANON_STRUCT__ struct{ cl_uint s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
+ __CL_ANON_STRUCT__ struct{ cl_uint8 lo, hi; };
#endif
#if defined( __CL_UINT2__)
__cl_uint2 v2[8];
@@ -844,10 +1052,10 @@ typedef union
typedef union
{
cl_long CL_ALIGNED(16) s[2];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_long x, y; };
- __extension__ struct{ cl_long s0, s1; };
- __extension__ struct{ cl_long lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_long x, y; };
+ __CL_ANON_STRUCT__ struct{ cl_long s0, s1; };
+ __CL_ANON_STRUCT__ struct{ cl_long lo, hi; };
#endif
#if defined( __CL_LONG2__)
__cl_long2 v2;
@@ -857,10 +1065,10 @@ typedef union
typedef union
{
cl_long CL_ALIGNED(32) s[4];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_long x, y, z, w; };
- __extension__ struct{ cl_long s0, s1, s2, s3; };
- __extension__ struct{ cl_long2 lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_long x, y, z, w; };
+ __CL_ANON_STRUCT__ struct{ cl_long s0, s1, s2, s3; };
+ __CL_ANON_STRUCT__ struct{ cl_long2 lo, hi; };
#endif
#if defined( __CL_LONG2__)
__cl_long2 v2[2];
@@ -876,10 +1084,10 @@ typedef cl_long4 cl_long3;
typedef union
{
cl_long CL_ALIGNED(64) s[8];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_long x, y, z, w; };
- __extension__ struct{ cl_long s0, s1, s2, s3, s4, s5, s6, s7; };
- __extension__ struct{ cl_long4 lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_long x, y, z, w; };
+ __CL_ANON_STRUCT__ struct{ cl_long s0, s1, s2, s3, s4, s5, s6, s7; };
+ __CL_ANON_STRUCT__ struct{ cl_long4 lo, hi; };
#endif
#if defined( __CL_LONG2__)
__cl_long2 v2[4];
@@ -895,10 +1103,10 @@ typedef union
typedef union
{
cl_long CL_ALIGNED(128) s[16];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_long x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
- __extension__ struct{ cl_long s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
- __extension__ struct{ cl_long8 lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_long x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
+ __CL_ANON_STRUCT__ struct{ cl_long s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
+ __CL_ANON_STRUCT__ struct{ cl_long8 lo, hi; };
#endif
#if defined( __CL_LONG2__)
__cl_long2 v2[8];
@@ -919,10 +1127,10 @@ typedef union
typedef union
{
cl_ulong CL_ALIGNED(16) s[2];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_ulong x, y; };
- __extension__ struct{ cl_ulong s0, s1; };
- __extension__ struct{ cl_ulong lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_ulong x, y; };
+ __CL_ANON_STRUCT__ struct{ cl_ulong s0, s1; };
+ __CL_ANON_STRUCT__ struct{ cl_ulong lo, hi; };
#endif
#if defined( __CL_ULONG2__)
__cl_ulong2 v2;
@@ -932,10 +1140,10 @@ typedef union
typedef union
{
cl_ulong CL_ALIGNED(32) s[4];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_ulong x, y, z, w; };
- __extension__ struct{ cl_ulong s0, s1, s2, s3; };
- __extension__ struct{ cl_ulong2 lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_ulong x, y, z, w; };
+ __CL_ANON_STRUCT__ struct{ cl_ulong s0, s1, s2, s3; };
+ __CL_ANON_STRUCT__ struct{ cl_ulong2 lo, hi; };
#endif
#if defined( __CL_ULONG2__)
__cl_ulong2 v2[2];
@@ -951,10 +1159,10 @@ typedef cl_ulong4 cl_ulong3;
typedef union
{
cl_ulong CL_ALIGNED(64) s[8];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_ulong x, y, z, w; };
- __extension__ struct{ cl_ulong s0, s1, s2, s3, s4, s5, s6, s7; };
- __extension__ struct{ cl_ulong4 lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_ulong x, y, z, w; };
+ __CL_ANON_STRUCT__ struct{ cl_ulong s0, s1, s2, s3, s4, s5, s6, s7; };
+ __CL_ANON_STRUCT__ struct{ cl_ulong4 lo, hi; };
#endif
#if defined( __CL_ULONG2__)
__cl_ulong2 v2[4];
@@ -970,10 +1178,10 @@ typedef union
typedef union
{
cl_ulong CL_ALIGNED(128) s[16];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_ulong x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
- __extension__ struct{ cl_ulong s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
- __extension__ struct{ cl_ulong8 lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_ulong x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
+ __CL_ANON_STRUCT__ struct{ cl_ulong s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
+ __CL_ANON_STRUCT__ struct{ cl_ulong8 lo, hi; };
#endif
#if defined( __CL_ULONG2__)
__cl_ulong2 v2[8];
@@ -995,10 +1203,10 @@ typedef union
typedef union
{
cl_float CL_ALIGNED(8) s[2];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_float x, y; };
- __extension__ struct{ cl_float s0, s1; };
- __extension__ struct{ cl_float lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_float x, y; };
+ __CL_ANON_STRUCT__ struct{ cl_float s0, s1; };
+ __CL_ANON_STRUCT__ struct{ cl_float lo, hi; };
#endif
#if defined( __CL_FLOAT2__)
__cl_float2 v2;
@@ -1008,10 +1216,10 @@ typedef union
typedef union
{
cl_float CL_ALIGNED(16) s[4];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_float x, y, z, w; };
- __extension__ struct{ cl_float s0, s1, s2, s3; };
- __extension__ struct{ cl_float2 lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_float x, y, z, w; };
+ __CL_ANON_STRUCT__ struct{ cl_float s0, s1, s2, s3; };
+ __CL_ANON_STRUCT__ struct{ cl_float2 lo, hi; };
#endif
#if defined( __CL_FLOAT2__)
__cl_float2 v2[2];
@@ -1027,10 +1235,10 @@ typedef cl_float4 cl_float3;
typedef union
{
cl_float CL_ALIGNED(32) s[8];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_float x, y, z, w; };
- __extension__ struct{ cl_float s0, s1, s2, s3, s4, s5, s6, s7; };
- __extension__ struct{ cl_float4 lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_float x, y, z, w; };
+ __CL_ANON_STRUCT__ struct{ cl_float s0, s1, s2, s3, s4, s5, s6, s7; };
+ __CL_ANON_STRUCT__ struct{ cl_float4 lo, hi; };
#endif
#if defined( __CL_FLOAT2__)
__cl_float2 v2[4];
@@ -1046,10 +1254,10 @@ typedef union
typedef union
{
cl_float CL_ALIGNED(64) s[16];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_float x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
- __extension__ struct{ cl_float s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
- __extension__ struct{ cl_float8 lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_float x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
+ __CL_ANON_STRUCT__ struct{ cl_float s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
+ __CL_ANON_STRUCT__ struct{ cl_float8 lo, hi; };
#endif
#if defined( __CL_FLOAT2__)
__cl_float2 v2[8];
@@ -1070,10 +1278,10 @@ typedef union
typedef union
{
cl_double CL_ALIGNED(16) s[2];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_double x, y; };
- __extension__ struct{ cl_double s0, s1; };
- __extension__ struct{ cl_double lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_double x, y; };
+ __CL_ANON_STRUCT__ struct{ cl_double s0, s1; };
+ __CL_ANON_STRUCT__ struct{ cl_double lo, hi; };
#endif
#if defined( __CL_DOUBLE2__)
__cl_double2 v2;
@@ -1083,10 +1291,10 @@ typedef union
typedef union
{
cl_double CL_ALIGNED(32) s[4];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_double x, y, z, w; };
- __extension__ struct{ cl_double s0, s1, s2, s3; };
- __extension__ struct{ cl_double2 lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_double x, y, z, w; };
+ __CL_ANON_STRUCT__ struct{ cl_double s0, s1, s2, s3; };
+ __CL_ANON_STRUCT__ struct{ cl_double2 lo, hi; };
#endif
#if defined( __CL_DOUBLE2__)
__cl_double2 v2[2];
@@ -1102,10 +1310,10 @@ typedef cl_double4 cl_double3;
typedef union
{
cl_double CL_ALIGNED(64) s[8];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_double x, y, z, w; };
- __extension__ struct{ cl_double s0, s1, s2, s3, s4, s5, s6, s7; };
- __extension__ struct{ cl_double4 lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_double x, y, z, w; };
+ __CL_ANON_STRUCT__ struct{ cl_double s0, s1, s2, s3, s4, s5, s6, s7; };
+ __CL_ANON_STRUCT__ struct{ cl_double4 lo, hi; };
#endif
#if defined( __CL_DOUBLE2__)
__cl_double2 v2[4];
@@ -1121,10 +1329,10 @@ typedef union
typedef union
{
cl_double CL_ALIGNED(128) s[16];
-#if (defined( __GNUC__) || defined( __IBMC__ )) && ! defined( __STRICT_ANSI__ )
- __extension__ struct{ cl_double x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
- __extension__ struct{ cl_double s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
- __extension__ struct{ cl_double8 lo, hi; };
+#if __CL_HAS_ANON_STRUCT__
+ __CL_ANON_STRUCT__ struct{ cl_double x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
+ __CL_ANON_STRUCT__ struct{ cl_double s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
+ __CL_ANON_STRUCT__ struct{ cl_double8 lo, hi; };
#endif
#if defined( __CL_DOUBLE2__)
__cl_double2 v2[8];
@@ -1168,4 +1376,12 @@ typedef union
}
#endif
+#undef __CL_HAS_ANON_STRUCT__
+#undef __CL_ANON_STRUCT__
+#if defined( _WIN32) && defined(_MSC_VER)
+ #if _MSC_VER >=1500
+ #pragma warning( pop )
+ #endif
+#endif
+
#endif /* __CL_PLATFORM_H */
diff --git a/opencl/api/opencl/khronos/headers/opencl1.2/CL/opencl.h b/opencl/api/opencl/khronos/headers/opencl1.2/CL/opencl.h
index 3f00524719..9855cd75e7 100644
--- a/opencl/api/opencl/khronos/headers/opencl1.2/CL/opencl.h
+++ b/opencl/api/opencl/khronos/headers/opencl1.2/CL/opencl.h
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008-2012 The Khronos Group Inc.
+ * Copyright (c) 2008-2015 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
@@ -12,6 +12,11 @@
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
+ * 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.
diff --git a/opencl/api/opencl/khronos/headers/opencl1.2/CL/spir.h b/opencl/api/opencl/khronos/headers/opencl1.2/CL/spir.h
deleted file mode 100644
index 5f0dbf6dea..0000000000
--- a/opencl/api/opencl/khronos/headers/opencl1.2/CL/spir.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright (c) 2012 The Khronos Group Inc. All rights reserved.
- *
- * NOTICE TO KHRONOS MEMBER:
- *
- * AMD has assigned the copyright for this object code to Khronos.
- * This object code is subject to Khronos ownership rights under U.S. and
- * international Copyright laws.
- *
- * Permission is hereby granted, free of charge, to any Khronos Member
- * obtaining a copy of this software and/or associated documentation files
- * (the "Materials"), to use, copy, modify and merge the Materials in object
- * form only and to publish, distribute and/or sell copies of the Materials
- * solely in object code form as part of conformant OpenCL API implementations,
- * subject to the following conditions:
- *
- * Khronos Members shall ensure that their respective ICD implementation,
- * that is installed over another Khronos Members' ICD implementation, will
- * continue to support all OpenCL devices (hardware and software) supported
- * by the replaced ICD implementation. For the purposes of this notice, "ICD"
- * shall mean a library that presents an implementation of the OpenCL API for
- * the purpose routing API calls to different vendor implementation.
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Materials.
- *
- * KHRONOS AND AMD MAKE NO REPRESENTATION ABOUT THE SUITABILITY OF THIS
- * SOURCE CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
- * IMPLIED WARRANTY OF ANY KIND. KHRONOS AND AMD DISCLAIM ALL WARRANTIES
- * WITH REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
- * IN NO EVENT SHALL KHRONOS OR AMD BE LIABLE FOR ANY SPECIAL, INDIRECT,
- * INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
- * THE USE OR PERFORMANCE OF THIS SOURCE CODE.
- *
- * U.S. Government End Users. This source code is a "commercial item" as
- * that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
- * "commercial computer software" and "commercial computer software
- * documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
- * and is provided to the U.S. Government only as a commercial end item.
- * Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
- * 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
- * source code with only those rights set forth herein.
- */
-/* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */
-#ifndef __SPIR_H
-#define __SPIR_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-// CLS is for CL SPIR.
-typedef enum {
- CLS_PRIVATE_AS = 0,
- CLS_GLOBAL_AS = 1,
- CLS_CONSTANT_AS = 2,
- CLS_LOCAL_AS = 3,
- CLS_GLOBAL_HOST_AS = 4,
- CLS_CONSTANT_HOST_AS = 5,
- CLS_REGION_AS_AMD = 16,
-} CLS_ADDRESS_SPACES;
-
-// Table 13
-typedef enum {
- CLS_ADDRESS_MIRRORED_REPEAT = 0,
- CLS_ADDRESS_REPEAT = 1,
- CLS_ADDRESS_CLAMP_TO_EDGE = 2,
- CLS_ADDRESS_CLAMP = 3,
- CLS_ADDRESS_NONE = 4
-} CLS_ADDRESSING_MODES;
-
-// Table 13
-typedef enum {
- CLS_FILTER_NEAREST = 0,
- CLS_FILTER_LINEAR = 1
-} CLS_FILTER_MODE;
-
-// Table 13
-typedef enum {
- CLS_NORMALIZED_COORDS_TRUE = 0,
- CLS_NORMALIZED_COORDS_FALSE = 1
-} CLS_NORMALIZED_COORDS;
-
-// Section 2.3
-typedef enum {
- CLS_READ_ONLY = 0,
- CLS_WRITE_ONLY = 1,
- CLS_READ_WRITE = 2,
- CLS_NONE = 3
-} CLS_ACCESS_QUALIFIERS;
-
-// Table 14
-typedef enum {
- CLS_ARG_CONST = 1,
- CLS_ARG_RESTRICT = 2,
- CLS_ARG_VOLATILE = 4,
- CLS_ARG_NONE = 0,
- CLS_ARG_MASK = 0xf,
- CLS_ARG_PIPE = 8
-} CLS_ARGTYPE_QUALIFIERS;
-
-static const char* SPIR_TRIPLE_32BIT = "spir-unknown-unknown";
-static const char* SPIR_TRIPLE_64BIT = "spir64-unknown-unknown";
-static const char* SPIR_DATA_LAYOUT_32BIT = "p:32:32:32-i1:8:8-i8:8:8"
- "-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16"
- "-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128"
- "-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024";
-static const char* SPIR_DATA_LAYOUT_64BIT = "p:64:64:64-i1:8:8-i8:8:8"
- "-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16"
- "-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128"
- "-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024";
-
-#ifdef __cplusplus
-}
-#endif
-#endif // __SPIR_H
diff --git a/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl.h b/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl.h
index 84d8a0a71d..509dbd90b8 100644
--- a/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl.h
+++ b/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl.h
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 - 2013 The Khronos Group Inc.
+ * Copyright (c) 2008-2015 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
@@ -12,6 +12,11 @@
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
+ * 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.
@@ -271,7 +276,7 @@ typedef struct _cl_buffer_region {
#define CL_DEVICE_EXTENSIONS 0x1030
#define CL_DEVICE_PLATFORM 0x1031
#define CL_DEVICE_DOUBLE_FP_CONFIG 0x1032
-/* 0x1033 reserved for CL_DEVICE_HALF_FP_CONFIG */
+#define CL_DEVICE_HALF_FP_CONFIG 0x1033
#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF 0x1034
#define CL_DEVICE_HOST_UNIFIED_MEMORY 0x1035 /* deprecated */
#define CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR 0x1036
@@ -559,7 +564,7 @@ typedef struct _cl_buffer_region {
#define CL_KERNEL_ARG_ACCESS_READ_WRITE 0x11A2
#define CL_KERNEL_ARG_ACCESS_NONE 0x11A3
-/* cl_kernel_arg_type_qualifer */
+/* cl_kernel_arg_type_qualifier */
#define CL_KERNEL_ARG_TYPE_NONE 0
#define CL_KERNEL_ARG_TYPE_CONST (1 << 0)
#define CL_KERNEL_ARG_TYPE_RESTRICT (1 << 1)
diff --git a/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl.hpp b/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl.hpp
index f81a6c4881..18175abc2a 100644
--- a/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl.hpp
+++ b/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl.hpp
@@ -12,6 +12,11 @@
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
+ * 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.
@@ -33,8 +38,8 @@
* Bruce Merry, February 2013.
* Tom Deakin and Simon McIntosh-Smith, July 2013
*
- * \version 1.2.8
- * \date October 2015
+ * \version 1.2.9
+ * \date December 2015
*
* Optional extension support
*
@@ -221,9 +226,9 @@
#include
#endif
-#if defined(__ANDROID__) || defined(__linux__) || defined(__APPLE__) || defined(__MACOSX)
+#if defined(__ANDROID__) || defined(linux) || defined(__APPLE__) || defined(__MACOSX)
#include
-#endif // __linux__
+#endif // linux
#include
@@ -481,7 +486,7 @@ typedef std::string STRING_CLASS;
* re-define the string class to match the std::string
* interface by defining STRING_CLASS
*/
-class CL_EXT_PREFIX__VERSION_1_1_DEPRECATED string CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED
+class CL_EXT_PREFIX__VERSION_1_1_DEPRECATED string
{
private:
::size_t size_;
@@ -647,7 +652,7 @@ public:
* or "" if empty/unset.
*/
const char * c_str(void) const { return (str_) ? str_ : "";}
-};
+} CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
typedef cl::string STRING_CLASS;
#endif // #elif !defined(__USE_DEV_STRING)
@@ -725,7 +730,7 @@ public:
*/
void push_back (const T& x)
{
- if (size() < N) {
+ if (size() < N) {
new (&data_[size_]) T(x);
size_++;
} else {
@@ -746,7 +751,7 @@ public:
detail::errHandler(CL_MEM_OBJECT_ALLOCATION_FAILURE, __VECTOR_CAPACITY_ERR);
}
}
-
+
/*! \brief Constructs with a value copied from another.
*
* \param vec the vector to copy.
@@ -754,7 +759,7 @@ public:
vector(const vector& vec) :
size_(vec.size_)
{
- if (size_ != 0) {
+ if (size_ != 0) {
assign(vec.begin(), vec.end());
}
}
@@ -791,7 +796,7 @@ public:
} else {
clear();
}
-
+
return *this;
}
@@ -1062,13 +1067,13 @@ namespace detail {
return comparand;
#elif _MSC_VER
return (int)(_InterlockedCompareExchange(
- (volatile long*)dest,
- (long)exchange,
- (long)comparand));
+ (volatile long*)dest,
+ (long)exchange,
+ (long)comparand));
#else // !_MSC_VER && !CL_HPP_CPP11_ATOMICS_SUPPORTED
return (__sync_val_compare_and_swap(
- dest,
- comparand,
+ dest,
+ comparand,
exchange));
#endif // !CL_HPP_CPP11_ATOMICS_SUPPORTED
}
@@ -1213,7 +1218,7 @@ inline cl_int getInfoHelper(Func f, cl_uint name, STRING_CLASS* param, long)
return err;
}
- char* value = (char*) alloca(required);
+ char* value = (char*)alloca(required);
err = f(name, required, value, NULL);
if (err != CL_SUCCESS) {
return err;
@@ -1226,7 +1231,7 @@ inline cl_int getInfoHelper(Func f, cl_uint name, STRING_CLASS* param, long)
cl_int err = f(name, 0, NULL, &required);
if (err != CL_SUCCESS) {
return err;
-}
+ }
// std::string has a constant data member
// a char vector does not
@@ -1814,9 +1819,9 @@ public:
Wrapper& operator = (const Wrapper& rhs)
{
if (this != &rhs) {
- if (object_ != NULL) { detail::errHandler(release(), __RELEASE_ERR); }
- object_ = rhs.object_;
- if (object_ != NULL) { detail::errHandler(retain(), __RETAIN_ERR); }
+ if (object_ != NULL) { detail::errHandler(release(), __RELEASE_ERR); }
+ object_ = rhs.object_;
+ if (object_ != NULL) { detail::errHandler(retain(), __RETAIN_ERR); }
}
return *this;
}
@@ -1916,10 +1921,10 @@ public:
Wrapper& operator = (const Wrapper& rhs)
{
if (this != &rhs) {
- if (object_ != NULL) { detail::errHandler(release(), __RELEASE_ERR); }
- object_ = rhs.object_;
- referenceCountable_ = rhs.referenceCountable_;
- if (object_ != NULL) { detail::errHandler(retain(), __RETAIN_ERR); }
+ if (object_ != NULL) { detail::errHandler(release(), __RELEASE_ERR); }
+ object_ = rhs.object_;
+ referenceCountable_ = rhs.referenceCountable_;
+ if (object_ != NULL) { detail::errHandler(retain(), __RETAIN_ERR); }
}
return *this;
}
@@ -2040,9 +2045,9 @@ public:
*/
Device& operator = (const cl_device_id& rhs)
{
- detail::Wrapper::operator=(rhs);
+ detail::Wrapper::operator=(rhs);
return *this;
- }
+ }
/*! \brief Copy constructor to forward copy to the superclass correctly.
* Required for MSVC.
@@ -2399,12 +2404,12 @@ public:
if (err != CL_SUCCESS) {
detail::errHandler(err, __GET_PLATFORM_IDS_ERR);
- if (errResult != NULL) {
- *errResult = err;
- }
+ if (errResult != NULL) {
+ *errResult = err;
+ }
return Platform();
}
-
+
return Platform(ids[0]);
}
@@ -2542,7 +2547,7 @@ public:
cl_int error;
#if !defined(__APPLE__) && !defined(__MACOS)
- cl_context_properties prop[4] = {CL_CONTEXT_PLATFORM, 0, 0, 0 };
+ cl_context_properties prop[4] = {CL_CONTEXT_PLATFORM, 0, 0, 0 };
if (properties == NULL) {
// Get a valid platform ID as we cannot send in a blank one
@@ -2553,8 +2558,8 @@ public:
if (err != NULL) {
*err = error;
}
- return;
- }
+ return;
+ }
// Check the platforms we found for a device of our specified type
cl_context_properties platform_id = 0;
@@ -2751,31 +2756,31 @@ public:
}
cl_int err = ::clGetSupportedImageFormats(
- object_,
- flags,
- type,
- 0,
- NULL,
- &numEntries);
+ object_,
+ flags,
+ type,
+ 0,
+ NULL,
+ &numEntries);
if (err != CL_SUCCESS) {
return detail::errHandler(err, __GET_SUPPORTED_IMAGE_FORMATS_ERR);
}
if (numEntries > 0) {
- ImageFormat* value = (ImageFormat*)
- alloca(numEntries * sizeof(ImageFormat));
- err = ::clGetSupportedImageFormats(
- object_,
- flags,
- type,
- numEntries,
- (cl_image_format*) value,
- NULL);
- if (err != CL_SUCCESS) {
- return detail::errHandler(err, __GET_SUPPORTED_IMAGE_FORMATS_ERR);
- }
+ ImageFormat* value = (ImageFormat*)
+ alloca(numEntries * sizeof(ImageFormat));
+ err = ::clGetSupportedImageFormats(
+ object_,
+ flags,
+ type,
+ numEntries,
+ (cl_image_format*)value,
+ NULL);
+ if (err != CL_SUCCESS) {
+ return detail::errHandler(err, __GET_SUPPORTED_IMAGE_FORMATS_ERR);
+ }
- formats->assign(&value[0], &value[numEntries]);
+ formats->assign(&value[0], &value[numEntries]);
}
else {
formats->clear();
@@ -3027,15 +3032,15 @@ public:
__CL_EXPLICIT_CONSTRUCTORS Memory(const cl_mem& memory) : detail::Wrapper(memory) { }
/*! \brief Assignment operator from cl_mem - takes ownership.
- *
+ *
* This effectively transfers ownership of a refcount on the rhs and calls
* clReleaseMemObject() on the value previously held by this instance.
*/
Memory& operator = (const cl_mem& rhs)
{
- detail::Wrapper::operator=(rhs);
+ detail::Wrapper::operator=(rhs);
return *this;
- }
+ }
/*! \brief Copy constructor to forward copy to the superclass correctly.
* Required for MSVC.
@@ -3274,9 +3279,9 @@ public:
*/
Buffer& operator = (const cl_mem& rhs)
{
- Memory::operator=(rhs);
+ Memory::operator=(rhs);
return *this;
- }
+ }
/*! \brief Copy constructor to forward copy to the superclass correctly.
* Required for MSVC.
@@ -3291,7 +3296,7 @@ public:
Memory::operator=(buf);
return *this;
}
-
+
#if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
/*! \brief Move constructor to forward move to the superclass correctly.
* Required for MSVC.
@@ -3409,9 +3414,9 @@ public:
*/
BufferD3D10& operator = (const cl_mem& rhs)
{
- Buffer::operator=(rhs);
+ Buffer::operator=(rhs);
return *this;
- }
+ }
/*! \brief Copy constructor to forward copy to the superclass correctly.
* Required for MSVC.
@@ -3430,7 +3435,7 @@ public:
#if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
/*! \brief Move constructor to forward move to the superclass correctly.
* Required for MSVC.
- */
+ */
BufferD3D10(BufferD3D10&& buf) CL_HPP_NOEXCEPT : Buffer(std::move(buf)) {}
/*! \brief Move assignment to forward move to the superclass correctly.
@@ -3506,9 +3511,9 @@ public:
/*! \brief Copy assignment to forward copy to the superclass correctly.
* Required for MSVC.
- */
+ */
BufferGL& operator = (const BufferGL &buf)
-{
+ {
Buffer::operator=(buf);
return *this;
}
@@ -3516,12 +3521,12 @@ public:
#if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED)
/*! \brief Move constructor to forward move to the superclass correctly.
* Required for MSVC.
- */
+ */
BufferGL(BufferGL&& buf) CL_HPP_NOEXCEPT : Buffer(std::move(buf)) {}
/*! \brief Move assignment to forward move to the superclass correctly.
* Required for MSVC.
- */
+ */
BufferGL& operator = (BufferGL &&buf)
{
Buffer::operator=(std::move(buf));
@@ -3564,9 +3569,9 @@ protected:
*/
Image& operator = (const cl_mem& rhs)
{
- Memory::operator=(rhs);
+ Memory::operator=(rhs);
return *this;
- }
+ }
/*! \brief Copy constructor to forward copy to the superclass correctly.
* Required for MSVC.
@@ -3681,9 +3686,9 @@ public:
*/
Image1D& operator = (const cl_mem& rhs)
{
- Image::operator=(rhs);
+ Image::operator=(rhs);
return *this;
- }
+ }
/*! \brief Copy constructor to forward copy to the superclass correctly.
* Required for MSVC.
@@ -3758,9 +3763,9 @@ public:
Image1DBuffer& operator = (const cl_mem& rhs)
{
- Image::operator=(rhs);
+ Image::operator=(rhs);
return *this;
- }
+ }
/*! \brief Copy constructor to forward copy to the superclass correctly.
* Required for MSVC.
@@ -3839,9 +3844,9 @@ public:
Image1DArray& operator = (const cl_mem& rhs)
{
- Image::operator=(rhs);
+ Image::operator=(rhs);
return *this;
- }
+ }
/*! \brief Copy constructor to forward copy to the superclass correctly.
* Required for MSVC.
@@ -3969,9 +3974,9 @@ public:
*/
Image2D& operator = (const cl_mem& rhs)
{
- Image::operator=(rhs);
+ Image::operator=(rhs);
return *this;
- }
+ }
/*! \brief Copy constructor to forward copy to the superclass correctly.
* Required for MSVC.
@@ -4062,9 +4067,9 @@ public:
*/
Image2DGL& operator = (const cl_mem& rhs)
{
- Image2D::operator=(rhs);
+ Image2D::operator=(rhs);
return *this;
- }
+ }
/*! \brief Copy constructor to forward copy to the superclass correctly.
* Required for MSVC.
@@ -4149,9 +4154,9 @@ public:
Image2DArray& operator = (const cl_mem& rhs)
{
- Image::operator=(rhs);
+ Image::operator=(rhs);
return *this;
- }
+ }
/*! \brief Copy constructor to forward copy to the superclass correctly.
* Required for MSVC.
@@ -4283,9 +4288,9 @@ public:
*/
Image3D& operator = (const cl_mem& rhs)
{
- Image::operator=(rhs);
+ Image::operator=(rhs);
return *this;
- }
+ }
/*! \brief Copy constructor to forward copy to the superclass correctly.
* Required for MSVC.
@@ -4373,9 +4378,9 @@ public:
*/
Image3DGL& operator = (const cl_mem& rhs)
{
- Image3D::operator=(rhs);
+ Image3D::operator=(rhs);
return *this;
- }
+ }
/*! \brief Copy constructor to forward copy to the superclass correctly.
* Required for MSVC.
@@ -4448,9 +4453,9 @@ public:
ImageGL& operator = (const cl_mem& rhs)
{
- Image::operator=(rhs);
+ Image::operator=(rhs);
return *this;
- }
+ }
/*! \brief Copy constructor to forward copy to the superclass correctly.
* Required for MSVC.
@@ -4663,15 +4668,15 @@ public:
__CL_EXPLICIT_CONSTRUCTORS Sampler(const cl_sampler& sampler) : detail::Wrapper(sampler) { }
/*! \brief Assignment operator from cl_sampler - takes ownership.
- *
+ *
* This effectively transfers ownership of a refcount on the rhs and calls
* clReleaseSampler() on the value previously held by this instance.
*/
Sampler& operator = (const cl_sampler& rhs)
{
- detail::Wrapper::operator=(rhs);
+ detail::Wrapper::operator=(rhs);
return *this;
- }
+ }
/*! \brief Copy constructor to forward copy to the superclass correctly.
* Required for MSVC.
@@ -4857,15 +4862,15 @@ public:
__CL_EXPLICIT_CONSTRUCTORS Kernel(const cl_kernel& kernel) : detail::Wrapper(kernel) { }
/*! \brief Assignment operator from cl_kernel - takes ownership.
- *
+ *
* This effectively transfers ownership of a refcount on the rhs and calls
* clReleaseKernel() on the value previously held by this instance.
*/
Kernel& operator = (const cl_kernel& rhs)
{
- detail::Wrapper::operator=(rhs);
+ detail::Wrapper::operator=(rhs);
return *this;
- }
+ }
/*! \brief Copy constructor to forward copy to the superclass correctly.
* Required for MSVC.
@@ -5198,9 +5203,9 @@ public:
Program& operator = (const cl_program& rhs)
{
- detail::Wrapper::operator=(rhs);
+ detail::Wrapper::operator=(rhs);
return *this;
- }
+ }
/*! \brief Copy constructor to forward copy to the superclass correctly.
* Required for MSVC.
@@ -5273,7 +5278,7 @@ public:
}
#if defined(CL_VERSION_1_2)
- cl_int compile(
+ cl_int compile(
const char* options = NULL,
void (CL_CALLBACK * notifyFptr)(cl_program, void *) = NULL,
void* data = NULL) const
@@ -5284,9 +5289,9 @@ public:
0,
NULL,
options,
- 0,
- NULL,
- NULL,
+ 0,
+ NULL,
+ NULL,
notifyFptr,
data),
__COMPILE_PROGRAM_ERR);
@@ -5805,7 +5810,7 @@ public:
::size_t buffer_slice_pitch,
::size_t host_row_pitch,
::size_t host_slice_pitch,
- void *ptr,
+ const void *ptr,
const VECTOR_CLASS* events = NULL,
Event* event = NULL) const
{
@@ -5942,7 +5947,7 @@ public:
const size_t<3>& region,
::size_t row_pitch,
::size_t slice_pitch,
- void* ptr,
+ const void* ptr,
const VECTOR_CLASS* events = NULL,
Event* event = NULL) const
{
@@ -6237,7 +6242,7 @@ public:
*/
cl_int enqueueMarkerWithWaitList(
const VECTOR_CLASS *events = 0,
- Event *event = 0)
+ Event *event = 0) const
{
cl_event tmp;
cl_int err = detail::errHandler(
@@ -6267,7 +6272,7 @@ public:
*/
cl_int enqueueBarrierWithWaitList(
const VECTOR_CLASS *events = 0,
- Event *event = 0)
+ Event *event = 0) const
{
cl_event tmp;
cl_int err = detail::errHandler(
@@ -6293,7 +6298,7 @@ public:
cl_mem_migration_flags flags,
const VECTOR_CLASS* events = NULL,
Event* event = NULL
- )
+ ) const
{
cl_event tmp;
@@ -6962,7 +6967,7 @@ inline cl_int enqueueWriteBufferRect(
::size_t buffer_slice_pitch,
::size_t host_row_pitch,
::size_t host_slice_pitch,
- void *ptr,
+ const void *ptr,
const VECTOR_CLASS* events = NULL,
Event* event = NULL)
{
@@ -7060,7 +7065,7 @@ inline cl_int enqueueWriteImage(
const size_t<3>& region,
::size_t row_pitch,
::size_t slice_pitch,
- void* ptr,
+ const void* ptr,
const VECTOR_CLASS* events = NULL,
Event* event = NULL)
{
@@ -7399,6 +7404,7 @@ template <
typename T20, typename T21, typename T22, typename T23,
typename T24, typename T25, typename T26, typename T27,
typename T28, typename T29, typename T30, typename T31
+
>
class KernelFunctorGlobal
{
@@ -7452,6 +7458,7 @@ public:
T29 t29 = NullType(),
T30 t30 = NullType(),
T31 t31 = NullType()
+
)
{
Event event;
@@ -7487,6 +7494,7 @@ public:
SetArg<29, T29>::set(kernel_, t29);
SetArg<30, T30>::set(kernel_, t30);
SetArg<31, T31>::set(kernel_, t31);
+
args.queue_.enqueueNDRangeKernel(
kernel_,
@@ -12777,6 +12785,7 @@ template <
typename T27 = detail::NullType, typename T28 = detail::NullType,
typename T29 = detail::NullType, typename T30 = detail::NullType,
typename T31 = detail::NullType
+
>
struct make_kernel :
public detail::functionImplementation_<
@@ -12788,11 +12797,12 @@ struct make_kernel :
T20, T21, T22, T23,
T24, T25, T26, T27,
T28, T29, T30, T31
+
>
{
public:
- typedef detail::KernelFunctorGlobal<
- T0, T1, T2, T3,
+ typedef detail::KernelFunctorGlobal<
+ T0, T1, T2, T3,
T4, T5, T6, T7,
T8, T9, T10, T11,
T12, T13, T14, T15,
@@ -12800,6 +12810,7 @@ public:
T20, T21, T22, T23,
T24, T25, T26, T27,
T28, T29, T30, T31
+
> FunctorType;
make_kernel(
@@ -12815,6 +12826,7 @@ public:
T20, T21, T22, T23,
T24, T25, T26, T27,
T28, T29, T30, T31
+
>(
FunctorType(program, name, err))
{}
@@ -12830,6 +12842,7 @@ public:
T20, T21, T22, T23,
T24, T25, T26, T27,
T28, T29, T30, T31
+
>(
FunctorType(kernel))
{}
diff --git a/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl2.hpp b/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl2.hpp
index df9dd4a2d6..09764a0060 100644
--- a/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl2.hpp
+++ b/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl2.hpp
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008-2015 The Khronos Group Inc.
+ * Copyright (c) 2008-2016 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
@@ -12,6 +12,11 @@
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
+ * 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.
@@ -23,20 +28,21 @@
/*! \file
*
- * \brief C++ bindings for OpenCL 1.0 (rev 48), OpenCL 1.1 (rev 33),
+ * \brief C++ bindings for OpenCL 1.0 (rev 48), OpenCL 1.1 (rev 33),
* OpenCL 1.2 (rev 15) and OpenCL 2.0 (rev 29)
* \author Lee Howes and Bruce Merry
- *
- * Derived from the OpenCL 1.x C++ bindings written by
+ *
+ * Derived from the OpenCL 1.x C++ bindings written by
* Benedict R. Gaster, Laurent Morichetti and Lee Howes
* With additions and fixes from:
* Brian Cole, March 3rd 2010 and April 2012
* Matt Gruenke, April 2012.
* Bruce Merry, February 2013.
* Tom Deakin and Simon McIntosh-Smith, July 2013
- *
- * \version 2.0.7
- * \date 2015-10-05
+ * James Price, 2015-
+ *
+ * \version 2.0.10
+ * \date 2016-07-20
*
* Optional extension support
*
@@ -46,6 +52,20 @@
* #define CL_HPP_USE_DX_INTEROP
* cl_khr_sub_groups
* #define CL_HPP_USE_CL_SUB_GROUPS_KHR
+ * cl_khr_image2d_from_buffer
+ * #define CL_HPP_USE_CL_IMAGE2D_FROM_BUFFER_KHR
+ *
+ * Doxygen documentation for this header is available here:
+ *
+ * http://khronosgroup.github.io/OpenCL-CLHPP/
+ *
+ * The latest version of this header can be found on the GitHub releases page:
+ *
+ * https://github.com/KhronosGroup/OpenCL-CLHPP/releases
+ *
+ * Bugs and patches can be submitted to the GitHub repository:
+ *
+ * https://github.com/KhronosGroup/OpenCL-CLHPP
*/
/*! \mainpage
@@ -56,7 +76,7 @@
* The interface is contained with a single C++ header file \em cl2.hpp and all
* definitions are contained within the namespace \em cl. There is no additional
* requirement to include \em cl.h and to use either the C++ or original C
- * bindings; it is enough to simply include \em cl.hpp.
+ * bindings; it is enough to simply include \em cl2.hpp.
*
* The bindings themselves are lightweight and correspond closely to the
* underlying C API. Using the C++ bindings introduces no additional execution
@@ -128,41 +148,64 @@
*
* \section parameterization Parameters
* This header may be parameterized by a set of preprocessor macros.
- * CL_HPP_TARGET_OPENCL_VERSION
- * - Defines the target OpenCL runtime version to build the header against.
- * Defaults to 200, representing OpenCL 2.0.
- * CL_HPP_NO_STD_STRING
- * - Do not use the standard library string class.
- * cl::string is not defined and may be defined by the user before
- * cl2.hpp is included.
- * CL_HPP_NO_STD_VECTOR
- * - Do not use the standard library vector class.
- * cl::vector is not defined and may be defined by the user before
- * cl2.hpp is included.
- * CL_HPP_NO_STD_ARRAY
- * - Do not use the standard library array class.
- * cl::array is not defined and may be defined by the user before
- * cl2.hpp is included.
- * CL_HPP_NO_STD_UNIQUE_PTR
- * - Do not use the standard library unique_ptr class.
- * cl::pointer and the cl::allocate_pointer function are not defined
- * and may be defined by the user before cl2.hpp is included.
- * CL_HPP_ENABLE_DEVICE_FISSION
- * - Enables device fission for OpenCL 1.2 platforms
- * CL_HPP_ENABLE_EXCEPTIONS
- * - Enable exceptions for use in the C++ bindings header.
- * This is the preferred error handling mechanism but is not required.
- * CL_HPP_ENABLE_SIZE_T_COMPATIBILITY
- * - Backward compatibility option to support cl.hpp-style size_t class.
- * Replaces the updated std::array derived version and removal of size_t
- * from the namespace. Note that in this case the new size_t class
- * is placed in the cl::compatibility namespace and thus requires
- * an additional using declaration for direct backward compatibility.
- * CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY
- * - Enable older vector of pairs interface for construction of programs.
- * CL_HPP_CL_1_2_DEFAULT_BUILD
- * - Default to OpenCL C 1.2 compilation rather than OpenCL C 2.0
- * - applies to use of cl::Program construction and other program build variants.
+ *
+ * - CL_HPP_TARGET_OPENCL_VERSION
+ *
+ * Defines the target OpenCL runtime version to build the header
+ * against. Defaults to 200, representing OpenCL 2.0.
+ *
+ * - CL_HPP_NO_STD_STRING
+ *
+ * Do not use the standard library string class. cl::string is not
+ * defined and may be defined by the user before cl2.hpp is
+ * included.
+ *
+ * - CL_HPP_NO_STD_VECTOR
+ *
+ * Do not use the standard library vector class. cl::vector is not
+ * defined and may be defined by the user before cl2.hpp is
+ * included.
+ *
+ * - CL_HPP_NO_STD_ARRAY
+ *
+ * Do not use the standard library array class. cl::array is not
+ * defined and may be defined by the user before cl2.hpp is
+ * included.
+ *
+ * - CL_HPP_NO_STD_UNIQUE_PTR
+ *
+ * Do not use the standard library unique_ptr class. cl::pointer and
+ * the cl::allocate_pointer functions are not defined and may be
+ * defined by the user before cl2.hpp is included.
+ *
+ * - CL_HPP_ENABLE_DEVICE_FISSION
+ *
+ * Enables device fission for OpenCL 1.2 platforms.
+ *
+ * - CL_HPP_ENABLE_EXCEPTIONS
+ *
+ * Enable exceptions for use in the C++ bindings header. This is the
+ * preferred error handling mechanism but is not required.
+ *
+ * - CL_HPP_ENABLE_SIZE_T_COMPATIBILITY
+ *
+ * Backward compatibility option to support cl.hpp-style size_t
+ * class. Replaces the updated std::array derived version and
+ * removal of size_t from the namespace. Note that in this case the
+ * new size_t class is placed in the cl::compatibility namespace and
+ * thus requires an additional using declaration for direct backward
+ * compatibility.
+ *
+ * - CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY
+ *
+ * Enable older vector of pairs interface for construction of
+ * programs.
+ *
+ * - CL_HPP_CL_1_2_DEFAULT_BUILD
+ *
+ * Default to OpenCL C 1.2 compilation rather than OpenCL C 2.0
+ * applies to use of cl::Program construction and other program
+ * build variants.
*
*
* \section example Example
@@ -171,19 +214,19 @@
* bindings, including support for the optional exception feature and
* also the supplied vector and string classes, see following sections for
* decriptions of these features.
- *
+ *
* \code
#define CL_HPP_ENABLE_EXCEPTIONS
#define CL_HPP_TARGET_OPENCL_VERSION 200
-
+
#include
#include
#include
#include
#include
-
+
const int numElements = 32;
-
+
int main(void)
{
// Filter for a 2.0 platform and set it as the default
@@ -206,35 +249,45 @@
std::cout << "Error setting default platform.";
return -1;
}
-
- std::string kernel1{
- "global int globalA;"
- "kernel void updateGlobal(){"
- " globalA = 75;"
- "}"};
- std::string kernel2{
- "typedef struct { global int *bar; } Foo; kernel void vectorAdd(global const Foo* aNum, global const int *inputA, global const int *inputB, global int *output, int val, write_only pipe int outPipe, queue_t childQueue){"
- " output[get_global_id(0)] = inputA[get_global_id(0)] + inputB[get_global_id(0)] + val + *(aNum->bar);"
- " write_pipe(outPipe, &val);"
- " queue_t default_queue = get_default_queue(); "
- " ndrange_t ndrange = ndrange_1D(get_global_size(0)/2, get_global_size(0)/2); "
- // Have a child kernel write into third quarter of output
- " enqueue_kernel(default_queue, CLK_ENQUEUE_FLAGS_WAIT_KERNEL, ndrange, "
- " ^{"
- " output[get_global_size(0)*2 + get_global_id(0)] = inputA[get_global_size(0)*2+get_global_id(0)] + inputB[get_global_size(0)*2+get_global_id(0)] + globalA;"
- " });"
- // Have a child kernel write into last quarter of output
- " enqueue_kernel(childQueue, CLK_ENQUEUE_FLAGS_WAIT_KERNEL, ndrange, "
- " ^{"
- " output[get_global_size(0)*3 + get_global_id(0)] = inputA[get_global_size(0)*3 + get_global_id(0)] + inputB[get_global_size(0)*3 + get_global_id(0)] + globalA + 2;"
- " });"
- "}" };
+
+ // Use C++11 raw string literals for kernel source code
+ std::string kernel1{R"CLC(
+ global int globalA;
+ kernel void updateGlobal()
+ {
+ globalA = 75;
+ }
+ )CLC"};
+ std::string kernel2{R"CLC(
+ typedef struct { global int *bar; } Foo;
+ kernel void vectorAdd(global const Foo* aNum, global const int *inputA, global const int *inputB,
+ global int *output, int val, write_only pipe int outPipe, queue_t childQueue)
+ {
+ output[get_global_id(0)] = inputA[get_global_id(0)] + inputB[get_global_id(0)] + val + *(aNum->bar);
+ write_pipe(outPipe, &val);
+ queue_t default_queue = get_default_queue();
+ ndrange_t ndrange = ndrange_1D(get_global_size(0)/2, get_global_size(0)/2);
+
+ // Have a child kernel write into third quarter of output
+ enqueue_kernel(default_queue, CLK_ENQUEUE_FLAGS_WAIT_KERNEL, ndrange,
+ ^{
+ output[get_global_size(0)*2 + get_global_id(0)] =
+ inputA[get_global_size(0)*2 + get_global_id(0)] + inputB[get_global_size(0)*2 + get_global_id(0)] + globalA;
+ });
+
+ // Have a child kernel write into last quarter of output
+ enqueue_kernel(childQueue, CLK_ENQUEUE_FLAGS_WAIT_KERNEL, ndrange,
+ ^{
+ output[get_global_size(0)*3 + get_global_id(0)] =
+ inputA[get_global_size(0)*3 + get_global_id(0)] + inputB[get_global_size(0)*3 + get_global_id(0)] + globalA + 2;
+ });
+ }
+ )CLC"};
// New simpler string interface style
std::vector programStrings {kernel1, kernel2};
- cl::Program vectorAddProgram(
- programStrings);
+ cl::Program vectorAddProgram(programStrings);
try {
vectorAddProgram.build("-cl-std=CL2.0");
}
@@ -245,7 +298,7 @@
for (auto &pair : buildInfo) {
std::cerr << pair.second << std::endl << std::endl;
}
-
+
return 1;
}
@@ -258,17 +311,17 @@
program2Kernel(
cl::EnqueueArgs(
cl::NDRange(1)));
-
+
//////////////////
// SVM allocations
-
- cl::pointer anSVMInt = cl::allocate_svm>();
+
+ auto anSVMInt = cl::allocate_svm>();
*anSVMInt = 5;
- cl::SVMAllocator>> svmAllocReadOnly;
+ cl::SVMAllocator>> svmAllocReadOnly;
auto fooPointer = cl::allocate_pointer(svmAllocReadOnly);
fooPointer->bar = anSVMInt.get();
cl::SVMAllocator> svmAlloc;
- std::vector>> inputA(numElements, 1, svmAlloc);
+ std::vector>> inputA(numElements, 1, svmAlloc);
cl::coarse_svm_vector inputB(numElements, 2, svmAlloc);
//
@@ -278,7 +331,7 @@
std::vector output(numElements, 0xdeadbeef);
cl::Buffer outputBuffer(begin(output), end(output), false);
cl::Pipe aPipe(sizeof(cl_int), numElements / 2);
-
+
// Default command queue, also passed in as a parameter
cl::DeviceCommandQueue defaultDeviceQueue = cl::DeviceCommandQueue::makeDefault(
cl::Context::getDefault(), cl::Device::getDefault());
@@ -333,7 +386,7 @@
return 0;
}
- *
+ *
* \endcode
*
*/
@@ -889,14 +942,12 @@ inline cl_int getInfoHelper(Func f, cl_uint name, vector>*
size_type numBinaries = param->size();
vector binariesPointers(numBinaries);
- size_type totalSize = 0;
for (size_type i = 0; i < numBinaries; ++i)
{
binariesPointers[i] = (*param)[i].data();
- totalSize += (*param)[i].size();
}
- cl_int err = f(name, totalSize, binariesPointers.data(), NULL);
+ cl_int err = f(name, numBinaries * sizeof(unsigned char*), binariesPointers.data(), NULL);
if (err != CL_SUCCESS) {
return err;
@@ -1139,9 +1190,6 @@ inline cl_int getInfoHelper(Func f, cl_uint name, T* param, int, typename T::cl_
F(cl_image_info, CL_IMAGE_WIDTH, size_type) \
F(cl_image_info, CL_IMAGE_HEIGHT, size_type) \
F(cl_image_info, CL_IMAGE_DEPTH, size_type) \
- F(cl_image_info, CL_IMAGE_ARRAY_SIZE, size_type) \
- F(cl_image_info, CL_IMAGE_NUM_MIP_LEVELS, cl_uint) \
- F(cl_image_info, CL_IMAGE_NUM_SAMPLES, cl_uint) \
\
F(cl_sampler_info, CL_SAMPLER_REFERENCE_COUNT, cl_uint) \
F(cl_sampler_info, CL_SAMPLER_CONTEXT, cl::Context) \
@@ -1219,7 +1267,11 @@ inline cl_int getInfoHelper(Func f, cl_uint name, T* param, int, typename T::cl_
F(cl_device_info, CL_DEVICE_REFERENCE_COUNT, cl_uint) \
F(cl_device_info, CL_DEVICE_PREFERRED_INTEROP_USER_SYNC, size_type) \
F(cl_device_info, CL_DEVICE_PARTITION_AFFINITY_DOMAIN, cl_device_affinity_domain) \
- F(cl_device_info, CL_DEVICE_BUILT_IN_KERNELS, string)
+ F(cl_device_info, CL_DEVICE_BUILT_IN_KERNELS, string) \
+ \
+ F(cl_image_info, CL_IMAGE_ARRAY_SIZE, size_type) \
+ F(cl_image_info, CL_IMAGE_NUM_MIP_LEVELS, cl_uint) \
+ F(cl_image_info, CL_IMAGE_NUM_SAMPLES, cl_uint)
#define CL_HPP_PARAM_NAME_INFO_2_0_(F) \
F(cl_device_info, CL_DEVICE_QUEUE_ON_HOST_PROPERTIES, cl_command_queue_properties) \
@@ -1531,6 +1583,7 @@ struct ReferenceHandler
};
+#if CL_HPP_TARGET_OPENCL_VERSION >= 120 && CL_HPP_MINIMUM_OPENCL_VERSION < 120
// Extracts version number with major in the upper 16 bits, minor in the lower 16
static cl_uint getVersion(const vector &versionInfo)
{
@@ -1551,12 +1604,11 @@ static cl_uint getVersion(const vector &versionInfo)
return (highVersion << 16) | lowVersion;
}
-#if CL_HPP_TARGET_OPENCL_VERSION >= 120 && CL_HPP_MINIMUM_OPENCL_VERSION < 120
static cl_uint getPlatformVersion(cl_platform_id platform)
{
size_type size = 0;
clGetPlatformInfo(platform, CL_PLATFORM_VERSION, 0, NULL, &size);
-
+
vector versionInfo(size);
clGetPlatformInfo(platform, CL_PLATFORM_VERSION, size, versionInfo.data(), &size);
return getVersion(versionInfo);
@@ -3411,7 +3463,7 @@ public:
context_(),
SVMTrait::getSVMMemFlags(),
size*sizeof(T),
- sizeof(T));
+ 0);
pointer retValue = reinterpret_cast(
voidPointer);
#if defined(CL_HPP_ENABLE_EXCEPTIONS)
@@ -3447,7 +3499,7 @@ public:
{
size_type maxSize = std::numeric_limits::max() / sizeof(T);
- for (Device &d : context_.getInfo()) {
+ for (const Device &d : context_.getInfo()) {
maxSize = std::min(
maxSize,
static_cast(d.getInfo()));
@@ -3534,7 +3586,7 @@ template
cl::pointer> allocate_pointer(const Alloc &alloc_, Args&&... args)
{
Alloc alloc(alloc_);
- static const size_t copies = 1;
+ static const size_type copies = 1;
// Ensure that creation of the management block and the
// object are dealt with separately such that we only provide a deleter
@@ -4542,7 +4594,7 @@ public:
#endif // CL_HPP_MINIMUM_OPENCL_VERSION < 120
}
-#if CL_HPP_TARGET_OPENCL_VERSION >= 200
+#if CL_HPP_TARGET_OPENCL_VERSION >= 200 || defined(CL_HPP_USE_CL_IMAGE2D_FROM_BUFFER_KHR)
/*! \brief Constructs a 2D Image from a buffer.
* \note This will share storage with the underlying buffer.
*
@@ -4583,7 +4635,7 @@ public:
*err = error;
}
}
-#endif //#if CL_HPP_TARGET_OPENCL_VERSION >= 200
+#endif //#if CL_HPP_TARGET_OPENCL_VERSION >= 200 || defined(CL_HPP_USE_CL_IMAGE2D_FROM_BUFFER_KHR)
#if CL_HPP_TARGET_OPENCL_VERSION >= 200
/*! \brief Constructs a 2D Image from an image.
@@ -6369,7 +6421,7 @@ public:
return devInfo;
}
- for (cl::Device d : devs) {
+ for (const cl::Device &d : devs) {
typename detail::param_traits<
detail::cl_program_build_info, name>::param_type param;
result = getBuildInfo(d, name, ¶m);
@@ -6560,7 +6612,7 @@ enum class QueueProperties : cl_command_queue_properties
OutOfOrder = CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE,
};
-QueueProperties operator|(QueueProperties lhs, QueueProperties rhs)
+inline QueueProperties operator|(QueueProperties lhs, QueueProperties rhs)
{
return static_cast(static_cast(lhs) | static_cast(rhs));
}
@@ -7103,7 +7155,7 @@ public:
size_type buffer_slice_pitch,
size_type host_row_pitch,
size_type host_slice_pitch,
- void *ptr,
+ const void *ptr,
const vector* events = NULL,
Event* event = NULL) const
{
@@ -7251,7 +7303,7 @@ public:
const array& region,
size_type row_pitch,
size_type slice_pitch,
- void* ptr,
+ const void* ptr,
const vector* events = NULL,
Event* event = NULL) const
{
@@ -7726,7 +7778,7 @@ public:
*/
cl_int enqueueMarkerWithWaitList(
const vector *events = 0,
- Event *event = 0)
+ Event *event = 0) const
{
cl_event tmp;
cl_int err = detail::errHandler(
@@ -7756,7 +7808,7 @@ public:
*/
cl_int enqueueBarrierWithWaitList(
const vector *events = 0,
- Event *event = 0)
+ Event *event = 0) const
{
cl_event tmp;
cl_int err = detail::errHandler(
@@ -7782,7 +7834,7 @@ public:
cl_mem_migration_flags flags,
const vector* events = NULL,
Event* event = NULL
- )
+ ) const
{
cl_event tmp;
@@ -7841,7 +7893,7 @@ public:
CL_EXT_PREFIX__VERSION_1_2_DEPRECATED cl_int enqueueTask(
const Kernel& kernel,
const vector* events = NULL,
- Event* event = NULL) CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED const
+ Event* event = NULL) const CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED
{
cl_event tmp;
cl_int err = detail::errHandler(
@@ -8083,7 +8135,7 @@ enum class DeviceQueueProperties : cl_command_queue_properties
Profiling = CL_QUEUE_PROFILING_ENABLE,
};
-DeviceQueueProperties operator|(DeviceQueueProperties lhs, DeviceQueueProperties rhs)
+inline DeviceQueueProperties operator|(DeviceQueueProperties lhs, DeviceQueueProperties rhs)
{
return static_cast(static_cast(lhs) | static_cast(rhs));
}
@@ -8869,7 +8921,7 @@ inline cl_int enqueueWriteBufferRect(
size_type buffer_slice_pitch,
size_type host_row_pitch,
size_type host_slice_pitch,
- void *ptr,
+ const void *ptr,
const vector* events = NULL,
Event* event = NULL)
{
@@ -8967,7 +9019,7 @@ inline cl_int enqueueWriteImage(
const array& region,
size_type row_pitch,
size_type slice_pitch,
- void* ptr,
+ const void* ptr,
const vector* events = NULL,
Event* event = NULL)
{
diff --git a/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_d3d10.h b/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_d3d10.h
index 91e4a68796..d5960a43f7 100644
--- a/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_d3d10.h
+++ b/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_d3d10.h
@@ -1,5 +1,5 @@
/**********************************************************************************
- * Copyright (c) 2008-2013 The Khronos Group Inc.
+ * Copyright (c) 2008-2015 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
@@ -12,6 +12,11 @@
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
+ * 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.
diff --git a/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_d3d11.h b/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_d3d11.h
index 496273b855..39f9072398 100644
--- a/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_d3d11.h
+++ b/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_d3d11.h
@@ -1,5 +1,5 @@
/**********************************************************************************
- * Copyright (c) 2008-2013 The Khronos Group Inc.
+ * Copyright (c) 2008-2015 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
@@ -12,6 +12,11 @@
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
+ * 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.
diff --git a/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_dx9_media_sharing.h b/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_dx9_media_sharing.h
index 6fe2db2b1d..2729e8b9e8 100644
--- a/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_dx9_media_sharing.h
+++ b/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_dx9_media_sharing.h
@@ -1,5 +1,5 @@
/**********************************************************************************
- * Copyright (c) 2008-2013 The Khronos Group Inc.
+ * Copyright (c) 2008-2015 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
@@ -12,6 +12,11 @@
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
+ * 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.
diff --git a/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_egl.h b/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_egl.h
index 93e6c9cfba..a765bd5266 100644
--- a/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_egl.h
+++ b/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_egl.h
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008-2010 The Khronos Group Inc.
+ * Copyright (c) 2008-2015 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
@@ -12,6 +12,11 @@
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
+ * 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.
@@ -28,8 +33,6 @@
#else
#include
-#include
-#include
#endif
#ifdef __cplusplus
diff --git a/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_ext.h b/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_ext.h
index 9e332016c1..892382ee6d 100644
--- a/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_ext.h
+++ b/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_ext.h
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008-2013 The Khronos Group Inc.
+ * Copyright (c) 2008-2015 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
@@ -12,6 +12,11 @@
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
+ * 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.
@@ -21,7 +26,7 @@
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
******************************************************************************/
-/* $Revision: 14835 $ on $Date: 2011-05-26 11:32:00 -0700 (Thu, 26 May 2011) $ */
+/* $Revision: 11928 $ on $Date: 2010-07-13 09:04:56 -0700 (Tue, 13 Jul 2010) $ */
/* cl_ext.h contains OpenCL extensions which don't have external */
/* (OpenGL, D3D) dependencies. */
@@ -149,6 +154,7 @@ extern CL_API_ENTRY cl_int CL_API_CALL clTerminateContextKHR(cl_context /* conte
typedef CL_API_ENTRY cl_int (CL_API_CALL *clTerminateContextKHR_fn)(cl_context /* context */) CL_EXT_SUFFIX__VERSION_1_2;
+
/*
* Extension: cl_khr_spir
*
@@ -159,6 +165,25 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *clTerminateContextKHR_fn)(cl_context /
#define CL_DEVICE_SPIR_VERSIONS 0x40E0
#define CL_PROGRAM_BINARY_TYPE_INTERMEDIATE 0x40E1
+#ifdef CL_VERSION_2_0
+/*********************************
+* cl_khr_il_program extension
+*********************************/
+#define cl_khr_il_program 1
+
+extern CL_API_ENTRY cl_program CL_API_CALL
+clCreateProgramWithILKHR(cl_context /* context */,
+ const void * /* strings */,
+ size_t /* lengths */,
+ cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_2_0;
+
+typedef CL_API_ENTRY cl_program
+ ( CL_API_CALL * clCreateProgramWithILKHR_fn)(cl_context /* context */,
+ const void * /* strings */,
+ size_t /* lengths */,
+ cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_2_0;
+
+#endif /* CL_VERSION_2_0 */
/******************************************
* cl_nv_device_attribute_query extension *
@@ -210,198 +235,11 @@ typedef union
#define CL_DEVICE_TOPOLOGY_TYPE_PCIE_AMD 1
-//
-/***************************
-* cl_amd_command_intercept *
-***************************/
-#define CL_CONTEXT_COMMAND_INTERCEPT_CALLBACK_AMD 0x403D
-#define CL_QUEUE_COMMAND_INTERCEPT_ENABLE_AMD (1ull << 63)
-
-typedef cl_int (CL_CALLBACK * intercept_callback_fn)(cl_event, cl_int *);
-
-/**************************
-* cl_amd_command_queue_info *
-**************************/
-#define CL_QUEUE_THREAD_HANDLE_AMD 0x403E
-
-/* cl_kernel_exec_info for DVR DOPP texture support */
-#define CL_KERNEL_EXEC_INFO_NEW_VCOP_AMD 0x4120
-#define CL_KERNEL_EXEC_INFO_PFPA_VCOP_AMD 0x4121
-
-/***************************************
-* cl-gl depth buffer interop extension *
-****************************************/
-
-#define CL_UNORM_INT24 0x10DF
-#define CL_GL_NUM_SAMPLES 0x2012
-//
-
/**************************
* cl_amd_offline_devices *
**************************/
#define CL_CONTEXT_OFFLINE_DEVICES_AMD 0x403F
-/*********************************
-* cl_arm_printf extension
-*********************************/
-#define CL_PRINTF_CALLBACK_ARM 0x40B0
-#define CL_PRINTF_BUFFERSIZE_ARM 0x40B1
-
-#ifdef CL_VERSION_1_1
- /***********************************
- * cl_ext_device_fission extension *
- ***********************************/
- #define cl_ext_device_fission 1
-
- extern CL_API_ENTRY cl_int CL_API_CALL
- clReleaseDeviceEXT( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1;
-
- typedef CL_API_ENTRY cl_int
- (CL_API_CALL *clReleaseDeviceEXT_fn)( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1;
-
- extern CL_API_ENTRY cl_int CL_API_CALL
- clRetainDeviceEXT( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1;
-
- typedef CL_API_ENTRY cl_int
- (CL_API_CALL *clRetainDeviceEXT_fn)( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1;
-
- typedef cl_ulong cl_device_partition_property_ext;
- extern CL_API_ENTRY cl_int CL_API_CALL
- clCreateSubDevicesEXT( cl_device_id /*in_device*/,
- const cl_device_partition_property_ext * /* properties */,
- cl_uint /*num_entries*/,
- cl_device_id * /*out_devices*/,
- cl_uint * /*num_devices*/ ) CL_EXT_SUFFIX__VERSION_1_1;
-
- typedef CL_API_ENTRY cl_int
- ( CL_API_CALL * clCreateSubDevicesEXT_fn)( cl_device_id /*in_device*/,
- const cl_device_partition_property_ext * /* properties */,
- cl_uint /*num_entries*/,
- cl_device_id * /*out_devices*/,
- cl_uint * /*num_devices*/ ) CL_EXT_SUFFIX__VERSION_1_1;
-
- /* cl_device_partition_property_ext */
- #define CL_DEVICE_PARTITION_EQUALLY_EXT 0x4050
- #define CL_DEVICE_PARTITION_BY_COUNTS_EXT 0x4051
- #define CL_DEVICE_PARTITION_BY_NAMES_EXT 0x4052
- #define CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN_EXT 0x4053
-
- /* clDeviceGetInfo selectors */
- #define CL_DEVICE_PARENT_DEVICE_EXT 0x4054
- #define CL_DEVICE_PARTITION_TYPES_EXT 0x4055
- #define CL_DEVICE_AFFINITY_DOMAINS_EXT 0x4056
- #define CL_DEVICE_REFERENCE_COUNT_EXT 0x4057
- #define CL_DEVICE_PARTITION_STYLE_EXT 0x4058
-
- /* clGetImageInfo enum */
- #define CL_IMAGE_BYTE_PITCH_AMD 0x4059
-
- /* error codes */
- #define CL_DEVICE_PARTITION_FAILED_EXT -1057
- #define CL_INVALID_PARTITION_COUNT_EXT -1058
- #define CL_INVALID_PARTITION_NAME_EXT -1059
-
- /* CL_AFFINITY_DOMAINs */
- #define CL_AFFINITY_DOMAIN_L1_CACHE_EXT 0x1
- #define CL_AFFINITY_DOMAIN_L2_CACHE_EXT 0x2
- #define CL_AFFINITY_DOMAIN_L3_CACHE_EXT 0x3
- #define CL_AFFINITY_DOMAIN_L4_CACHE_EXT 0x4
- #define CL_AFFINITY_DOMAIN_NUMA_EXT 0x10
- #define CL_AFFINITY_DOMAIN_NEXT_FISSIONABLE_EXT 0x100
- /* cl_device_partition_property_ext list terminators */
- #define CL_PROPERTIES_LIST_END_EXT ((cl_device_partition_property_ext) 0)
- #define CL_PARTITION_BY_COUNTS_LIST_END_EXT ((cl_device_partition_property_ext) 0)
- #define CL_PARTITION_BY_NAMES_LIST_END_EXT ((cl_device_partition_property_ext) 0 - 1)
-
-/*********************************
-* cl_qcom_ext_host_ptr extension
-*********************************/
-
-#define CL_MEM_EXT_HOST_PTR_QCOM (1 << 29)
-
-#define CL_DEVICE_EXT_MEM_PADDING_IN_BYTES_QCOM 0x40A0
-#define CL_DEVICE_PAGE_SIZE_QCOM 0x40A1
-#define CL_IMAGE_ROW_ALIGNMENT_QCOM 0x40A2
-#define CL_IMAGE_SLICE_ALIGNMENT_QCOM 0x40A3
-#define CL_MEM_HOST_UNCACHED_QCOM 0x40A4
-#define CL_MEM_HOST_WRITEBACK_QCOM 0x40A5
-#define CL_MEM_HOST_WRITETHROUGH_QCOM 0x40A6
-#define CL_MEM_HOST_WRITE_COMBINING_QCOM 0x40A7
-
-typedef cl_uint cl_image_pitch_info_qcom;
-
-extern CL_API_ENTRY cl_int CL_API_CALL
-clGetDeviceImageInfoQCOM(cl_device_id device,
- size_t image_width,
- size_t image_height,
- const cl_image_format *image_format,
- cl_image_pitch_info_qcom param_name,
- size_t param_value_size,
- void *param_value,
- size_t *param_value_size_ret);
-
-typedef struct _cl_mem_ext_host_ptr
-{
- /* Type of external memory allocation. */
- /* Legal values will be defined in layered extensions. */
- cl_uint allocation_type;
-
- /* Host cache policy for this external memory allocation. */
- cl_uint host_cache_policy;
-
-} cl_mem_ext_host_ptr;
-
-/*********************************
-* cl_qcom_ion_host_ptr extension
-*********************************/
-
-#define CL_MEM_ION_HOST_PTR_QCOM 0x40A8
-
-typedef struct _cl_mem_ion_host_ptr
-{
- /* Type of external memory allocation. */
- /* Must be CL_MEM_ION_HOST_PTR_QCOM for ION allocations. */
- cl_mem_ext_host_ptr ext_host_ptr;
-
- /* ION file descriptor */
- int ion_filedesc;
-
- /* Host pointer to the ION allocated memory */
- void* ion_hostptr;
-
-} cl_mem_ion_host_ptr;
-
-//
-/*************************
-* cl_amd_object_metadata *
-**************************/
-#define cl_amd_object_metadata 1
-
-typedef size_t cl_key_amd;
-
-#define CL_INVALID_OBJECT_AMD 0x403A
-#define CL_INVALID_KEY_AMD 0x403B
-#define CL_PLATFORM_MAX_KEYS_AMD 0x403C
-
-typedef CL_API_ENTRY cl_key_amd (CL_API_CALL * clCreateKeyAMD_fn)(
- cl_platform_id /* platform */,
- void (CL_CALLBACK * /* destructor */)( void* /* old_value */),
- cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_1;
-
-typedef CL_API_ENTRY cl_int (CL_API_CALL * clObjectGetValueForKeyAMD_fn)(
- void * /* object */,
- cl_key_amd /* key */,
- void ** /* ret_val */) CL_API_SUFFIX__VERSION_1_1;
-
-typedef CL_API_ENTRY cl_int (CL_API_CALL * clObjectSetValueForKeyAMD_fn)(
- void * /* object */,
- cl_key_amd /* key */,
- void * /* value */) CL_API_SUFFIX__VERSION_1_1;
-//
-
-#endif /* CL_VERSION_1_1 */
-
-#ifdef CL_VERSION_1_2
/********************************
* cl_amd_bus_addressable_memory *
********************************/
@@ -446,9 +284,7 @@ typedef CL_API_ENTRY cl_int
cl_uint /*num_events*/,
const cl_event * /*event_list*/,
cl_event * /*event*/) CL_EXT_SUFFIX__VERSION_1_2;
-#endif /* CL_VERSION_1_2 */
-#ifdef CL_VERSION_1_2
/**********************
* cl_amd_liquid_flash *
***********************/
@@ -532,61 +368,423 @@ typedef CL_API_ENTRY cl_int
const cl_event* /*event_wait_list*/,
cl_event* /*event*/) CL_EXT_SUFFIX__VERSION_1_2;
+//
+/***************************
+* cl_amd_command_intercept *
+***************************/
+#define CL_CONTEXT_COMMAND_INTERCEPT_CALLBACK_AMD 0x403D
+#define CL_QUEUE_COMMAND_INTERCEPT_ENABLE_AMD (1ull << 63)
+
+typedef cl_int (CL_CALLBACK * intercept_callback_fn)(cl_event, cl_int *);
+
+/**************************
+* cl_amd_command_queue_info *
+**************************/
+#define CL_QUEUE_THREAD_HANDLE_AMD 0x403E
+
+/* cl_kernel_exec_info for DVR DOPP texture support */
+#define CL_KERNEL_EXEC_INFO_NEW_VCOP_AMD 0x4120
+#define CL_KERNEL_EXEC_INFO_PFPA_VCOP_AMD 0x4121
+
+/*************************
+* cl_amd_object_metadata *
+**************************/
+#define cl_amd_object_metadata 1
+
+typedef size_t cl_key_amd;
+
+#define CL_INVALID_OBJECT_AMD 0x403A
+#define CL_INVALID_KEY_AMD 0x403B
+#define CL_PLATFORM_MAX_KEYS_AMD 0x403C
+
+typedef CL_API_ENTRY cl_key_amd (CL_API_CALL * clCreateKeyAMD_fn)(
+ cl_platform_id /* platform */,
+ void (CL_CALLBACK * /* destructor */)( void* /* old_value */),
+ cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_1;
+
+typedef CL_API_ENTRY cl_int (CL_API_CALL * clObjectGetValueForKeyAMD_fn)(
+ void * /* object */,
+ cl_key_amd /* key */,
+ void ** /* ret_val */) CL_API_SUFFIX__VERSION_1_1;
+
+typedef CL_API_ENTRY cl_int (CL_API_CALL * clObjectSetValueForKeyAMD_fn)(
+ void * /* object */,
+ cl_key_amd /* key */,
+ void * /* value */) CL_API_SUFFIX__VERSION_1_1;
+//
+
+/*********************************
+* cl_arm_printf extension
+*********************************/
+#define CL_PRINTF_CALLBACK_ARM 0x40B0
+#define CL_PRINTF_BUFFERSIZE_ARM 0x40B1
+
+#ifdef CL_VERSION_1_1
+ /***********************************
+ * cl_ext_device_fission extension *
+ ***********************************/
+ #define cl_ext_device_fission 1
+
+ extern CL_API_ENTRY cl_int CL_API_CALL
+ clReleaseDeviceEXT( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1;
+
+ typedef CL_API_ENTRY cl_int
+ (CL_API_CALL *clReleaseDeviceEXT_fn)( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1;
+
+ extern CL_API_ENTRY cl_int CL_API_CALL
+ clRetainDeviceEXT( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1;
+
+ typedef CL_API_ENTRY cl_int
+ (CL_API_CALL *clRetainDeviceEXT_fn)( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1;
+
+ typedef cl_ulong cl_device_partition_property_ext;
+ extern CL_API_ENTRY cl_int CL_API_CALL
+ clCreateSubDevicesEXT( cl_device_id /*in_device*/,
+ const cl_device_partition_property_ext * /* properties */,
+ cl_uint /*num_entries*/,
+ cl_device_id * /*out_devices*/,
+ cl_uint * /*num_devices*/ ) CL_EXT_SUFFIX__VERSION_1_1;
+
+ typedef CL_API_ENTRY cl_int
+ ( CL_API_CALL * clCreateSubDevicesEXT_fn)( cl_device_id /*in_device*/,
+ const cl_device_partition_property_ext * /* properties */,
+ cl_uint /*num_entries*/,
+ cl_device_id * /*out_devices*/,
+ cl_uint * /*num_devices*/ ) CL_EXT_SUFFIX__VERSION_1_1;
+
+ /* cl_device_partition_property_ext */
+ #define CL_DEVICE_PARTITION_EQUALLY_EXT 0x4050
+ #define CL_DEVICE_PARTITION_BY_COUNTS_EXT 0x4051
+ #define CL_DEVICE_PARTITION_BY_NAMES_EXT 0x4052
+ #define CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN_EXT 0x4053
+
+ /* clDeviceGetInfo selectors */
+ #define CL_DEVICE_PARENT_DEVICE_EXT 0x4054
+ #define CL_DEVICE_PARTITION_TYPES_EXT 0x4055
+ #define CL_DEVICE_AFFINITY_DOMAINS_EXT 0x4056
+ #define CL_DEVICE_REFERENCE_COUNT_EXT 0x4057
+ #define CL_DEVICE_PARTITION_STYLE_EXT 0x4058
+
+ /* clGetImageInfo enum */
+ #define CL_IMAGE_BYTE_PITCH_AMD 0x4059
+
+ /* error codes */
+ #define CL_DEVICE_PARTITION_FAILED_EXT -1057
+ #define CL_INVALID_PARTITION_COUNT_EXT -1058
+ #define CL_INVALID_PARTITION_NAME_EXT -1059
+
+ /* CL_AFFINITY_DOMAINs */
+ #define CL_AFFINITY_DOMAIN_L1_CACHE_EXT 0x1
+ #define CL_AFFINITY_DOMAIN_L2_CACHE_EXT 0x2
+ #define CL_AFFINITY_DOMAIN_L3_CACHE_EXT 0x3
+ #define CL_AFFINITY_DOMAIN_L4_CACHE_EXT 0x4
+ #define CL_AFFINITY_DOMAIN_NUMA_EXT 0x10
+ #define CL_AFFINITY_DOMAIN_NEXT_FISSIONABLE_EXT 0x100
+
+ /* cl_device_partition_property_ext list terminators */
+ #define CL_PROPERTIES_LIST_END_EXT ((cl_device_partition_property_ext) 0)
+ #define CL_PARTITION_BY_COUNTS_LIST_END_EXT ((cl_device_partition_property_ext) 0)
+ #define CL_PARTITION_BY_NAMES_LIST_END_EXT ((cl_device_partition_property_ext) 0 - 1)
+
+/*********************************
+* cl_qcom_ext_host_ptr extension
+*********************************/
+
+#define CL_MEM_EXT_HOST_PTR_QCOM (1 << 29)
+
+#define CL_DEVICE_EXT_MEM_PADDING_IN_BYTES_QCOM 0x40A0
+#define CL_DEVICE_PAGE_SIZE_QCOM 0x40A1
+#define CL_IMAGE_ROW_ALIGNMENT_QCOM 0x40A2
+#define CL_IMAGE_SLICE_ALIGNMENT_QCOM 0x40A3
+#define CL_MEM_HOST_UNCACHED_QCOM 0x40A4
+#define CL_MEM_HOST_WRITEBACK_QCOM 0x40A5
+#define CL_MEM_HOST_WRITETHROUGH_QCOM 0x40A6
+#define CL_MEM_HOST_WRITE_COMBINING_QCOM 0x40A7
+
+typedef cl_uint cl_image_pitch_info_qcom;
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clGetDeviceImageInfoQCOM(cl_device_id device,
+ size_t image_width,
+ size_t image_height,
+ const cl_image_format *image_format,
+ cl_image_pitch_info_qcom param_name,
+ size_t param_value_size,
+ void *param_value,
+ size_t *param_value_size_ret);
+
+typedef struct _cl_mem_ext_host_ptr
+{
+ /* Type of external memory allocation. */
+ /* Legal values will be defined in layered extensions. */
+ cl_uint allocation_type;
+
+ /* Host cache policy for this external memory allocation. */
+ cl_uint host_cache_policy;
+
+} cl_mem_ext_host_ptr;
+
+/*********************************
+* cl_qcom_ion_host_ptr extension
+*********************************/
+
+#define CL_MEM_ION_HOST_PTR_QCOM 0x40A8
+
+typedef struct _cl_mem_ion_host_ptr
+{
+ /* Type of external memory allocation. */
+ /* Must be CL_MEM_ION_HOST_PTR_QCOM for ION allocations. */
+ cl_mem_ext_host_ptr ext_host_ptr;
+
+ /* ION file descriptor */
+ int ion_filedesc;
+
+ /* Host pointer to the ION allocated memory */
+ void* ion_hostptr;
+
+} cl_mem_ion_host_ptr;
+
+#endif /* CL_VERSION_1_1 */
+
+#if defined(CL_VERSION_1_2)
+
+/******************************************
+ * cl_img_yuv_image extension *
+ ******************************************/
+
+/* Image formats used in clCreateImage */
+#define CL_NV21_IMG 0x40D0
+#define CL_YV12_IMG 0x40D1
+
+/******************************************
+ * cl_img_cached_allocations extension *
+ ******************************************/
+
+/* Flag values used by clCreteBuffer */
+#define CL_MEM_USE_UNCACHED_CPU_MEMORY_IMG (1 << 26)
+#define CL_MEM_USE_CACHED_CPU_MEMORY_IMG (1 << 27)
+
+/******************************************
+ * cl_img_use_gralloc_ptr extension *
+ ******************************************/
+
+/* Flag values used by clCreteBuffer */
+#define CL_MEM_USE_GRALLOC_PTR_IMG (1 << 28)
+
+/* To be used by clGetEventInfo: */
+#define CL_COMMAND_ACQUIRE_GRALLOC_OBJECTS_IMG 0x40D2
+#define CL_COMMAND_RELEASE_GRALLOC_OBJECTS_IMG 0x40D3
+
+/* Error code from clEnqueueReleaseGrallocObjectsIMG */
+#define CL_GRALLOC_RESOURCE_NOT_ACQUIRED_IMG 0x40D4
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clEnqueueAcquireGrallocObjectsIMG(cl_command_queue /* command_queue */,
+ cl_uint /* num_objects */,
+ const cl_mem * /* mem_objects */,
+ cl_uint /* num_events_in_wait_list */,
+ const cl_event * /* event_wait_list */,
+ cl_event * /* event */) CL_EXT_SUFFIX__VERSION_1_2;
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clEnqueueReleaseGrallocObjectsIMG(cl_command_queue /* command_queue */,
+ cl_uint /* num_objects */,
+ const cl_mem * /* mem_objects */,
+ cl_uint /* num_events_in_wait_list */,
+ const cl_event * /* event_wait_list */,
+ cl_event * /* event */) CL_EXT_SUFFIX__VERSION_1_2;
#endif /* CL_VERSION_1_2 */
-
#ifdef CL_VERSION_2_0
/*********************************
-* cl_khr_sub_groups extension
+* cl_khr_subgroups extension
*********************************/
-#define cl_khr_sub_groups 1
+#define cl_khr_subgroups 1
typedef cl_uint cl_kernel_sub_group_info;
-/* cl_khr_sub_group_info */
-#define CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE_KHR 0x2033
-#define CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE_KHR 0x2034
+/* cl_kernel_sub_group_info */
+#define CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE_KHR 0x2033
+#define CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE_KHR 0x2034
extern CL_API_ENTRY cl_int CL_API_CALL
clGetKernelSubGroupInfoKHR(cl_kernel /* in_kernel */,
- cl_device_id /*in_device*/,
- cl_kernel_sub_group_info /* param_name */,
- size_t /*input_value_size*/,
- const void * /*input_value*/,
- size_t /*param_value_size*/,
- void* /*param_value*/,
- size_t* /*param_value_size_ret*/ ) CL_EXT_SUFFIX__VERSION_2_0;
-
+ cl_device_id /*in_device*/,
+ cl_kernel_sub_group_info /* param_name */,
+ size_t /*input_value_size*/,
+ const void * /*input_value*/,
+ size_t /*param_value_size*/,
+ void* /*param_value*/,
+ size_t* /*param_value_size_ret*/ ) CL_EXT_SUFFIX__VERSION_2_0;
+
typedef CL_API_ENTRY cl_int
( CL_API_CALL * clGetKernelSubGroupInfoKHR_fn)(cl_kernel /* in_kernel */,
- cl_device_id /*in_device*/,
- cl_kernel_sub_group_info /* param_name */,
- size_t /*input_value_size*/,
- const void * /*input_value*/,
- size_t /*param_value_size*/,
- void* /*param_value*/,
- size_t* /*param_value_size_ret*/ ) CL_EXT_SUFFIX__VERSION_2_0;
+ cl_device_id /*in_device*/,
+ cl_kernel_sub_group_info /* param_name */,
+ size_t /*input_value_size*/,
+ const void * /*input_value*/,
+ size_t /*param_value_size*/,
+ void* /*param_value*/,
+ size_t* /*param_value_size_ret*/ ) CL_EXT_SUFFIX__VERSION_2_0;
#endif /* CL_VERSION_2_0 */
-#ifdef CL_VERSION_2_0
-/*********************************
-* cl_khr_il_program extension
-*********************************/
-#define cl_khr_il_program 1
-extern CL_API_ENTRY cl_program CL_API_CALL
-clCreateProgramWithILKHR(cl_context /* context */,
- const void * /* strings */,
- size_t /* lengths */,
- cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_2_0;
-typedef CL_API_ENTRY cl_program
- ( CL_API_CALL * clCreateProgramWithILKHR_fn)(cl_context /* context */,
- const void * /* strings */,
- size_t /* lengths */,
- cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_2_0;
+/******************************************
+ * cl_arm_shared_virtual_memory extension *
+ ******************************************/
-#endif /* CL_VERSION_2_0 */
+#ifdef CL_VERSION_1_2
+
+/* Used by clGetDeviceInfo */
+#define CL_DEVICE_SVM_CAPABILITIES_ARM 0x40B6
+
+/* Used by clGetMemObjectInfo */
+#define CL_MEM_USES_SVM_POINTER_ARM 0x40B7
+
+/* Used by clSetKernelExecInfoARM: */
+#define CL_KERNEL_EXEC_INFO_SVM_PTRS_ARM 0x40B8
+#define CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM_ARM 0x40B9
+
+/* To be used by clGetEventInfo: */
+#define CL_COMMAND_SVM_FREE_ARM 0x40BA
+#define CL_COMMAND_SVM_MEMCPY_ARM 0x40BB
+#define CL_COMMAND_SVM_MEMFILL_ARM 0x40BC
+#define CL_COMMAND_SVM_MAP_ARM 0x40BD
+#define CL_COMMAND_SVM_UNMAP_ARM 0x40BE
+
+/* Flag values returned by clGetDeviceInfo with CL_DEVICE_SVM_CAPABILITIES_ARM as the param_name. */
+#define CL_DEVICE_SVM_COARSE_GRAIN_BUFFER_ARM (1 << 0)
+#define CL_DEVICE_SVM_FINE_GRAIN_BUFFER_ARM (1 << 1)
+#define CL_DEVICE_SVM_FINE_GRAIN_SYSTEM_ARM (1 << 2)
+#define CL_DEVICE_SVM_ATOMICS_ARM (1 << 3)
+
+/* Flag values used by clSVMAllocARM: */
+#define CL_MEM_SVM_FINE_GRAIN_BUFFER_ARM (1 << 10)
+#define CL_MEM_SVM_ATOMICS_ARM (1 << 11)
+
+typedef cl_bitfield cl_svm_mem_flags_arm;
+typedef cl_uint cl_kernel_exec_info_arm;
+typedef cl_bitfield cl_device_svm_capabilities_arm;
+
+extern CL_API_ENTRY void * CL_API_CALL
+clSVMAllocARM(cl_context /* context */,
+ cl_svm_mem_flags_arm /* flags */,
+ size_t /* size */,
+ cl_uint /* alignment */) CL_EXT_SUFFIX__VERSION_1_2;
+
+extern CL_API_ENTRY void CL_API_CALL
+clSVMFreeARM(cl_context /* context */,
+ void * /* svm_pointer */) CL_EXT_SUFFIX__VERSION_1_2;
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clEnqueueSVMFreeARM(cl_command_queue /* command_queue */,
+ cl_uint /* num_svm_pointers */,
+ void *[] /* svm_pointers[] */,
+ void (CL_CALLBACK * /*pfn_free_func*/)(cl_command_queue /* queue */,
+ cl_uint /* num_svm_pointers */,
+ void *[] /* svm_pointers[] */,
+ void * /* user_data */),
+ void * /* user_data */,
+ cl_uint /* num_events_in_wait_list */,
+ const cl_event * /* event_wait_list */,
+ cl_event * /* event */) CL_EXT_SUFFIX__VERSION_1_2;
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clEnqueueSVMMemcpyARM(cl_command_queue /* command_queue */,
+ cl_bool /* blocking_copy */,
+ 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 */) CL_EXT_SUFFIX__VERSION_1_2;
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clEnqueueSVMMemFillARM(cl_command_queue /* command_queue */,
+ void * /* svm_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 */) CL_EXT_SUFFIX__VERSION_1_2;
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clEnqueueSVMMapARM(cl_command_queue /* command_queue */,
+ cl_bool /* blocking_map */,
+ cl_map_flags /* flags */,
+ void * /* svm_ptr */,
+ size_t /* size */,
+ cl_uint /* num_events_in_wait_list */,
+ const cl_event * /* event_wait_list */,
+ cl_event * /* event */) CL_EXT_SUFFIX__VERSION_1_2;
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clEnqueueSVMUnmapARM(cl_command_queue /* command_queue */,
+ void * /* svm_ptr */,
+ cl_uint /* num_events_in_wait_list */,
+ const cl_event * /* event_wait_list */,
+ cl_event * /* event */) CL_EXT_SUFFIX__VERSION_1_2;
+
+extern CL_API_ENTRY cl_int CL_API_CALL
+clSetKernelArgSVMPointerARM(cl_kernel /* kernel */,
+ cl_uint /* arg_index */,
+ const void * /* arg_value */) CL_EXT_SUFFIX__VERSION_1_2;
+extern CL_API_ENTRY cl_int CL_API_CALL
+clSetKernelExecInfoARM(cl_kernel /* kernel */,
+ cl_kernel_exec_info_arm /* param_name */,
+ size_t /* param_value_size */,
+ const void * /* param_value */) CL_EXT_SUFFIX__VERSION_1_2;
+
+#endif /* CL_VERSION_1_2 */
+
+/**********************************
+ * cl_arm_import_memory extension *
+ **********************************/
+
+#ifdef CL_VERSION_1_0
+
+typedef intptr_t cl_import_properties_arm;
+
+/* Default and valid proporties name for cl_arm_import_memory */
+#define CL_IMPORT_TYPE_ARM 0x40B2
+
+/* Host process memory type default value for CL_IMPORT_TYPE_ARM property */
+#define CL_IMPORT_TYPE_HOST_ARM 0x40B3
+
+/* DMA BUF memory type value for CL_IMPORT_TYPE_ARM property */
+#define CL_IMPORT_TYPE_DMA_BUF_ARM 0x40B4
+
+/* Secure DMA BUF memory type value for CL_IMPORT_TYPE_ARM property */
+#define CL_IMPORT_TYPE_SECURE_ARM 0x40B5
+
+/* This extension adds a new function that allows for direct memory import into
+ * OpenCL via the clImportMemoryARM function.
+ *
+ * Memory imported through this interface will be mapped into the device's page
+ * tables directly, providing zero copy access. It will never fall back to copy
+ * operations and aliased buffers.
+ *
+ * Types of memory supported for import are specified as additional extension
+ * strings.
+ *
+ * This extension produces cl_mem allocations which are compatible with all other
+ * users of cl_mem in the standard API.
+ *
+ * This extension maps pages with the same properties as the normal buffer creation
+ * function clCreateBuffer.
+ */
+extern CL_API_ENTRY cl_mem CL_API_CALL
+clImportMemoryARM( cl_context context,
+ cl_mem_flags flags,
+ const cl_import_properties_arm *properties,
+ void *memory,
+ size_t size,
+ cl_int *errcode_ret) CL_EXT_SUFFIX__VERSION_1_0;
+
+
+#endif /* CL_VERSION_1_0 */
#ifdef __cplusplus
}
diff --git a/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_gl.h b/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_gl.h
index 04080937a2..945daa83d7 100644
--- a/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_gl.h
+++ b/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_gl.h
@@ -1,5 +1,5 @@
/**********************************************************************************
- * Copyright (c) 2008 - 2013 The Khronos Group Inc.
+ * Copyright (c) 2008-2015 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
@@ -12,6 +12,11 @@
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
+ * 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.
diff --git a/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_gl_ext.h b/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_gl_ext.h
index a46e0a2e0b..e3c14c6408 100644
--- a/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_gl_ext.h
+++ b/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_gl_ext.h
@@ -1,5 +1,5 @@
/**********************************************************************************
- * Copyright (c) 2008-2013 The Khronos Group Inc.
+ * Copyright (c) 2008-2015 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
@@ -12,6 +12,11 @@
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
+ * 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.
diff --git a/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_platform.h b/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_platform.h
index f8ec6167a0..e204e61b86 100644
--- a/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_platform.h
+++ b/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_platform.h
@@ -1,5 +1,5 @@
/**********************************************************************************
- * Copyright (c) 2008-2013 The Khronos Group Inc.
+ * Copyright (c) 2008-2015 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
@@ -12,6 +12,11 @@
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
+ * 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.
@@ -21,7 +26,7 @@
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
**********************************************************************************/
-/* $Revision: 14829 $ on $Date: 2011-05-26 08:22:50 -0700 (Thu, 26 May 2011) $ */
+/* $Revision: 11803 $ on $Date: 2010-06-25 10:02:12 -0700 (Fri, 25 Jun 2010) $ */
#ifndef __CL_PLATFORM_H
#define __CL_PLATFORM_H
@@ -35,7 +40,7 @@
extern "C" {
#endif
-#if defined(_WIN32) || defined(__CYGWIN__)
+#if defined(_WIN32)
#define CL_API_ENTRY
#define CL_API_CALL __stdcall
#define CL_CALLBACK __stdcall
@@ -85,10 +90,6 @@ extern "C" {
#define CL_EXT_SUFFIX__VERSION_1_2
#define CL_API_SUFFIX__VERSION_2_0
#define CL_EXT_SUFFIX__VERSION_2_0
- #define CL_API_SUFFIX__VERSION_2_1
- #define CL_EXT_SUFFIX__VERSION_2_1
- #define CL_API_SUFFIX__VERSION_2_2
- #define CL_EXT_SUFFIX__VERSION_2_2
#ifdef __GNUC__
#ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS
@@ -114,7 +115,7 @@ extern "C" {
#define CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED __attribute__((deprecated))
#define CL_EXT_PREFIX__VERSION_1_2_DEPRECATED
#endif
- #elif _WIN32
+ #elif defined(_WIN32)
#ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS
#define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED
#define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED
@@ -192,7 +193,18 @@ typedef double cl_double;
#define CL_FLT_RADIX 2
#define CL_FLT_MAX 340282346638528859811704183484516925440.0f
#define CL_FLT_MIN 1.175494350822287507969e-38f
-#define CL_FLT_EPSILON 0.00000011920928955078125f
+#define CL_FLT_EPSILON 1.1920928955078125e-7f
+
+#define CL_HALF_DIG 3
+#define CL_HALF_MANT_DIG 11
+#define CL_HALF_MAX_10_EXP +4
+#define CL_HALF_MAX_EXP +16
+#define CL_HALF_MIN_10_EXP -4
+#define CL_HALF_MIN_EXP -13
+#define CL_HALF_RADIX 2
+#define CL_HALF_MAX 65504.0f
+#define CL_HALF_MIN 6.103515625e-05f
+#define CL_HALF_EPSILON 9.765625e-04f
#define CL_DBL_DIG 15
#define CL_DBL_MANT_DIG 53
@@ -201,37 +213,37 @@ typedef double cl_double;
#define CL_DBL_MIN_10_EXP -307
#define CL_DBL_MIN_EXP -1021
#define CL_DBL_RADIX 2
-#define CL_DBL_MAX 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0
+#define CL_DBL_MAX 1.7976931348623158e+308
#define CL_DBL_MIN 2.225073858507201383090e-308
#define CL_DBL_EPSILON 2.220446049250313080847e-16
-#define CL_M_E 2.718281828459045090796
-#define CL_M_LOG2E 1.442695040888963387005
-#define CL_M_LOG10E 0.434294481903251816668
-#define CL_M_LN2 0.693147180559945286227
-#define CL_M_LN10 2.302585092994045901094
-#define CL_M_PI 3.141592653589793115998
-#define CL_M_PI_2 1.570796326794896557999
-#define CL_M_PI_4 0.785398163397448278999
-#define CL_M_1_PI 0.318309886183790691216
-#define CL_M_2_PI 0.636619772367581382433
-#define CL_M_2_SQRTPI 1.128379167095512558561
-#define CL_M_SQRT2 1.414213562373095145475
-#define CL_M_SQRT1_2 0.707106781186547572737
+#define CL_M_E 2.7182818284590452354
+#define CL_M_LOG2E 1.4426950408889634074
+#define CL_M_LOG10E 0.43429448190325182765
+#define CL_M_LN2 0.69314718055994530942
+#define CL_M_LN10 2.30258509299404568402
+#define CL_M_PI 3.14159265358979323846
+#define CL_M_PI_2 1.57079632679489661923
+#define CL_M_PI_4 0.78539816339744830962
+#define CL_M_1_PI 0.31830988618379067154
+#define CL_M_2_PI 0.63661977236758134308
+#define CL_M_2_SQRTPI 1.12837916709551257390
+#define CL_M_SQRT2 1.41421356237309504880
+#define CL_M_SQRT1_2 0.70710678118654752440
-#define CL_M_E_F 2.71828174591064f
-#define CL_M_LOG2E_F 1.44269502162933f
-#define CL_M_LOG10E_F 0.43429449200630f
-#define CL_M_LN2_F 0.69314718246460f
-#define CL_M_LN10_F 2.30258512496948f
-#define CL_M_PI_F 3.14159274101257f
-#define CL_M_PI_2_F 1.57079637050629f
-#define CL_M_PI_4_F 0.78539818525314f
-#define CL_M_1_PI_F 0.31830987334251f
-#define CL_M_2_PI_F 0.63661974668503f
-#define CL_M_2_SQRTPI_F 1.12837922573090f
-#define CL_M_SQRT2_F 1.41421353816986f
-#define CL_M_SQRT1_2_F 0.70710676908493f
+#define CL_M_E_F 2.718281828f
+#define CL_M_LOG2E_F 1.442695041f
+#define CL_M_LOG10E_F 0.434294482f
+#define CL_M_LN2_F 0.693147181f
+#define CL_M_LN10_F 2.302585093f
+#define CL_M_PI_F 3.141592654f
+#define CL_M_PI_2_F 1.570796327f
+#define CL_M_PI_4_F 0.785398163f
+#define CL_M_1_PI_F 0.318309886f
+#define CL_M_2_PI_F 0.636619772f
+#define CL_M_2_SQRTPI_F 1.128379167f
+#define CL_M_SQRT2_F 1.414213562f
+#define CL_M_SQRT1_2_F 0.707106781f
#define CL_NAN (CL_INFINITY - CL_INFINITY)
#define CL_HUGE_VALF ((cl_float) 1e50)
@@ -281,9 +293,20 @@ typedef double cl_double __attribute__((aligned(8)));
#define CL_FLT_MIN_10_EXP -37
#define CL_FLT_MIN_EXP -125
#define CL_FLT_RADIX 2
-#define CL_FLT_MAX 0x1.fffffep127f
-#define CL_FLT_MIN 0x1.0p-126f
-#define CL_FLT_EPSILON 0x1.0p-23f
+#define CL_FLT_MAX 340282346638528859811704183484516925440.0f
+#define CL_FLT_MIN 1.175494350822287507969e-38f
+#define CL_FLT_EPSILON 1.1920928955078125e-7f
+
+#define CL_HALF_DIG 3
+#define CL_HALF_MANT_DIG 11
+#define CL_HALF_MAX_10_EXP +4
+#define CL_HALF_MAX_EXP +16
+#define CL_HALF_MIN_10_EXP -4
+#define CL_HALF_MIN_EXP -13
+#define CL_HALF_RADIX 2
+#define CL_HALF_MAX 65504.0f
+#define CL_HALF_MIN 6.103515625e-05f
+#define CL_HALF_EPSILON 9.765625e-04f
#define CL_DBL_DIG 15
#define CL_DBL_MANT_DIG 53
@@ -292,37 +315,37 @@ typedef double cl_double __attribute__((aligned(8)));
#define CL_DBL_MIN_10_EXP -307
#define CL_DBL_MIN_EXP -1021
#define CL_DBL_RADIX 2
-#define CL_DBL_MAX 0x1.fffffffffffffp1023
-#define CL_DBL_MIN 0x1.0p-1022
-#define CL_DBL_EPSILON 0x1.0p-52
+#define CL_DBL_MAX 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0
+#define CL_DBL_MIN 2.225073858507201383090e-308
+#define CL_DBL_EPSILON 2.220446049250313080847e-16
-#define CL_M_E 2.718281828459045090796
-#define CL_M_LOG2E 1.442695040888963387005
-#define CL_M_LOG10E 0.434294481903251816668
-#define CL_M_LN2 0.693147180559945286227
-#define CL_M_LN10 2.302585092994045901094
-#define CL_M_PI 3.141592653589793115998
-#define CL_M_PI_2 1.570796326794896557999
-#define CL_M_PI_4 0.785398163397448278999
-#define CL_M_1_PI 0.318309886183790691216
-#define CL_M_2_PI 0.636619772367581382433
-#define CL_M_2_SQRTPI 1.128379167095512558561
-#define CL_M_SQRT2 1.414213562373095145475
-#define CL_M_SQRT1_2 0.707106781186547572737
+#define CL_M_E 2.7182818284590452354
+#define CL_M_LOG2E 1.4426950408889634074
+#define CL_M_LOG10E 0.43429448190325182765
+#define CL_M_LN2 0.69314718055994530942
+#define CL_M_LN10 2.30258509299404568402
+#define CL_M_PI 3.14159265358979323846
+#define CL_M_PI_2 1.57079632679489661923
+#define CL_M_PI_4 0.78539816339744830962
+#define CL_M_1_PI 0.31830988618379067154
+#define CL_M_2_PI 0.63661977236758134308
+#define CL_M_2_SQRTPI 1.12837916709551257390
+#define CL_M_SQRT2 1.41421356237309504880
+#define CL_M_SQRT1_2 0.70710678118654752440
-#define CL_M_E_F 2.71828174591064f
-#define CL_M_LOG2E_F 1.44269502162933f
-#define CL_M_LOG10E_F 0.43429449200630f
-#define CL_M_LN2_F 0.69314718246460f
-#define CL_M_LN10_F 2.30258512496948f
-#define CL_M_PI_F 3.14159274101257f
-#define CL_M_PI_2_F 1.57079637050629f
-#define CL_M_PI_4_F 0.78539818525314f
-#define CL_M_1_PI_F 0.31830987334251f
-#define CL_M_2_PI_F 0.63661974668503f
-#define CL_M_2_SQRTPI_F 1.12837922573090f
-#define CL_M_SQRT2_F 1.41421353816986f
-#define CL_M_SQRT1_2_F 0.70710676908493f
+#define CL_M_E_F 2.718281828f
+#define CL_M_LOG2E_F 1.442695041f
+#define CL_M_LOG10E_F 0.434294482f
+#define CL_M_LN2_F 0.693147181f
+#define CL_M_LN10_F 2.302585093f
+#define CL_M_PI_F 3.141592654f
+#define CL_M_PI_2_F 1.570796327f
+#define CL_M_PI_4_F 0.785398163f
+#define CL_M_1_PI_F 0.318309886f
+#define CL_M_2_PI_F 0.636619772f
+#define CL_M_2_SQRTPI_F 1.128379167f
+#define CL_M_SQRT2_F 1.414213562f
+#define CL_M_SQRT1_2_F 0.707106781f
#if defined( __GNUC__ )
#define CL_HUGE_VALF __builtin_huge_valf()
@@ -387,7 +410,7 @@ typedef unsigned int cl_GLenum;
#else
#include
#endif
- #if defined( __GNUC__ ) && !defined( __ICC )
+ #if defined( __GNUC__ )
typedef float __cl_float4 __attribute__((vector_size(16)));
#else
typedef __m128 __cl_float4;
@@ -401,7 +424,7 @@ typedef unsigned int cl_GLenum;
#else
#include
#endif
- #if defined( __GNUC__ ) && !defined( __ICC )
+ #if defined( __GNUC__ )
typedef cl_uchar __cl_uchar16 __attribute__((vector_size(16)));
typedef cl_char __cl_char16 __attribute__((vector_size(16)));
typedef cl_ushort __cl_ushort8 __attribute__((vector_size(16)));
@@ -435,7 +458,7 @@ typedef unsigned int cl_GLenum;
#if defined( __MMX__ )
#include
- #if defined( __GNUC__ ) && !defined( __ICC )
+ #if defined( __GNUC__ )
typedef cl_uchar __cl_uchar8 __attribute__((vector_size(8)));
typedef cl_char __cl_char8 __attribute__((vector_size(8)));
typedef cl_ushort __cl_ushort4 __attribute__((vector_size(8)));
@@ -473,7 +496,7 @@ typedef unsigned int cl_GLenum;
#else
#include