[khronos-opencl-headers] 53/94: Imported Upstream version 1.2-2013.02.12

Andreas Beckmann anbe at moszumanska.debian.org
Mon Sep 21 02:39:06 UTC 2015


This is an automated email from the git hooks/post-receive script.

anbe pushed a commit to branch master
in repository khronos-opencl-headers.

commit 9c3c47c821022c2da893c0d067e82b88d95fb673
Author: Andreas Beckmann <anbe at debian.org>
Date:   Sun Apr 28 01:11:59 2013 +0200

    Imported Upstream version 1.2-2013.02.12
---
 cl.hpp   | 104 ++++++++++++++++++++++++++++++++++-----------------------------
 cl_ext.h |   4 +--
 cl_gl.h  |   1 +
 3 files changed, 59 insertions(+), 50 deletions(-)

diff --git a/cl.hpp b/cl.hpp
index 806e736..06448e2 100644
--- a/cl.hpp
+++ b/cl.hpp
@@ -29,11 +29,10 @@
  *   
  *   Additions and fixes from:
  *       Brian Cole, March 3rd 2010 and April 2012 
- *       Lee Howes, October 2011, March 2012
  *       Matt Gruenke, April 2012.
  *   
- *   \version 1.2.1
- *   \date September 2012
+ *   \version 1.2.4
+ *   \date January 2013
  *
  *   Optional extension support
  *
@@ -168,12 +167,6 @@
 #include <CL/cl_ext.h>
 #endif
 
-// TODO: Remove once declaration is moved elsewhere
-//#if !defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS)
-//#define CL_USE_DEPRECATED_OPENCL_1_1_APIS 
-//#endif // #if !defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS)
-
-
 #if defined(__APPLE__) || defined(__MACOSX)
 #include <OpenGL/OpenGL.h>
 #include <OpenCL/opencl.h>
@@ -393,7 +386,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 __SET_PRINTF_CALLBACK_ERR           __ERR_STR(clSetPrintfCallback)
+
 #endif // #if defined(CL_VERSION_1_2)
 #define __CREATE_KERNELS_IN_PROGRAM_ERR     __ERR_STR(clCreateKernelsInProgram)
 
@@ -433,7 +426,7 @@ static inline cl_int errHandler (cl_int err, const char * errStr = NULL)
 #define __VECTOR_CAPACITY_ERR               __ERR_STR(Vector capacity error)
 
 /**
- * CL 1.1 version that uses device fission.
+ * CL 1.2 version that uses device fission.
  */
 #if defined(CL_VERSION_1_2)
 #define __CREATE_SUB_DEVICES                __ERR_STR(clCreateSubDevices)
@@ -458,6 +451,13 @@ static inline cl_int errHandler (cl_int err, const char * errStr = NULL)
 #endif // __CL_USER_OVERRIDE_ERROR_STRINGS
 //! \endcond
 
+/**
+ * CL 1.2 marker and barrier commands
+ */
+#if defined(CL_VERSION_1_2)
+#define __ENQUEUE_MARKER_WAIT_LIST_ERR                __ERR_STR(clEnqueueMarkerWithWaitList)
+#define __ENQUEUE_BARRIER_WAIT_LIST_ERR               __ERR_STR(clEnqueueBarrierWithWaitList)
+#endif // #if defined(CL_VERSION_1_2)
 
 #if !defined(__USE_DEV_STRING) && !defined(__NO_STD_STRING)
 typedef std::string STRING_CLASS;
@@ -623,10 +623,8 @@ public:
     //! \brief Destructor - frees memory used to hold the current value.
     ~string()
     {
-        if (str_ != NULL) {
-            delete[] str_;
-            str_ = NULL;
-        }
+        delete[] str_;
+        str_ = NULL;
     }
     
     //! \brief Queries the length of the string, excluding any added '\0's.
