Add OpenCL 2.2 API to ICD Loader.
authorbashbaug <ben.ashbaugh@intel.com>
Tue, 6 Dec 2016 18:34:24 +0000 (10:34 -0800)
committerKedar Patil <kepatil@nvidia.com>
Tue, 16 May 2017 14:05:19 +0000 (19:35 +0530)
OpenCL.def
icd_dispatch.c
icd_dispatch.h
icd_exports.map

index 7e40399..0871522 100644 (file)
@@ -174,3 +174,8 @@ clGetDeviceAndHostTimer
 clGetHostTimer
 clGetKernelSubGroupInfo
 clSetDefaultDeviceCommandQueue
+
+; OpenCL 2.2 API
+clSetProgramReleaseCallback
+clSetProgramSpecializationConstant
+
index db6835a..c329cd6 100644 (file)
@@ -584,6 +584,32 @@ clLinkProgram(cl_context           context,
 }
 
 CL_API_ENTRY cl_int CL_API_CALL
+clSetProgramSpecializationConstant(cl_program  program,
+                                   cl_uint     spec_id,
+                                   size_t      spec_size,
+                                   const void* spec_value) CL_API_SUFFIX__VERSION_2_2
+{
+    KHR_ICD_VALIDATE_HANDLE_RETURN_ERROR(program, CL_INVALID_PROGRAM);
+    return program->dispatch->clSetProgramSpecializationConstant(
+        program,
+        spec_id,
+        spec_size,
+        spec_value); 
+}
+
+CL_API_ENTRY cl_int CL_API_CALL
+clSetProgramReleaseCallback(cl_program  program,
+                            void (CL_CALLBACK * pfn_notify)(cl_program program, void * user_data),
+                            void *              user_data) CL_API_SUFFIX__VERSION_2_2
+{
+    KHR_ICD_VALIDATE_HANDLE_RETURN_ERROR(program, CL_INVALID_PROGRAM);
+    return program->dispatch->clSetProgramReleaseCallback(
+        program,
+        pfn_notify,
+        user_data); 
+}
+
+CL_API_ENTRY cl_int CL_API_CALL
 clUnloadPlatformCompiler(cl_platform_id platform) CL_API_SUFFIX__VERSION_1_2
 {
     // initialize the platforms (in case they have not been already)
index 59d0213..7bc54ac 100644 (file)
 #define CL_USE_DEPRECATED_OPENCL_1_2_APIS
 #endif
 
+#ifndef CL_USE_DEPRECATED_OPENCL_2_0_APIS
+#define CL_USE_DEPRECATED_OPENCL_2_0_APIS
+#endif
+
 // cl.h
 #include <CL/cl.h>
 
@@ -323,6 +327,17 @@ typedef CL_API_ENTRY cl_program (CL_API_CALL *KHRpfn_clLinkProgram)(
     void *               user_data,
     cl_int *             errcode_ret) CL_API_SUFFIX__VERSION_1_2;
 
+typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clSetProgramSpecializationConstant)(
+    cl_program           program,
+    cl_uint              spec_id,
+    size_t               spec_size,
+    const void*          spec_value) CL_API_SUFFIX__VERSION_2_2;
+
+typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clSetProgramReleaseCallback)(
+    cl_program           program,
+    void (CL_CALLBACK *  pfn_notify)(cl_program program, void * user_data),
+    void *               user_data) CL_API_SUFFIX__VERSION_2_2;
+
 typedef CL_API_ENTRY cl_int (CL_API_CALL *KHRpfn_clUnloadPlatformCompiler)(
     cl_platform_id     platform) CL_API_SUFFIX__VERSION_1_2;
 
@@ -1459,6 +1474,10 @@ struct KHRicdVendorDispatchRec
     KHRpfn_clGetHostTimer                           clGetHostTimer;
     KHRpfn_clGetKernelSubGroupInfo                  clGetKernelSubGroupInfo;
     KHRpfn_clSetDefaultDeviceCommandQueue           clSetDefaultDeviceCommandQueue;
+
+    /* OpenCL 2.2 */
+    KHRpfn_clSetProgramReleaseCallback              clSetProgramReleaseCallback;
+    KHRpfn_clSetProgramSpecializationConstant       clSetProgramSpecializationConstant;
 };
 
 /*
index 051f6b4..60211e5 100644 (file)
@@ -177,3 +177,8 @@ OPENCL_2.1 {
         clSetDefaultDeviceCommandQueue;
 } OPENCL_2.0;
 
+OPENCL_2.2 {
+    global:
+        clSetProgramReleaseCallback;
+        clSetProgramSpecializationConstant;
+} OPENCL_2.1;