@@ -2327,9 +2325,16 @@ public:
         cl_int* err = NULL)
     {
         cl_int error;
+
+        ::size_t numDevices = devices.size();
+        cl_device_id* deviceIDs = (cl_device_id*) alloca(numDevices * sizeof(cl_device_id));
+        for( ::size_t deviceIndex = 0; deviceIndex < numDevices; ++deviceIndex ) {
+            deviceIDs[deviceIndex] = (devices[deviceIndex])();
+        }
+
         object_ = ::clCreateContext(
-            properties, (cl_uint) devices.size(),
-            (cl_device_id*) &devices.front(),
+            properties, (cl_uint) numDevices,
+            deviceIDs,
             notifyFptr, data, &error);
 
         detail::errHandler(error, __CREATE_CONTEXT_ERR);
@@ -2350,9 +2355,12 @@ public:
         cl_int* err = NULL)
     {
         cl_int error;
+
+        cl_device_id deviceID = device();
+
         object_ = ::clCreateContext(
             properties, 1,
-            (cl_device_id*) &device,
+            &deviceID,
             notifyFptr, data, &error);
 
         detail::errHandler(error, __CREATE_CONTEXT_ERR);
@@ -2554,25 +2562,6 @@ public:
         formats->assign(&value[0], &value[numEntries]);
         return CL_SUCCESS;
     }
-
-
-#if defined(CL_VERSION_1_2)
-    cl_int setPrintfCallback(
-        void (CL_CALLBACK * pfn_notify)(
-            cl_context /* program */, 
-            cl_uint /*printf_data_len */, 
-            char * /* printf_data_ptr */, 
-            void * /* user_data */),
-        void * user_data )
-    {
-        return detail::errHandler(
-            ::clSetPrintfCallback(
-                object_,
-                pfn_notify,
-                user_data), 
-            __SET_PRINTF_CALLBACK_ERR);
-    }
-#endif // #if defined(CL_VERSION_1_2)
 };
 
 inline Device Device::getDefault(cl_int * err)
@@ -3016,7 +3005,7 @@ public:
     Buffer(
         IteratorType startIterator,
         IteratorType endIterator,
-        bool readOnly = false,
+        bool readOnly,
         bool useHostPtr = false,
         cl_int* err = NULL)
     {
@@ -4121,14 +4110,14 @@ public:
     ImageGL& operator = (const ImageGL& rhs)
     {
         if (this != &rhs) {
-            ImageGL::operator=(rhs);
+            Image::operator=(rhs);
         }
         return *this;
     }
 
     ImageGL& operator = (const cl_mem& rhs)
     {
-        ImageGL::operator=(rhs);
+        Image::operator=(rhs);
         return *this;
     }
 };
@@ -4443,7 +4432,7 @@ public:
     {
         typename detail::param_traits<
             detail::cl_kernel_arg_info, name>::param_type param;
-        cl_int result = getArgInfo(name, argIndex, &param);
+        cl_int result = getArgInfo(argIndex, name, &param);
         if (err != NULL) {
             *err = result;
         }
@@ -4650,9 +4639,15 @@ public:
             lengths[i] = binaries[(int)i].second;
         }
 
+        ::size_t numDevices = devices.size();
+        cl_device_id* deviceIDs = (cl_device_id*) alloca(numDevices * sizeof(cl_device_id));
+        for( ::size_t deviceIndex = 0; deviceIndex < numDevices; ++deviceIndex ) {
+            deviceIDs[deviceIndex] = (devices[deviceIndex])();
+        }
+
         object_ = ::clCreateProgramWithBinary(
             context(), (cl_uint) devices.size(),
-            (cl_device_id*)&devices.front(),
+            deviceIDs,
             lengths, images, binaryStatus != NULL
                ? (cl_int*) &binaryStatus->front()
                : NULL, &error);
@@ -4676,11 +4671,18 @@ public:
         cl_int* err = NULL)
     {
         cl_int error;
+
+
+        ::size_t numDevices = devices.size();
+        cl_device_id* deviceIDs = (cl_device_id*) alloca(numDevices * sizeof(cl_device_id));
+        for( ::size_t deviceIndex = 0; deviceIndex < numDevices; ++deviceIndex ) {
+            deviceIDs[deviceIndex] = (devices[deviceIndex])();
+        }
         
         object_ = ::clCreateProgramWithBuiltInKernels(
             context(), 
             (cl_uint) devices.size(),
-            (cl_device_id*)&devices.front(),
+            deviceIDs,
             kernelNames.c_str(), 
             &error);
 
@@ -4717,12 +4719,18 @@ public:
         void (CL_CALLBACK * notifyFptr)(cl_program, void *) = NULL,
         void* data = NULL) const
     {
+        ::size_t numDevices = devices.size();
+        cl_device_id* deviceIDs = (cl_device_id*) alloca(numDevices * sizeof(cl_device_id));
+        for( ::size_t deviceIndex = 0; deviceIndex < numDevices; ++deviceIndex ) {
+            deviceIDs[deviceIndex] = (devices[deviceIndex])();
+        }
+
         return detail::errHandler(
             ::clBuildProgram(
                 object_,
                 (cl_uint)
                 devices.size(),
-                (cl_device_id*)&devices.front(),
+                deviceIDs,
                 options,
                 notifyFptr,
                 data),
@@ -5668,7 +5676,7 @@ public:
                 (events != NULL) ? (cl_uint) events->size() : 0,
                 (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL,
                 (event != NULL) ? &tmp : NULL),
-            __ENQUEUE_UNMAP_MEM_OBJECT_ERR);
+            __ENQUEUE_MARKER_WAIT_LIST_ERR);
 
         if (event != NULL && err == CL_SUCCESS)
             *event = tmp;
@@ -5687,18 +5695,18 @@ public:
      * all events either in the event_wait_list or all previously enqueued commands, queued 
      * before this command to command_queue, have completed.
      */
-    cl_int clEnqueueBarrierWithWaitList(
+    cl_int enqueueBarrierWithWaitList(
         const VECTOR_CLASS<Event> *events = 0,
         Event *event = 0)
     {
         cl_event tmp;
         cl_int err = detail::errHandler(
-            ::clEnqueueMarkerWithWaitList(
+            ::clEnqueueBarrierWithWaitList(
                 object_,
                 (events != NULL) ? (cl_uint) events->size() : 0,
                 (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL,
                 (event != NULL) ? &tmp : NULL),
-            __ENQUEUE_UNMAP_MEM_OBJECT_ERR);
+            __ENQUEUE_BARRIER_WAIT_LIST_ERR);
 
         if (event != NULL && err == CL_SUCCESS)
             *event = tmp;
diff --git a/cl_ext.h b/cl_ext.h
index b4ea42c..632cb21 100644
--- a/cl_ext.h
+++ b/cl_ext.h
@@ -145,9 +145,9 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *clIcdGetPlatformIDsKHR_fn)(
 #define CL_CONTEXT_TERMINATE_KHR                    0x2010
 
 #define cl_khr_terminate_context 1
-extern CL_API_ENTRY cl_int CL_API_CALL clTerminateContextKHR(cl_context /* context */) CL_EXT_SUFFIX_VERSION_1_2;
+extern CL_API_ENTRY cl_int CL_API_CALL clTerminateContextKHR(cl_context /* context */) CL_EXT_SUFFIX__VERSION_1_2;
 
-typedef CL_API_ENTRY cl_int (CL_API_CALL *clTerminateContextKHR_fn)(cl_context /* context */) CL_EXT_SUFFIX_VERSION_1_2;
+typedef CL_API_ENTRY cl_int (CL_API_CALL *clTerminateContextKHR_fn)(cl_context /* context */) CL_EXT_SUFFIX__VERSION_1_2;
     
     
 /*
diff --git a/cl_gl.h b/cl_gl.h
index eb9ce5c..af2036c 100644
--- a/cl_gl.h
+++ b/cl_gl.h
@@ -52,6 +52,7 @@ typedef struct __GLsync *cl_GLsync;
 /* cl_gl_texture_info           */
 #define CL_GL_TEXTURE_TARGET                    0x2004
 #define CL_GL_MIPMAP_LEVEL                      0x2005
+#define CL_GL_NUM_SAMPLES                       0x2012
 
 
 extern CL_API_ENTRY cl_mem CL_API_CALL

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opencl/khronos-opencl-headers.git



More information about the Pkg-opencl-commits mailing list