From 40cc9aee95faff47f81ff0ad92088dc9f95093e0 Mon Sep 17 00:00:00 2001 From: jujiang Date: Wed, 1 Sep 2021 14:53:14 -0400 Subject: [PATCH] SWDEV-286322 - clean up trailing white space Change-Id: Ie47bc977e1598356b455957d96f9afa37794c1fd [ROCm/clr commit: 422a26142dbeac7b2145021e387de838aa042284] --- projects/clr/opencl/amdocl/cl_d3d10_amd.hpp | 2 +- projects/clr/opencl/amdocl/cl_d3d11_amd.hpp | 2 +- projects/clr/opencl/amdocl/cl_d3d9_amd.hpp | 4 +- .../khronos/headers/opencl1.2/CL/cl.hpp | 760 +++++++++--------- .../khronos/headers/opencl2.0/CL/cl.hpp | 760 +++++++++--------- .../khronos/headers/opencl2.0/CL/cl2.hpp | 702 ++++++++-------- .../khronos/headers/opencl2.1/CL/cl.hpp | 760 +++++++++--------- .../khronos/headers/opencl2.1/CL/cl2.hpp | 702 ++++++++-------- .../khronos/headers/opencl2.2/CL/cl.hpp | 760 +++++++++--------- .../khronos/headers/opencl2.2/CL/cl2.hpp | 702 ++++++++-------- projects/clr/opencl/khronos/icd/README.md | 2 +- projects/clr/opencl/khronos/icd/loader/icd.c | 8 +- .../opencl/khronos/icd/loader/icd_dispatch.c | 372 ++++----- .../khronos/icd/loader/linux/icd_linux.c | 6 +- .../khronos/icd/loader/windows/icd_windows.c | 10 +- .../opencl/khronos/icd/test/driver_stub/cl.c | 24 +- .../khronos/icd/test/driver_stub/cl_ext.c | 6 +- .../khronos/icd/test/driver_stub/cl_gl.c | 40 +- .../opencl/khronos/icd/test/driver_stub/icd.c | 4 +- .../khronos/icd/test/loader_test/callbacks.c | 30 +- .../khronos/icd/test/loader_test/main.c | 2 +- .../icd/test/loader_test/test_cl_runtime.c | 4 +- .../khronos/icd/test/loader_test/test_clgl.c | 108 +-- .../icd/test/loader_test/test_create_calls.c | 98 +-- .../icd/test/loader_test/test_image_objects.c | 24 +- .../icd/test/loader_test/test_kernel.c | 188 ++--- .../icd/test/loader_test/test_platforms.c | 88 +- .../test/loader_test/test_program_objects.c | 4 +- .../khronos/icd/test/log/icd_test_log.c | 4 +- .../clr/opencl/tests/ocltst/env/ocltst.cpp | 2 +- .../ocltst/module/runtime/OCLBlitKernel.cpp | 2 +- projects/clr/opencl/tools/cltrace/cltrace.cpp | 38 +- 32 files changed, 3109 insertions(+), 3109 deletions(-) diff --git a/projects/clr/opencl/amdocl/cl_d3d10_amd.hpp b/projects/clr/opencl/amdocl/cl_d3d10_amd.hpp index 09afaf9248..c0ef6adba2 100644 --- a/projects/clr/opencl/amdocl/cl_d3d10_amd.hpp +++ b/projects/clr/opencl/amdocl/cl_d3d10_amd.hpp @@ -159,7 +159,7 @@ public: UINT getDepth() const {return objDesc_.objSize_.Depth;} size_t getElementBytes(DXGI_FORMAT dxgiFomat); size_t getElementBytes() {return getElementBytes(objDesc_.dxgiFormat_);} - DXGI_FORMAT getDxgiFormat() {return objDesc_.dxgiFormat_;} + DXGI_FORMAT getDxgiFormat() {return objDesc_.dxgiFormat_;} UINT getSubresource() const {return subRes_;} const D3D10ObjDesc_t* getObjDesc() const { return &objDesc_; } diff --git a/projects/clr/opencl/amdocl/cl_d3d11_amd.hpp b/projects/clr/opencl/amdocl/cl_d3d11_amd.hpp index c6c7cfd71d..6112cb6a80 100644 --- a/projects/clr/opencl/amdocl/cl_d3d11_amd.hpp +++ b/projects/clr/opencl/amdocl/cl_d3d11_amd.hpp @@ -166,7 +166,7 @@ public: UINT getDepth() const {return objDesc_.objSize_.Depth;} size_t getElementBytes(DXGI_FORMAT dxgiFomat, cl_uint plane); size_t getElementBytes() {return getElementBytes(objDesc_.dxgiFormat_, plane_);} - DXGI_FORMAT getDxgiFormat() {return objDesc_.dxgiFormat_;} + DXGI_FORMAT getDxgiFormat() {return objDesc_.dxgiFormat_;} UINT getSubresource() const {return subRes_;} INT getPlane() const {return plane_;} const D3D11ObjDesc_t* getObjDesc() const { return &objDesc_; } diff --git a/projects/clr/opencl/amdocl/cl_d3d9_amd.hpp b/projects/clr/opencl/amdocl/cl_d3d9_amd.hpp index a3b598712a..c1967408af 100644 --- a/projects/clr/opencl/amdocl/cl_d3d9_amd.hpp +++ b/projects/clr/opencl/amdocl/cl_d3d9_amd.hpp @@ -131,7 +131,7 @@ public: //if the resouce is being used if(resources_.size()) { for(auto& it = resources_.cbegin(); it != resources_.cend(); it++) { - if( surfInfo_.resource && + if( surfInfo_.resource && ((*it).first.surfInfo.resource == surfInfo_.resource) && ((*it).first.surfPlane == surfPlane_)) { resources_.erase(it); @@ -141,7 +141,7 @@ public: } } } - static int initD3D9Object(const Context& amdContext, cl_dx9_media_adapter_type_khr adapter_type, + static int initD3D9Object(const Context& amdContext, cl_dx9_media_adapter_type_khr adapter_type, cl_dx9_surface_info_khr* cl_surf_info, cl_uint plane, D3D9Object& obj); cl_uint getMiscFlag(void); diff --git a/projects/clr/opencl/khronos/headers/opencl1.2/CL/cl.hpp b/projects/clr/opencl/khronos/headers/opencl1.2/CL/cl.hpp index 71e55e0678..f949a58691 100644 --- a/projects/clr/opencl/khronos/headers/opencl1.2/CL/cl.hpp +++ b/projects/clr/opencl/khronos/headers/opencl1.2/CL/cl.hpp @@ -28,16 +28,16 @@ /*! \file * - * \brief C++ bindings for OpenCL 1.0 (rev 48), OpenCL 1.1 (rev 33) and - * OpenCL 1.2 (rev 15) + * \brief C++ bindings for OpenCL 1.0 (rev 48), OpenCL 1.1 (rev 33) and + * OpenCL 1.2 (rev 15) * \author Benedict R. Gaster, Laurent Morichetti and Lee Howes - * + * * Additions and fixes from: - * Brian Cole, March 3rd 2010 and April 2012 + * 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.9 * \date December 2015 * @@ -77,7 +77,7 @@ * * \code * #define __CL_ENABLE_EXCEPTIONS - * + * * #if defined(__APPLE__) || defined(__MACOSX) * #include * #else @@ -86,13 +86,13 @@ * #include * #include * #include - * + * * const char * helloStr = "__kernel void " * "hello(void) " * "{ " * " " * "} "; - * + * * int * main(void) * { @@ -106,33 +106,33 @@ * return -1; * } * - * cl_context_properties properties[] = + * cl_context_properties properties[] = * { CL_CONTEXT_PLATFORM, (cl_context_properties)(platforms[0])(), 0}; - * cl::Context context(CL_DEVICE_TYPE_CPU, properties); - * + * cl::Context context(CL_DEVICE_TYPE_CPU, properties); + * * std::vector devices = context.getInfo(); - * + * * cl::Program::Sources source(1, * std::make_pair(helloStr,strlen(helloStr))); * cl::Program program_ = cl::Program(context, source); * program_.build(devices); - * + * * cl::Kernel kernel(program_, "hello", &err); - * + * * cl::Event event; * cl::CommandQueue queue(context, devices[0], 0, &err); * queue.enqueueNDRangeKernel( - * kernel, - * cl::NullRange, + * kernel, + * cl::NullRange, * cl::NDRange(4,4), * cl::NullRange, * NULL, - * &event); - * + * &event); + * * event.wait(); * } * catch (cl::Error err) { - * std::cerr + * std::cerr * << "ERROR: " * << err.what() * << "(" @@ -140,10 +140,10 @@ * << ")" * << std::endl; * } - * + * * return EXIT_SUCCESS; * } - * + * * \endcode * */ @@ -164,7 +164,7 @@ #include #endif // _MSC_VER -// +// #if defined(USE_CL_DEVICE_FISSION) #include #endif @@ -194,13 +194,13 @@ #if defined(CL_VERSION_1_2) && !defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) #define __CL_EXPLICIT_CONSTRUCTORS explicit #else // #if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) -#define __CL_EXPLICIT_CONSTRUCTORS +#define __CL_EXPLICIT_CONSTRUCTORS #endif // #if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) // Define deprecated prefixes and suffixes to ensure compilation // in case they are not pre-defined #if !defined(CL_EXT_PREFIX__VERSION_1_1_DEPRECATED) -#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED +#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED #endif // #if !defined(CL_EXT_PREFIX__VERSION_1_1_DEPRECATED) #if !defined(CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED) #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED @@ -224,7 +224,7 @@ #if !defined(__NO_STD_STRING) #include -#endif +#endif #if defined(__ANDROID__) || defined(linux) || defined(__APPLE__) || defined(__MACOSX) #include @@ -245,7 +245,7 @@ class Memory; /** * Deprecated APIs for 1.2 */ -#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) || (defined(CL_VERSION_1_1) && !defined(CL_VERSION_1_2)) +#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) || (defined(CL_VERSION_1_1) && !defined(CL_VERSION_1_2)) #define __INIT_CL_EXT_FCN_PTR(name) \ if(!pfn_##name) { \ pfn_##name = (PFN_##name) \ @@ -273,8 +273,8 @@ class Memory; class Buffer; #if defined(__CL_ENABLE_EXCEPTIONS) -/*! \brief Exception class - * +/*! \brief Exception class + * * This may be thrown by API functions when __CL_ENABLE_EXCEPTIONS is defined. */ class Error : public std::exception @@ -285,7 +285,7 @@ private: public: /*! \brief Create a new CL error exception for a given error code * and corresponding message. - * + * * \param err error code value. * * \param errStr a descriptive string that must remain in scope until @@ -452,7 +452,7 @@ static inline cl_int errHandler (cl_int err, const char * errStr = NULL) /** * Deprecated APIs for 1.2 */ -#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) || (defined(CL_VERSION_1_1) && !defined(CL_VERSION_1_2)) +#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) || (defined(CL_VERSION_1_1) && !defined(CL_VERSION_1_2)) #define __ENQUEUE_MARKER_ERR __ERR_STR(clEnqueueMarker) #define __ENQUEUE_WAIT_FOR_EVENTS_ERR __ERR_STR(clEnqueueWaitForEvents) #define __ENQUEUE_BARRIER_ERR __ERR_STR(clEnqueueBarrier) @@ -476,12 +476,12 @@ static inline cl_int errHandler (cl_int err, const char * errStr = NULL) #if !defined(__USE_DEV_STRING) && !defined(__NO_STD_STRING) typedef std::string STRING_CLASS; -#elif !defined(__USE_DEV_STRING) +#elif !defined(__USE_DEV_STRING) /*! \class string * \brief Simple string class, that provides a limited subset of std::string * functionality but avoids many of the issues that come with that class. - + * \note Deprecated. Please use std::string as default or * re-define the string class to match the std::string * interface by defining STRING_CLASS @@ -499,10 +499,10 @@ public: /*! \brief Constructs a string populated from an arbitrary value of * specified size. - * + * * An extra '\0' is added, in case none was contained in str. * - * \param str the initial value of the string instance. Note that '\0' + * \param str the initial value of the string instance. Note that '\0' * characters receive no special treatment. If NULL, * the string is left empty, with a size of 0. * @@ -555,7 +555,7 @@ public: } str_ = NULL; size_ = 0; - } + } else { char *newString = new char[n + 1]; ::size_t copySize = n; @@ -563,7 +563,7 @@ public: copySize = size_; } size_ = n; - + if(str_) { memcpy(newString, str_, (copySize + 1) * sizeof(char)); } @@ -608,11 +608,11 @@ public: if (rhs.size_ == 0 || rhs.str_ == NULL) { str_ = NULL; size_ = 0; - } + } else { str_ = new char[rhs.size_ + 1]; size_ = rhs.size_; - + if (str_ != NULL) { memcpy(str_, rhs.str_, (size_ + 1) * sizeof(char)); } @@ -641,7 +641,7 @@ public: delete[] str_; str_ = NULL; } - + //! \brief Queries the length of the string, excluding any added '\0's. ::size_t size(void) const { return size_; } @@ -654,19 +654,19 @@ public: 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) +#endif // #elif !defined(__USE_DEV_STRING) #if !defined(__USE_DEV_VECTOR) && !defined(__NO_STD_VECTOR) #define VECTOR_CLASS std::vector -#elif !defined(__USE_DEV_VECTOR) -#define VECTOR_CLASS cl::vector +#elif !defined(__USE_DEV_VECTOR) +#define VECTOR_CLASS cl::vector #if !defined(__MAX_DEFAULT_VECTOR_SIZE) #define __MAX_DEFAULT_VECTOR_SIZE 10 #endif /*! \class vector - * \brief Fixed sized vector implementation that mirroring + * \brief Fixed sized vector implementation that mirroring * * \note Deprecated. Please use std::vector as default or * re-define the vector class to match the std::vector @@ -696,12 +696,12 @@ private: public: //! \brief Constructs an empty vector with no memory allocated. - vector() : + vector() : size_(static_cast(0)) {} //! \brief Deallocates the vector's memory and destroys all of its elements. - ~vector() + ~vector() { clear(); } @@ -711,7 +711,7 @@ public: { return size_; } - + /*! \brief Empties the vector of all elements. * \note * This does not deallocate memory but will invoke destructors @@ -725,11 +725,11 @@ public: } /*! \brief Appends an element after the last valid element. - * Calling this on a vector that has reached capacity will throw an + * Calling this on a vector that has reached capacity will throw an * exception if exceptions are enabled. */ void push_back (const T& x) - { + { if (size() < N) { new (&data_[size_]) T(x); size_++; @@ -756,13 +756,13 @@ public: * * \param vec the vector to copy. */ - vector(const vector& vec) : + vector(const vector& vec) : size_(vec.size_) { if (size_ != 0) { assign(vec.begin(), vec.end()); } - } + } /*! \brief Constructs with a specified number of initial elements. * @@ -791,7 +791,7 @@ public: return *this; } - if (rhs.size_ != 0) { + if (rhs.size_ != 0) { assign(rhs.begin(), rhs.end()); } else { clear(); @@ -817,19 +817,19 @@ public: } return true; } - + //! \brief Conversion operator to T*. operator T* () { return data_; } //! \brief Conversion operator to const T*. operator const T* () const { return data_; } - + //! \brief Tests whether this instance has any elements. bool empty (void) const { return size_==0; } - + //! \brief Returns the maximum number of elements this instance can hold. unsigned int max_size (void) const { @@ -874,7 +874,7 @@ public: { return data_[index]; } - + /*! \brief Returns a const reference to a given element. * * \param index which element to access. @@ -886,7 +886,7 @@ public: { return data_[index]; } - + /*! \brief Assigns elements of the vector based on a source iterator range. * * \param start Beginning iterator of source range @@ -898,7 +898,7 @@ public: template void assign(I start, I end) { - clear(); + clear(); while(start != end) { push_back(*start); start++; @@ -916,12 +916,12 @@ public: /** * Internal iterator constructor to capture reference - * to the vector it iterates over rather than taking + * to the vector it iterates over rather than taking * the vector by copy. */ iterator (const vector &vec, int index) : vec_(&vec) - { + { if( !vec.empty() ) { index_ = index; } else { @@ -930,7 +930,7 @@ public: } public: - iterator(void) : + iterator(void) : index_(-1), vec_(NULL) { @@ -957,10 +957,10 @@ public: return i; } - + bool operator==(iterator i) { - return ((vec_ == i.vec_) && + return ((vec_ == i.vec_) && (index_ == i.index_)); } @@ -1048,7 +1048,7 @@ public: namespace detail { -#define __DEFAULT_NOT_INITIALIZED 1 +#define __DEFAULT_NOT_INITIALIZED 1 #define __DEFAULT_BEING_INITIALIZED 2 #define __DEFAULT_INITIALIZED 4 @@ -1089,14 +1089,14 @@ namespace detail { } } // namespace detail - + /*! \brief class used to interface between C++ and * OpenCL C calls that require arrays of size_t values, whose * size is known statically. */ template class size_t -{ +{ private: ::size_t data_[N]; @@ -1226,7 +1226,7 @@ inline cl_int getInfoHelper(Func f, cl_uint name, STRING_CLASS* param, long) *param = value; return CL_SUCCESS; -#else +#else ::size_t required; cl_int err = f(name, 0, NULL, &required); if (err != CL_SUCCESS) { @@ -1443,7 +1443,7 @@ inline cl_int getInfoHelper(Func f, cl_uint name, T* param, int, typename T::cl_ F(cl_event_info, CL_EVENT_CONTEXT, cl::Context) #endif // CL_VERSION_1_1 - + #if defined(CL_VERSION_1_2) #define __PARAM_NAME_INFO_1_2(F) \ F(cl_image_info, CL_IMAGE_BUFFER, cl::Buffer) \ @@ -1630,7 +1630,7 @@ struct ReferenceHandler /** * Retain the device. * \param device A valid device created using createSubDevices - * \return + * \return * CL_SUCCESS if the function executed successfully. * CL_INVALID_DEVICE if device was not a valid subdevice * CL_OUT_OF_RESOURCES @@ -1641,7 +1641,7 @@ struct ReferenceHandler /** * Retain the device. * \param device A valid device created using createSubDevices - * \return + * \return * CL_SUCCESS if the function executed successfully. * CL_INVALID_DEVICE if device was not a valid subdevice * CL_OUT_OF_RESOURCES @@ -1896,24 +1896,24 @@ protected: } public: - Wrapper() : object_(NULL), referenceCountable_(false) - { - } - - Wrapper(const cl_type &obj) : object_(obj), referenceCountable_(false) + Wrapper() : object_(NULL), referenceCountable_(false) { - referenceCountable_ = isReferenceCountable(obj); + } + + Wrapper(const cl_type &obj) : object_(obj), referenceCountable_(false) + { + referenceCountable_ = isReferenceCountable(obj); } ~Wrapper() { if (object_ != NULL) { release(); } } - + Wrapper(const Wrapper& rhs) { object_ = rhs.object_; - referenceCountable_ = isReferenceCountable(object_); + referenceCountable_ = isReferenceCountable(object_); if (object_ != NULL) { detail::errHandler(retain(), __RETAIN_ERR); } } @@ -1956,7 +1956,7 @@ public: { if (object_ != NULL) { detail::errHandler(release(), __RELEASE_ERR); } object_ = rhs; - referenceCountable_ = isReferenceCountable(object_); + referenceCountable_ = isReferenceCountable(object_); return *this; } @@ -2037,7 +2037,7 @@ public: Device() : detail::Wrapper() { } /*! \brief Constructor from cl_device_id. - * + * * This simply copies the device ID value, which is an inexpensive operation. */ __CL_EXPLICIT_CONSTRUCTORS Device(const cl_device_id &device) : detail::Wrapper(device) { } @@ -2049,7 +2049,7 @@ public: static Device getDefault(cl_int * err = NULL); /*! \brief Assignment operator from cl_device_id. - * + * * This simply copies the device ID value, which is an inexpensive operation. */ Device& operator = (const cl_device_id& rhs) @@ -2146,7 +2146,7 @@ public: const cl_device_partition_property_ext * properties, VECTOR_CLASS* devices) { - typedef CL_API_ENTRY cl_int + typedef CL_API_ENTRY cl_int ( CL_API_CALL * PFN_clCreateSubDevicesEXT)( cl_device_id /*in_device*/, const cl_device_partition_property_ext * /* properties */, @@ -2190,13 +2190,13 @@ public: Platform() : detail::Wrapper() { } /*! \brief Constructor from cl_platform_id. - * + * * This simply copies the platform ID value, which is an inexpensive operation. */ __CL_EXPLICIT_CONSTRUCTORS Platform(const cl_platform_id &platform) : detail::Wrapper(platform) { } /*! \brief Assignment operator from cl_platform_id. - * + * * This simply copies the platform ID value, which is an inexpensive operation. */ Platform& operator = (const cl_platform_id& rhs) @@ -2228,7 +2228,7 @@ public: } /*! \brief Gets a list of devices for this platform. - * + * * Wraps clGetDeviceIDs(). */ cl_int getDevices( @@ -2285,8 +2285,8 @@ public: VECTOR_CLASS* devices) const { typedef CL_API_ENTRY cl_int (CL_API_CALL *PFN_clGetDeviceIDsFromD3D10KHR)( - cl_platform_id platform, - cl_d3d10_device_source_khr d3d_device_source, + cl_platform_id platform, + cl_d3d10_device_source_khr d3d_device_source, void * d3d_object, cl_d3d10_device_set_khr d3d_device_set, cl_uint num_entries, @@ -2302,12 +2302,12 @@ public: cl_uint n = 0; cl_int err = pfn_clGetDeviceIDsFromD3D10KHR( - object_, - d3d_device_source, + object_, + d3d_device_source, d3d_object, - d3d_device_set, - 0, - NULL, + d3d_device_set, + 0, + NULL, &n); if (err != CL_SUCCESS) { return detail::errHandler(err, __GET_DEVICE_IDS_ERR); @@ -2315,12 +2315,12 @@ public: cl_device_id* ids = (cl_device_id*) alloca(n * sizeof(cl_device_id)); err = pfn_clGetDeviceIDsFromD3D10KHR( - object_, - d3d_device_source, + object_, + d3d_device_source, d3d_object, d3d_device_set, - n, - ids, + n, + ids, NULL); if (err != CL_SUCCESS) { return detail::errHandler(err, __GET_DEVICE_IDS_ERR); @@ -2332,7 +2332,7 @@ public: #endif /*! \brief Gets a list of available platforms. - * + * * Wraps clGetPlatformIDs(). */ static cl_int get( @@ -2361,7 +2361,7 @@ public: } /*! \brief Gets the first available platform. - * + * * Wraps clGetPlatformIDs(), returning the first result. */ static cl_int get( @@ -2390,7 +2390,7 @@ public: } /*! \brief Gets the first available platform, returning it by value. - * + * * Wraps clGetPlatformIDs(), returning the first result. */ static Platform get( @@ -2419,17 +2419,17 @@ public: return Platform(); } - + return Platform(ids[0]); } - static Platform getDefault( + static Platform getDefault( cl_int *errResult = NULL ) { return get(errResult); } - + #if defined(CL_VERSION_1_2) //! \brief Wrapper for clUnloadCompiler(). cl_int @@ -2465,7 +2465,7 @@ UnloadCompiler() * * \see cl_context */ -class Context +class Context : public detail::Wrapper { private: @@ -2657,12 +2657,12 @@ public: * * \note All calls to this function return the same cl_context as the first. */ - static Context getDefault(cl_int * err = NULL) + static Context getDefault(cl_int * err = NULL) { int state = detail::compare_exchange( - &default_initialized_, + &default_initialized_, __DEFAULT_BEING_INITIALIZED, __DEFAULT_NOT_INITIALIZED); - + if (state & __DEFAULT_INITIALIZED) { if (err != NULL) { *err = default_error_; @@ -2709,14 +2709,14 @@ public: Context() : detail::Wrapper() { } /*! \brief Constructor from cl_context - takes ownership. - * + * * This effectively transfers ownership of a refcount on the cl_context * into the new Context object. */ __CL_EXPLICIT_CONSTRUCTORS Context(const cl_context& context) : detail::Wrapper(context) { } /*! \brief Assignment operator from cl_context - takes ownership. - * + * * This effectively transfers ownership of a refcount on the rhs and calls * clReleaseContext() on the value previously held by this instance. */ @@ -2750,7 +2750,7 @@ public: } /*! \brief Gets a list of supported image formats. - * + * * Wraps clGetSupportedImageFormats(). */ cl_int getSupportedImageFormats( @@ -2855,7 +2855,7 @@ public: Event() : detail::Wrapper() { } /*! \brief Constructor from cl_event - takes ownership. - * + * * This effectively transfers ownership of a refcount on the cl_event * into the new Event object. */ @@ -2919,7 +2919,7 @@ public: } /*! \brief Blocks the calling thread until this event completes. - * + * * Wraps clWaitForEvents(). */ cl_int wait() const @@ -2936,7 +2936,7 @@ public: */ cl_int setCallback( cl_int type, - void (CL_CALLBACK * pfn_notify)(cl_event, cl_int, void *), + void (CL_CALLBACK * pfn_notify)(cl_event, cl_int, void *), void * user_data = NULL) { return detail::errHandler( @@ -2944,13 +2944,13 @@ public: object_, type, pfn_notify, - user_data), + user_data), __SET_EVENT_CALLBACK_ERR); } #endif /*! \brief Blocks the calling thread until every event specified is complete. - * + * * Wraps clWaitForEvents(). */ static cl_int @@ -2965,7 +2965,7 @@ public: #if defined(CL_VERSION_1_1) /*! \brief Class interface for user events (a subset of cl_event's). - * + * * See Event for details about copy semantics, etc. */ class UserEvent : public Event @@ -3000,14 +3000,14 @@ public: cl_int setStatus(cl_int status) { return detail::errHandler( - ::clSetUserEventStatus(object_,status), + ::clSetUserEventStatus(object_,status), __SET_USER_EVENT_STATUS_ERR); } }; #endif /*! \brief Blocks the calling thread until every event specified is complete. - * + * * Wraps clWaitForEvents(). */ inline static cl_int @@ -3034,7 +3034,7 @@ public: Memory() : detail::Wrapper() { } /*! \brief Constructor from cl_mem - takes ownership. - * + * * This effectively transfers ownership of a refcount on the cl_mem * into the new Memory object. */ @@ -3119,14 +3119,14 @@ public: * value - not the Memory class instance. */ cl_int setDestructorCallback( - void (CL_CALLBACK * pfn_notify)(cl_mem, void *), + void (CL_CALLBACK * pfn_notify)(cl_mem, void *), void * user_data = NULL) { return detail::errHandler( ::clSetMemObjectDestructorCallback( object_, pfn_notify, - user_data), + user_data), __SET_MEM_OBJECT_DESTRUCTOR_CALLBACK_ERR); } #endif @@ -3146,7 +3146,7 @@ cl_int copy( const CommandQueue &queue, const cl::Buffer &buffer, IteratorType s /*! \brief Class interface for Buffer Memory Objects. - * + * * See Memory for details about copy semantics, etc. * * \see Memory @@ -3231,7 +3231,7 @@ public: if( useHostPtr ) { flags |= CL_MEM_USE_HOST_PTR; } - + ::size_t size = sizeof(DataType)*(endIterator - startIterator); Context context = Context::getDefault(err); @@ -3291,7 +3291,7 @@ public: Memory::operator=(rhs); return *this; } - + /*! \brief Copy constructor to forward copy to the superclass correctly. * Required for MSVC. */ @@ -3305,7 +3305,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. @@ -3336,10 +3336,10 @@ public: Buffer result; cl_int error; result.object_ = ::clCreateSubBuffer( - object_, - flags, - buffer_create_type, - buffer_create_info, + object_, + flags, + buffer_create_type, + buffer_create_info, &error); detail::errHandler(error, __CREATE_SUBBUFFER_ERR); @@ -3348,7 +3348,7 @@ public: } return result; - } + } #endif }; @@ -3356,7 +3356,7 @@ public: /*! \brief Class interface for creating OpenCL buffers from ID3D10Buffer's. * * This is provided to facilitate interoperability with Direct3D. - * + * * See Memory for details about copy semantics, etc. * * \see Memory @@ -3462,9 +3462,9 @@ public: /*! \brief Class interface for GL Buffer Memory Objects. * * This is provided to facilitate interoperability with OpenGL. - * + * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class BufferGL : public Buffer @@ -3557,7 +3557,7 @@ public: /*! \brief C++ base class for Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image : public Memory @@ -3621,7 +3621,7 @@ public: detail::getInfo(&::clGetImageInfo, object_, name, param), __GET_IMAGE_INFO_ERR); } - + //! \brief Wrapper for clGetImageInfo() that returns by value. template typename detail::param_traits::param_type @@ -3641,7 +3641,7 @@ public: /*! \brief Class interface for 1D Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image1D : public Image @@ -3667,11 +3667,11 @@ public: 0, 0, 0, 0, 0, 0, 0, 0 }; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - host_ptr, + context(), + flags, + &format, + &desc, + host_ptr, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -3753,11 +3753,11 @@ public: buffer() }; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - NULL, + context(), + flags, + &format, + &desc, + NULL, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -3775,7 +3775,7 @@ public: Image::operator=(rhs); return *this; } - + /*! \brief Copy constructor to forward copy to the superclass correctly. * Required for MSVC. */ @@ -3834,11 +3834,11 @@ public: 0, 0, 0, 0 }; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - host_ptr, + context(), + flags, + &format, + &desc, + host_ptr, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -3856,7 +3856,7 @@ public: Image::operator=(rhs); return *this; } - + /*! \brief Copy constructor to forward copy to the superclass correctly. * Required for MSVC. */ @@ -3893,7 +3893,7 @@ public: /*! \brief Class interface for 2D Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image2D : public Image @@ -4023,9 +4023,9 @@ public: /*! \brief Class interface for GL 2D Image Memory objects. * * This is provided to facilitate interoperability with OpenGL. - * + * * See Memory for details about copy semantics, etc. - * + * * \see Memory * \note Deprecated for OpenCL 1.2. Please use ImageGL instead. */ @@ -4060,7 +4060,7 @@ public: } } - + //! \brief Default constructor - initializes to NULL. Image2DGL() : Image2D() { } @@ -4144,11 +4144,11 @@ public: 0, 0, 0 }; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - host_ptr, + context(), + flags, + &format, + &desc, + host_ptr, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -4166,7 +4166,7 @@ public: Image::operator=(rhs); return *this; } - + /*! \brief Copy constructor to forward copy to the superclass correctly. * Required for MSVC. */ @@ -4202,7 +4202,7 @@ public: /*! \brief Class interface for 3D Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image3D : public Image @@ -4254,11 +4254,11 @@ public: 0, 0, 0 }; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - host_ptr, + context(), + flags, + &format, + &desc, + host_ptr, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -4336,9 +4336,9 @@ public: /*! \brief Class interface for GL 3D Image Memory objects. * * This is provided to facilitate interoperability with OpenGL. - * + * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image3DGL : public Image3D @@ -4443,8 +4443,8 @@ public: { cl_int error; object_ = ::clCreateFromGLTexture( - context(), - flags, + context(), + flags, target, miplevel, texobj, @@ -4506,7 +4506,7 @@ public: * * \see Memory */ -class BufferRenderGL : +class BufferRenderGL : #if defined(CL_VERSION_1_2) public ImageGL #else // #if defined(CL_VERSION_1_2) @@ -4567,7 +4567,7 @@ public: #else // #if defined(CL_VERSION_1_2) Image2DGL::operator=(rhs); #endif //#if defined(CL_VERSION_1_2) - + return *this; } @@ -4602,7 +4602,7 @@ public: #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. @@ -4614,7 +4614,7 @@ public: #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) @@ -4636,7 +4636,7 @@ public: * to the same underlying cl_sampler as the original. For details, see * clRetainSampler() and clReleaseSampler(). * - * \see cl_sampler + * \see cl_sampler */ class Sampler : public detail::Wrapper { @@ -4657,7 +4657,7 @@ public: { cl_int error; object_ = ::clCreateSampler( - context(), + context(), normalized_coords, addressing_mode, filter_mode, @@ -4670,7 +4670,7 @@ public: } /*! \brief Constructor from cl_sampler - takes ownership. - * + * * This effectively transfers ownership of a refcount on the cl_sampler * into the new Sampler object. */ @@ -4783,11 +4783,11 @@ public: } /*! \brief Conversion operator to const ::size_t *. - * + * * \returns a pointer to the size of the first dimension. */ - operator const ::size_t*() const { - return (const ::size_t*) sizes_; + operator const ::size_t*() const { + return (const ::size_t*) sizes_; } //! \brief Queries the number of dimensions in the range. @@ -4819,7 +4819,7 @@ struct KernelArgumentHandler static const void* ptr(const LocalSpaceArg&) { return NULL; } }; -} +} //! \endcond /*! __local @@ -4864,7 +4864,7 @@ public: Kernel() { } /*! \brief Constructor from cl_kernel - takes ownership. - * + * * This effectively transfers ownership of a refcount on the cl_kernel * into the new Kernel object. */ @@ -5114,7 +5114,7 @@ public: * Set to CL_INVALID_BINARY if the binary provided is not valid for the matching device. * \param err if non-NULL will be set to CL_SUCCESS on successful operation or one of the following errors: * CL_INVALID_CONTEXT if context is not a valid context. - * CL_INVALID_VALUE if the length of devices is zero; or if the length of binaries does not match the length of devices; + * CL_INVALID_VALUE if the length of devices is zero; or if the length of binaries does not match the length of devices; * or if any entry in binaries is NULL or has length 0. * CL_INVALID_DEVICE if OpenCL devices listed in devices are not in the list of devices associated with context. * CL_INVALID_BINARY if an invalid program binary was encountered for any device. binaryStatus will return specific status for each device. @@ -5128,9 +5128,9 @@ public: cl_int* err = NULL) { cl_int error; - + const ::size_t numDevices = devices.size(); - + // Catch size mismatch early and return if(binaries.size() != numDevices) { error = CL_INVALID_VALUE; @@ -5157,7 +5157,7 @@ public: if(binaryStatus) { binaryStatus->resize(numDevices); } - + object_ = ::clCreateProgramWithBinary( context(), (cl_uint) devices.size(), deviceIDs, @@ -5171,7 +5171,7 @@ public: } } - + #if defined(CL_VERSION_1_2) /** * Create program using builtin kernels. @@ -5191,12 +5191,12 @@ public: for( ::size_t deviceIndex = 0; deviceIndex < numDevices; ++deviceIndex ) { deviceIDs[deviceIndex] = (devices[deviceIndex])(); } - + object_ = ::clCreateProgramWithBuiltInKernels( - context(), + context(), (cl_uint) devices.size(), deviceIDs, - kernelNames.c_str(), + kernelNames.c_str(), &error); detail::errHandler(error, __CREATE_PROGRAM_WITH_BUILT_IN_KERNELS_ERR); @@ -5378,7 +5378,7 @@ inline Program linkProgram( const char* options = NULL, void (CL_CALLBACK * notifyFptr)(cl_program, void *) = NULL, void* data = NULL, - cl_int* err = NULL) + cl_int* err = NULL) { cl_int error_local = CL_SUCCESS; @@ -5413,7 +5413,7 @@ inline Program linkProgram( const char* options = NULL, void (CL_CALLBACK * notifyFptr)(cl_program, void *) = NULL, void* data = NULL, - cl_int* err = NULL) + cl_int* err = NULL) { cl_int error_local = CL_SUCCESS; @@ -5423,7 +5423,7 @@ inline Program linkProgram( for (unsigned int i = 0; i < inputPrograms.size(); i++) { programs[i] = inputPrograms[i](); } - } + } Context ctx; if(inputPrograms.size() > 0) { @@ -5457,14 +5457,14 @@ inline VECTOR_CLASS cl::Program::getInfo(cl_int* er { VECTOR_CLASS< ::size_t> sizes = getInfo(); VECTOR_CLASS binaries; - for (VECTOR_CLASS< ::size_t>::iterator s = sizes.begin(); s != sizes.end(); ++s) + for (VECTOR_CLASS< ::size_t>::iterator s = sizes.begin(); s != sizes.end(); ++s) { char *ptr = NULL; - if (*s != 0) + if (*s != 0) ptr = new char[*s]; binaries.push_back(ptr); } - + cl_int result = getInfo(CL_PROGRAM_BINARIES, &binaries); if (err != NULL) { *err = result; @@ -5603,12 +5603,12 @@ public: } #endif // #if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED) - static CommandQueue getDefault(cl_int * err = NULL) + static CommandQueue getDefault(cl_int * err = NULL) { int state = detail::compare_exchange( - &default_initialized_, + &default_initialized_, __DEFAULT_BEING_INITIALIZED, __DEFAULT_NOT_INITIALIZED); - + if (state & __DEFAULT_INITIALIZED) { if (err != NULL) { *err = default_error_; @@ -5787,9 +5787,9 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueReadBufferRect( - object_, - buffer(), - blocking, + object_, + buffer(), + blocking, (const ::size_t *)buffer_offset, (const ::size_t *)host_offset, (const ::size_t *)region, @@ -5826,9 +5826,9 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueWriteBufferRect( - object_, - buffer(), - blocking, + object_, + buffer(), + blocking, (const ::size_t *)buffer_offset, (const ::size_t *)host_offset, (const ::size_t *)region, @@ -5864,11 +5864,11 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueCopyBufferRect( - object_, - src(), - dst(), - (const ::size_t *)src_origin, - (const ::size_t *)dst_origin, + object_, + src(), + dst(), + (const ::size_t *)src_origin, + (const ::size_t *)dst_origin, (const ::size_t *)region, src_row_pitch, src_slice_pitch, @@ -5889,7 +5889,7 @@ public: /** * Enqueue a command to fill a buffer object with a pattern * of a given size. The pattern is specified a as vector. - * \tparam PatternType The datatype of the pattern field. + * \tparam PatternType The datatype of the pattern field. * The pattern type must be an accepted OpenCL data type. */ template @@ -5904,11 +5904,11 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueFillBuffer( - object_, + object_, buffer(), static_cast(&pattern), - sizeof(PatternType), - offset, + sizeof(PatternType), + offset, size, (events != NULL) ? (cl_uint) events->size() : 0, (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL, @@ -6020,10 +6020,10 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueFillImage( - object_, + object_, image(), - static_cast(&fillColor), - (const ::size_t *) origin, + static_cast(&fillColor), + (const ::size_t *) origin, (const ::size_t *) region, (events != NULL) ? (cl_uint) events->size() : 0, (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL, @@ -6054,10 +6054,10 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueFillImage( - object_, + object_, image(), - static_cast(&fillColor), - (const ::size_t *) origin, + static_cast(&fillColor), + (const ::size_t *) origin, (const ::size_t *) region, (events != NULL) ? (cl_uint) events->size() : 0, (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL, @@ -6088,10 +6088,10 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueFillImage( - object_, + object_, image(), - static_cast(&fillColor), - (const ::size_t *) origin, + static_cast(&fillColor), + (const ::size_t *) origin, (const ::size_t *) region, (events != NULL) ? (cl_uint) events->size() : 0, (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL, @@ -6239,14 +6239,14 @@ public: #if defined(CL_VERSION_1_2) /** - * Enqueues a marker command which waits for either a list of events to complete, + * Enqueues a marker command which waits for either a list of events to complete, * or all previously enqueued commands to complete. * - * Enqueues a marker command which waits for either a list of events to complete, - * or if the list is empty it waits for all commands previously enqueued in command_queue - * to complete before it completes. This command returns an event which can be waited on, - * i.e. this event can be waited on to insure that all events either in the event_wait_list - * or all previously enqueued commands, queued before this command to command_queue, + * Enqueues a marker command which waits for either a list of events to complete, + * or if the list is empty it waits for all commands previously enqueued in command_queue + * to complete before it completes. This command returns an event which can be waited on, + * i.e. this event can be waited on to insure that all events either in the event_wait_list + * or all previously enqueued commands, queued before this command to command_queue, * have completed. */ cl_int enqueueMarkerWithWaitList( @@ -6271,12 +6271,12 @@ public: /** * A synchronization point that enqueues a barrier operation. * - * Enqueues a barrier command which waits for either a list of events to complete, - * or if the list is empty it waits for all commands previously enqueued in command_queue - * to complete before it completes. This command blocks command execution, that is, any - * following commands enqueued after it do not execute until it completes. This command - * returns an event which can be waited on, i.e. this event can be waited on to insure that - * all events either in the event_wait_list or all previously enqueued commands, queued + * Enqueues a barrier command which waits for either a list of events to complete, + * or if the list is empty it waits for all commands previously enqueued in command_queue + * to complete before it completes. This command blocks command execution, that is, any + * following commands enqueued after it do not execute until it completes. This command + * returns an event which can be waited on, i.e. this event can be waited on to insure that + * all events either in the event_wait_list or all previously enqueued commands, queued * before this command to command_queue, have completed. */ cl_int enqueueBarrierWithWaitList( @@ -6297,7 +6297,7 @@ public: return err; } - + /** * Enqueues a command to indicate with which device a set of memory objects * should be associated. @@ -6310,7 +6310,7 @@ public: ) const { cl_event tmp; - + cl_mem* localMemObjects = static_cast(alloca(memObjects.size() * sizeof(cl_mem))); for( int i = 0; i < (int)memObjects.size(); ++i ) { localMemObjects[i] = memObjects[i](); @@ -6319,8 +6319,8 @@ public: cl_int err = detail::errHandler( ::clEnqueueMigrateMemObjects( - object_, - (cl_uint)memObjects.size(), + object_, + (cl_uint)memObjects.size(), static_cast(localMemObjects), flags, (events != NULL) ? (cl_uint) events->size() : 0, @@ -6389,7 +6389,7 @@ public: const VECTOR_CLASS* events = NULL, Event* event = NULL) const { - cl_mem * mems = (mem_objects != NULL && mem_objects->size() > 0) + cl_mem * mems = (mem_objects != NULL && mem_objects->size() > 0) ? (cl_mem*) alloca(mem_objects->size() * sizeof(cl_mem)) : NULL; @@ -6420,14 +6420,14 @@ public: /** * Deprecated APIs for 1.2 */ -#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) || (defined(CL_VERSION_1_1) && !defined(CL_VERSION_1_2)) - CL_EXT_PREFIX__VERSION_1_1_DEPRECATED +#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) || (defined(CL_VERSION_1_1) && !defined(CL_VERSION_1_2)) + CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int enqueueMarker(Event* event = NULL) const CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED { cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueMarker( - object_, + object_, (event != NULL) ? &tmp : NULL), __ENQUEUE_MARKER_ERR); @@ -6518,7 +6518,7 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *PFN_clEnqueueReleaseD3D10ObjectsKHR)( #if defined(CL_VERSION_1_1) __INIT_CL_EXT_FCN_PTR(clEnqueueAcquireD3D10ObjectsKHR); #endif - + cl_event tmp; cl_int err = detail::errHandler( pfn_clEnqueueAcquireD3D10ObjectsKHR( @@ -6573,7 +6573,7 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *PFN_clEnqueueReleaseD3D10ObjectsKHR)( /** * Deprecated APIs for 1.2 */ -#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) || (defined(CL_VERSION_1_1) && !defined(CL_VERSION_1_2)) +#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) || (defined(CL_VERSION_1_1) && !defined(CL_VERSION_1_2)) CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int enqueueBarrier() const CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED { @@ -6634,7 +6634,7 @@ Buffer::Buffer( if( useHostPtr ) { flags |= CL_MEM_USE_HOST_PTR; } - + ::size_t size = sizeof(DataType)*(endIterator - startIterator); if( useHostPtr ) { @@ -6869,11 +6869,11 @@ inline cl_int copy( const CommandQueue &queue, IteratorType startIterator, Itera { typedef typename std::iterator_traits::value_type DataType; cl_int error; - + ::size_t length = endIterator-startIterator; ::size_t byteLength = length*sizeof(DataType); - DataType *pointer = + DataType *pointer = 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 ) { @@ -6881,8 +6881,8 @@ inline cl_int copy( const CommandQueue &queue, IteratorType startIterator, Itera } #if defined(_MSC_VER) std::copy( - startIterator, - endIterator, + startIterator, + endIterator, stdext::checked_array_iterator( pointer, length)); #else @@ -6891,7 +6891,7 @@ inline cl_int copy( const CommandQueue &queue, IteratorType startIterator, Itera Event endEvent; error = queue.enqueueUnmapMemObject(buffer, pointer, 0, &endEvent); // if exceptions enabled, enqueueUnmapMemObject will throw - if( error != CL_SUCCESS ) { + if( error != CL_SUCCESS ) { return error; } endEvent.wait(); @@ -6908,11 +6908,11 @@ inline cl_int copy( const CommandQueue &queue, const cl::Buffer &buffer, Iterato { typedef typename std::iterator_traits::value_type DataType; cl_int error; - + ::size_t length = endIterator-startIterator; ::size_t byteLength = length*sizeof(DataType); - DataType *pointer = + DataType *pointer = 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 ) { @@ -6922,7 +6922,7 @@ inline cl_int copy( const CommandQueue &queue, const cl::Buffer &buffer, Iterato Event endEvent; error = queue.enqueueUnmapMemObject(buffer, pointer, 0, &endEvent); // if exceptions enabled, enqueueUnmapMemObject will throw - if( error != CL_SUCCESS ) { + if( error != CL_SUCCESS ) { return error; } endEvent.wait(); @@ -6952,17 +6952,17 @@ inline cl_int enqueueReadBufferRect( } return queue.enqueueReadBufferRect( - buffer, - blocking, - buffer_offset, + buffer, + blocking, + buffer_offset, host_offset, region, buffer_row_pitch, buffer_slice_pitch, host_row_pitch, host_slice_pitch, - ptr, - events, + ptr, + events, event); } @@ -6988,17 +6988,17 @@ inline cl_int enqueueWriteBufferRect( } return queue.enqueueWriteBufferRect( - buffer, - blocking, - buffer_offset, + buffer, + blocking, + buffer_offset, host_offset, region, buffer_row_pitch, buffer_slice_pitch, host_row_pitch, host_slice_pitch, - ptr, - events, + ptr, + events, event); } @@ -7032,7 +7032,7 @@ inline cl_int enqueueCopyBufferRect( src_slice_pitch, dst_row_pitch, dst_slice_pitch, - events, + events, event); } #endif @@ -7046,7 +7046,7 @@ inline cl_int enqueueReadImage( ::size_t slice_pitch, void* ptr, const VECTOR_CLASS* events = NULL, - Event* event = NULL) + Event* event = NULL) { cl_int error; CommandQueue queue = CommandQueue::getDefault(&error); @@ -7063,7 +7063,7 @@ inline cl_int enqueueReadImage( row_pitch, slice_pitch, ptr, - events, + events, event); } @@ -7093,7 +7093,7 @@ inline cl_int enqueueWriteImage( row_pitch, slice_pitch, ptr, - events, + events, event); } @@ -7195,7 +7195,7 @@ inline cl_int finish(void) if (error != CL_SUCCESS) { return error; - } + } return queue.finish(); @@ -7214,63 +7214,63 @@ struct EnqueueArgs const NDRange local_; VECTOR_CLASS events_; - EnqueueArgs(NDRange global) : + EnqueueArgs(NDRange global) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange) { } - EnqueueArgs(NDRange global, NDRange local) : + EnqueueArgs(NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local) { } - EnqueueArgs(NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(NDRange offset, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(offset), + offset_(offset), global_(global), local_(local) { } - EnqueueArgs(Event e, NDRange global) : + EnqueueArgs(Event e, NDRange global) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange) { events_.push_back(e); } - EnqueueArgs(Event e, NDRange global, NDRange local) : + EnqueueArgs(Event e, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local) { events_.push_back(e); } - EnqueueArgs(Event e, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(Event e, NDRange offset, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(offset), + offset_(offset), global_(global), local_(local) { events_.push_back(e); } - EnqueueArgs(const VECTOR_CLASS &events, NDRange global) : + EnqueueArgs(const VECTOR_CLASS &events, NDRange global) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange), events_(events) @@ -7278,9 +7278,9 @@ struct EnqueueArgs } - EnqueueArgs(const VECTOR_CLASS &events, NDRange global, NDRange local) : + EnqueueArgs(const VECTOR_CLASS &events, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local), events_(events) @@ -7288,9 +7288,9 @@ struct EnqueueArgs } - EnqueueArgs(const VECTOR_CLASS &events, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(const VECTOR_CLASS &events, NDRange offset, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(offset), + offset_(offset), global_(global), local_(local), events_(events) @@ -7298,63 +7298,63 @@ struct EnqueueArgs } - EnqueueArgs(CommandQueue &queue, NDRange global) : + EnqueueArgs(CommandQueue &queue, NDRange global) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange) { } - EnqueueArgs(CommandQueue &queue, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, NDRange global, NDRange local) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local) { } - EnqueueArgs(CommandQueue &queue, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, NDRange offset, NDRange global, NDRange local) : queue_(queue), - offset_(offset), + offset_(offset), global_(global), local_(local) { } - EnqueueArgs(CommandQueue &queue, Event e, NDRange global) : + EnqueueArgs(CommandQueue &queue, Event e, NDRange global) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange) { events_.push_back(e); } - EnqueueArgs(CommandQueue &queue, Event e, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, Event e, NDRange global, NDRange local) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local) { events_.push_back(e); } - EnqueueArgs(CommandQueue &queue, Event e, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, Event e, NDRange offset, NDRange global, NDRange local) : queue_(queue), - offset_(offset), + offset_(offset), global_(global), local_(local) { events_.push_back(e); } - EnqueueArgs(CommandQueue &queue, const VECTOR_CLASS &events, NDRange global) : + EnqueueArgs(CommandQueue &queue, const VECTOR_CLASS &events, NDRange global) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange), events_(events) @@ -7362,9 +7362,9 @@ struct EnqueueArgs } - EnqueueArgs(CommandQueue &queue, const VECTOR_CLASS &events, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, const VECTOR_CLASS &events, NDRange global, NDRange local) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local), events_(events) @@ -7372,9 +7372,9 @@ struct EnqueueArgs } - EnqueueArgs(CommandQueue &queue, const VECTOR_CLASS &events, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, const VECTOR_CLASS &events, NDRange offset, NDRange global, NDRange local) : queue_(queue), - offset_(offset), + offset_(offset), global_(global), local_(local), events_(events) @@ -7394,13 +7394,13 @@ struct SetArg { kernel.setArg(index, arg); } -}; +}; template struct SetArg { static void set (Kernel, NullType) - { + { } }; @@ -7504,7 +7504,7 @@ public: SetArg<30, T30>::set(kernel_, t30); SetArg<31, T31>::set(kernel_, t31); - + args.queue_.enqueueNDRangeKernel( kernel_, args.offset_, @@ -7512,7 +7512,7 @@ public: args.local_, &args.events_, &event); - + return event; } @@ -7595,12 +7595,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 32)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -7821,12 +7821,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 31)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -8043,12 +8043,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 30)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -8261,12 +8261,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 29)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -8475,12 +8475,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 28)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -8685,12 +8685,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 27)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -8891,12 +8891,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 26)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -9093,12 +9093,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 25)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -9291,12 +9291,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 24)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -9485,12 +9485,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 23)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -9675,12 +9675,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 22)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -9861,12 +9861,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 21)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -10043,12 +10043,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 20)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -10221,12 +10221,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 19)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -10395,12 +10395,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 18)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -10565,12 +10565,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 17)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -10731,12 +10731,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 16)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -10893,12 +10893,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 15)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -11051,12 +11051,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 14)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -11205,12 +11205,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 13)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -11355,12 +11355,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 12)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -11501,12 +11501,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 11)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -11643,12 +11643,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 10)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -11781,12 +11781,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 9)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -11915,12 +11915,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 8)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -12045,12 +12045,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 7)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -12171,12 +12171,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 6)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -12293,12 +12293,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 5)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -12411,12 +12411,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 4)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -12525,12 +12525,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 3)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -12635,12 +12635,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 2)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -12741,12 +12741,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 1)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -12810,7 +12810,7 @@ struct make_kernel : > { public: - typedef detail::KernelFunctorGlobal< + typedef detail::KernelFunctorGlobal< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, @@ -12837,7 +12837,7 @@ public: T28, T29, T30, T31 >( - FunctorType(program, name, err)) + FunctorType(program, name, err)) {} make_kernel( @@ -12853,8 +12853,8 @@ public: T28, T29, T30, T31 >( - FunctorType(kernel)) - {} + FunctorType(kernel)) + {} }; @@ -12944,8 +12944,8 @@ public: #undef __PARAM_NAME_DEVICE_FISSION #endif // USE_CL_DEVICE_FISSION -#undef __DEFAULT_NOT_INITIALIZED -#undef __DEFAULT_BEING_INITIALIZED +#undef __DEFAULT_NOT_INITIALIZED +#undef __DEFAULT_BEING_INITIALIZED #undef __DEFAULT_INITIALIZED #undef CL_HPP_RVALUE_REFERENCES_SUPPORTED diff --git a/projects/clr/opencl/khronos/headers/opencl2.0/CL/cl.hpp b/projects/clr/opencl/khronos/headers/opencl2.0/CL/cl.hpp index 71e55e0678..f949a58691 100644 --- a/projects/clr/opencl/khronos/headers/opencl2.0/CL/cl.hpp +++ b/projects/clr/opencl/khronos/headers/opencl2.0/CL/cl.hpp @@ -28,16 +28,16 @@ /*! \file * - * \brief C++ bindings for OpenCL 1.0 (rev 48), OpenCL 1.1 (rev 33) and - * OpenCL 1.2 (rev 15) + * \brief C++ bindings for OpenCL 1.0 (rev 48), OpenCL 1.1 (rev 33) and + * OpenCL 1.2 (rev 15) * \author Benedict R. Gaster, Laurent Morichetti and Lee Howes - * + * * Additions and fixes from: - * Brian Cole, March 3rd 2010 and April 2012 + * 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.9 * \date December 2015 * @@ -77,7 +77,7 @@ * * \code * #define __CL_ENABLE_EXCEPTIONS - * + * * #if defined(__APPLE__) || defined(__MACOSX) * #include * #else @@ -86,13 +86,13 @@ * #include * #include * #include - * + * * const char * helloStr = "__kernel void " * "hello(void) " * "{ " * " " * "} "; - * + * * int * main(void) * { @@ -106,33 +106,33 @@ * return -1; * } * - * cl_context_properties properties[] = + * cl_context_properties properties[] = * { CL_CONTEXT_PLATFORM, (cl_context_properties)(platforms[0])(), 0}; - * cl::Context context(CL_DEVICE_TYPE_CPU, properties); - * + * cl::Context context(CL_DEVICE_TYPE_CPU, properties); + * * std::vector devices = context.getInfo(); - * + * * cl::Program::Sources source(1, * std::make_pair(helloStr,strlen(helloStr))); * cl::Program program_ = cl::Program(context, source); * program_.build(devices); - * + * * cl::Kernel kernel(program_, "hello", &err); - * + * * cl::Event event; * cl::CommandQueue queue(context, devices[0], 0, &err); * queue.enqueueNDRangeKernel( - * kernel, - * cl::NullRange, + * kernel, + * cl::NullRange, * cl::NDRange(4,4), * cl::NullRange, * NULL, - * &event); - * + * &event); + * * event.wait(); * } * catch (cl::Error err) { - * std::cerr + * std::cerr * << "ERROR: " * << err.what() * << "(" @@ -140,10 +140,10 @@ * << ")" * << std::endl; * } - * + * * return EXIT_SUCCESS; * } - * + * * \endcode * */ @@ -164,7 +164,7 @@ #include #endif // _MSC_VER -// +// #if defined(USE_CL_DEVICE_FISSION) #include #endif @@ -194,13 +194,13 @@ #if defined(CL_VERSION_1_2) && !defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) #define __CL_EXPLICIT_CONSTRUCTORS explicit #else // #if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) -#define __CL_EXPLICIT_CONSTRUCTORS +#define __CL_EXPLICIT_CONSTRUCTORS #endif // #if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) // Define deprecated prefixes and suffixes to ensure compilation // in case they are not pre-defined #if !defined(CL_EXT_PREFIX__VERSION_1_1_DEPRECATED) -#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED +#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED #endif // #if !defined(CL_EXT_PREFIX__VERSION_1_1_DEPRECATED) #if !defined(CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED) #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED @@ -224,7 +224,7 @@ #if !defined(__NO_STD_STRING) #include -#endif +#endif #if defined(__ANDROID__) || defined(linux) || defined(__APPLE__) || defined(__MACOSX) #include @@ -245,7 +245,7 @@ class Memory; /** * Deprecated APIs for 1.2 */ -#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) || (defined(CL_VERSION_1_1) && !defined(CL_VERSION_1_2)) +#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) || (defined(CL_VERSION_1_1) && !defined(CL_VERSION_1_2)) #define __INIT_CL_EXT_FCN_PTR(name) \ if(!pfn_##name) { \ pfn_##name = (PFN_##name) \ @@ -273,8 +273,8 @@ class Memory; class Buffer; #if defined(__CL_ENABLE_EXCEPTIONS) -/*! \brief Exception class - * +/*! \brief Exception class + * * This may be thrown by API functions when __CL_ENABLE_EXCEPTIONS is defined. */ class Error : public std::exception @@ -285,7 +285,7 @@ private: public: /*! \brief Create a new CL error exception for a given error code * and corresponding message. - * + * * \param err error code value. * * \param errStr a descriptive string that must remain in scope until @@ -452,7 +452,7 @@ static inline cl_int errHandler (cl_int err, const char * errStr = NULL) /** * Deprecated APIs for 1.2 */ -#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) || (defined(CL_VERSION_1_1) && !defined(CL_VERSION_1_2)) +#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) || (defined(CL_VERSION_1_1) && !defined(CL_VERSION_1_2)) #define __ENQUEUE_MARKER_ERR __ERR_STR(clEnqueueMarker) #define __ENQUEUE_WAIT_FOR_EVENTS_ERR __ERR_STR(clEnqueueWaitForEvents) #define __ENQUEUE_BARRIER_ERR __ERR_STR(clEnqueueBarrier) @@ -476,12 +476,12 @@ static inline cl_int errHandler (cl_int err, const char * errStr = NULL) #if !defined(__USE_DEV_STRING) && !defined(__NO_STD_STRING) typedef std::string STRING_CLASS; -#elif !defined(__USE_DEV_STRING) +#elif !defined(__USE_DEV_STRING) /*! \class string * \brief Simple string class, that provides a limited subset of std::string * functionality but avoids many of the issues that come with that class. - + * \note Deprecated. Please use std::string as default or * re-define the string class to match the std::string * interface by defining STRING_CLASS @@ -499,10 +499,10 @@ public: /*! \brief Constructs a string populated from an arbitrary value of * specified size. - * + * * An extra '\0' is added, in case none was contained in str. * - * \param str the initial value of the string instance. Note that '\0' + * \param str the initial value of the string instance. Note that '\0' * characters receive no special treatment. If NULL, * the string is left empty, with a size of 0. * @@ -555,7 +555,7 @@ public: } str_ = NULL; size_ = 0; - } + } else { char *newString = new char[n + 1]; ::size_t copySize = n; @@ -563,7 +563,7 @@ public: copySize = size_; } size_ = n; - + if(str_) { memcpy(newString, str_, (copySize + 1) * sizeof(char)); } @@ -608,11 +608,11 @@ public: if (rhs.size_ == 0 || rhs.str_ == NULL) { str_ = NULL; size_ = 0; - } + } else { str_ = new char[rhs.size_ + 1]; size_ = rhs.size_; - + if (str_ != NULL) { memcpy(str_, rhs.str_, (size_ + 1) * sizeof(char)); } @@ -641,7 +641,7 @@ public: delete[] str_; str_ = NULL; } - + //! \brief Queries the length of the string, excluding any added '\0's. ::size_t size(void) const { return size_; } @@ -654,19 +654,19 @@ public: 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) +#endif // #elif !defined(__USE_DEV_STRING) #if !defined(__USE_DEV_VECTOR) && !defined(__NO_STD_VECTOR) #define VECTOR_CLASS std::vector -#elif !defined(__USE_DEV_VECTOR) -#define VECTOR_CLASS cl::vector +#elif !defined(__USE_DEV_VECTOR) +#define VECTOR_CLASS cl::vector #if !defined(__MAX_DEFAULT_VECTOR_SIZE) #define __MAX_DEFAULT_VECTOR_SIZE 10 #endif /*! \class vector - * \brief Fixed sized vector implementation that mirroring + * \brief Fixed sized vector implementation that mirroring * * \note Deprecated. Please use std::vector as default or * re-define the vector class to match the std::vector @@ -696,12 +696,12 @@ private: public: //! \brief Constructs an empty vector with no memory allocated. - vector() : + vector() : size_(static_cast(0)) {} //! \brief Deallocates the vector's memory and destroys all of its elements. - ~vector() + ~vector() { clear(); } @@ -711,7 +711,7 @@ public: { return size_; } - + /*! \brief Empties the vector of all elements. * \note * This does not deallocate memory but will invoke destructors @@ -725,11 +725,11 @@ public: } /*! \brief Appends an element after the last valid element. - * Calling this on a vector that has reached capacity will throw an + * Calling this on a vector that has reached capacity will throw an * exception if exceptions are enabled. */ void push_back (const T& x) - { + { if (size() < N) { new (&data_[size_]) T(x); size_++; @@ -756,13 +756,13 @@ public: * * \param vec the vector to copy. */ - vector(const vector& vec) : + vector(const vector& vec) : size_(vec.size_) { if (size_ != 0) { assign(vec.begin(), vec.end()); } - } + } /*! \brief Constructs with a specified number of initial elements. * @@ -791,7 +791,7 @@ public: return *this; } - if (rhs.size_ != 0) { + if (rhs.size_ != 0) { assign(rhs.begin(), rhs.end()); } else { clear(); @@ -817,19 +817,19 @@ public: } return true; } - + //! \brief Conversion operator to T*. operator T* () { return data_; } //! \brief Conversion operator to const T*. operator const T* () const { return data_; } - + //! \brief Tests whether this instance has any elements. bool empty (void) const { return size_==0; } - + //! \brief Returns the maximum number of elements this instance can hold. unsigned int max_size (void) const { @@ -874,7 +874,7 @@ public: { return data_[index]; } - + /*! \brief Returns a const reference to a given element. * * \param index which element to access. @@ -886,7 +886,7 @@ public: { return data_[index]; } - + /*! \brief Assigns elements of the vector based on a source iterator range. * * \param start Beginning iterator of source range @@ -898,7 +898,7 @@ public: template void assign(I start, I end) { - clear(); + clear(); while(start != end) { push_back(*start); start++; @@ -916,12 +916,12 @@ public: /** * Internal iterator constructor to capture reference - * to the vector it iterates over rather than taking + * to the vector it iterates over rather than taking * the vector by copy. */ iterator (const vector &vec, int index) : vec_(&vec) - { + { if( !vec.empty() ) { index_ = index; } else { @@ -930,7 +930,7 @@ public: } public: - iterator(void) : + iterator(void) : index_(-1), vec_(NULL) { @@ -957,10 +957,10 @@ public: return i; } - + bool operator==(iterator i) { - return ((vec_ == i.vec_) && + return ((vec_ == i.vec_) && (index_ == i.index_)); } @@ -1048,7 +1048,7 @@ public: namespace detail { -#define __DEFAULT_NOT_INITIALIZED 1 +#define __DEFAULT_NOT_INITIALIZED 1 #define __DEFAULT_BEING_INITIALIZED 2 #define __DEFAULT_INITIALIZED 4 @@ -1089,14 +1089,14 @@ namespace detail { } } // namespace detail - + /*! \brief class used to interface between C++ and * OpenCL C calls that require arrays of size_t values, whose * size is known statically. */ template class size_t -{ +{ private: ::size_t data_[N]; @@ -1226,7 +1226,7 @@ inline cl_int getInfoHelper(Func f, cl_uint name, STRING_CLASS* param, long) *param = value; return CL_SUCCESS; -#else +#else ::size_t required; cl_int err = f(name, 0, NULL, &required); if (err != CL_SUCCESS) { @@ -1443,7 +1443,7 @@ inline cl_int getInfoHelper(Func f, cl_uint name, T* param, int, typename T::cl_ F(cl_event_info, CL_EVENT_CONTEXT, cl::Context) #endif // CL_VERSION_1_1 - + #if defined(CL_VERSION_1_2) #define __PARAM_NAME_INFO_1_2(F) \ F(cl_image_info, CL_IMAGE_BUFFER, cl::Buffer) \ @@ -1630,7 +1630,7 @@ struct ReferenceHandler /** * Retain the device. * \param device A valid device created using createSubDevices - * \return + * \return * CL_SUCCESS if the function executed successfully. * CL_INVALID_DEVICE if device was not a valid subdevice * CL_OUT_OF_RESOURCES @@ -1641,7 +1641,7 @@ struct ReferenceHandler /** * Retain the device. * \param device A valid device created using createSubDevices - * \return + * \return * CL_SUCCESS if the function executed successfully. * CL_INVALID_DEVICE if device was not a valid subdevice * CL_OUT_OF_RESOURCES @@ -1896,24 +1896,24 @@ protected: } public: - Wrapper() : object_(NULL), referenceCountable_(false) - { - } - - Wrapper(const cl_type &obj) : object_(obj), referenceCountable_(false) + Wrapper() : object_(NULL), referenceCountable_(false) { - referenceCountable_ = isReferenceCountable(obj); + } + + Wrapper(const cl_type &obj) : object_(obj), referenceCountable_(false) + { + referenceCountable_ = isReferenceCountable(obj); } ~Wrapper() { if (object_ != NULL) { release(); } } - + Wrapper(const Wrapper& rhs) { object_ = rhs.object_; - referenceCountable_ = isReferenceCountable(object_); + referenceCountable_ = isReferenceCountable(object_); if (object_ != NULL) { detail::errHandler(retain(), __RETAIN_ERR); } } @@ -1956,7 +1956,7 @@ public: { if (object_ != NULL) { detail::errHandler(release(), __RELEASE_ERR); } object_ = rhs; - referenceCountable_ = isReferenceCountable(object_); + referenceCountable_ = isReferenceCountable(object_); return *this; } @@ -2037,7 +2037,7 @@ public: Device() : detail::Wrapper() { } /*! \brief Constructor from cl_device_id. - * + * * This simply copies the device ID value, which is an inexpensive operation. */ __CL_EXPLICIT_CONSTRUCTORS Device(const cl_device_id &device) : detail::Wrapper(device) { } @@ -2049,7 +2049,7 @@ public: static Device getDefault(cl_int * err = NULL); /*! \brief Assignment operator from cl_device_id. - * + * * This simply copies the device ID value, which is an inexpensive operation. */ Device& operator = (const cl_device_id& rhs) @@ -2146,7 +2146,7 @@ public: const cl_device_partition_property_ext * properties, VECTOR_CLASS* devices) { - typedef CL_API_ENTRY cl_int + typedef CL_API_ENTRY cl_int ( CL_API_CALL * PFN_clCreateSubDevicesEXT)( cl_device_id /*in_device*/, const cl_device_partition_property_ext * /* properties */, @@ -2190,13 +2190,13 @@ public: Platform() : detail::Wrapper() { } /*! \brief Constructor from cl_platform_id. - * + * * This simply copies the platform ID value, which is an inexpensive operation. */ __CL_EXPLICIT_CONSTRUCTORS Platform(const cl_platform_id &platform) : detail::Wrapper(platform) { } /*! \brief Assignment operator from cl_platform_id. - * + * * This simply copies the platform ID value, which is an inexpensive operation. */ Platform& operator = (const cl_platform_id& rhs) @@ -2228,7 +2228,7 @@ public: } /*! \brief Gets a list of devices for this platform. - * + * * Wraps clGetDeviceIDs(). */ cl_int getDevices( @@ -2285,8 +2285,8 @@ public: VECTOR_CLASS* devices) const { typedef CL_API_ENTRY cl_int (CL_API_CALL *PFN_clGetDeviceIDsFromD3D10KHR)( - cl_platform_id platform, - cl_d3d10_device_source_khr d3d_device_source, + cl_platform_id platform, + cl_d3d10_device_source_khr d3d_device_source, void * d3d_object, cl_d3d10_device_set_khr d3d_device_set, cl_uint num_entries, @@ -2302,12 +2302,12 @@ public: cl_uint n = 0; cl_int err = pfn_clGetDeviceIDsFromD3D10KHR( - object_, - d3d_device_source, + object_, + d3d_device_source, d3d_object, - d3d_device_set, - 0, - NULL, + d3d_device_set, + 0, + NULL, &n); if (err != CL_SUCCESS) { return detail::errHandler(err, __GET_DEVICE_IDS_ERR); @@ -2315,12 +2315,12 @@ public: cl_device_id* ids = (cl_device_id*) alloca(n * sizeof(cl_device_id)); err = pfn_clGetDeviceIDsFromD3D10KHR( - object_, - d3d_device_source, + object_, + d3d_device_source, d3d_object, d3d_device_set, - n, - ids, + n, + ids, NULL); if (err != CL_SUCCESS) { return detail::errHandler(err, __GET_DEVICE_IDS_ERR); @@ -2332,7 +2332,7 @@ public: #endif /*! \brief Gets a list of available platforms. - * + * * Wraps clGetPlatformIDs(). */ static cl_int get( @@ -2361,7 +2361,7 @@ public: } /*! \brief Gets the first available platform. - * + * * Wraps clGetPlatformIDs(), returning the first result. */ static cl_int get( @@ -2390,7 +2390,7 @@ public: } /*! \brief Gets the first available platform, returning it by value. - * + * * Wraps clGetPlatformIDs(), returning the first result. */ static Platform get( @@ -2419,17 +2419,17 @@ public: return Platform(); } - + return Platform(ids[0]); } - static Platform getDefault( + static Platform getDefault( cl_int *errResult = NULL ) { return get(errResult); } - + #if defined(CL_VERSION_1_2) //! \brief Wrapper for clUnloadCompiler(). cl_int @@ -2465,7 +2465,7 @@ UnloadCompiler() * * \see cl_context */ -class Context +class Context : public detail::Wrapper { private: @@ -2657,12 +2657,12 @@ public: * * \note All calls to this function return the same cl_context as the first. */ - static Context getDefault(cl_int * err = NULL) + static Context getDefault(cl_int * err = NULL) { int state = detail::compare_exchange( - &default_initialized_, + &default_initialized_, __DEFAULT_BEING_INITIALIZED, __DEFAULT_NOT_INITIALIZED); - + if (state & __DEFAULT_INITIALIZED) { if (err != NULL) { *err = default_error_; @@ -2709,14 +2709,14 @@ public: Context() : detail::Wrapper() { } /*! \brief Constructor from cl_context - takes ownership. - * + * * This effectively transfers ownership of a refcount on the cl_context * into the new Context object. */ __CL_EXPLICIT_CONSTRUCTORS Context(const cl_context& context) : detail::Wrapper(context) { } /*! \brief Assignment operator from cl_context - takes ownership. - * + * * This effectively transfers ownership of a refcount on the rhs and calls * clReleaseContext() on the value previously held by this instance. */ @@ -2750,7 +2750,7 @@ public: } /*! \brief Gets a list of supported image formats. - * + * * Wraps clGetSupportedImageFormats(). */ cl_int getSupportedImageFormats( @@ -2855,7 +2855,7 @@ public: Event() : detail::Wrapper() { } /*! \brief Constructor from cl_event - takes ownership. - * + * * This effectively transfers ownership of a refcount on the cl_event * into the new Event object. */ @@ -2919,7 +2919,7 @@ public: } /*! \brief Blocks the calling thread until this event completes. - * + * * Wraps clWaitForEvents(). */ cl_int wait() const @@ -2936,7 +2936,7 @@ public: */ cl_int setCallback( cl_int type, - void (CL_CALLBACK * pfn_notify)(cl_event, cl_int, void *), + void (CL_CALLBACK * pfn_notify)(cl_event, cl_int, void *), void * user_data = NULL) { return detail::errHandler( @@ -2944,13 +2944,13 @@ public: object_, type, pfn_notify, - user_data), + user_data), __SET_EVENT_CALLBACK_ERR); } #endif /*! \brief Blocks the calling thread until every event specified is complete. - * + * * Wraps clWaitForEvents(). */ static cl_int @@ -2965,7 +2965,7 @@ public: #if defined(CL_VERSION_1_1) /*! \brief Class interface for user events (a subset of cl_event's). - * + * * See Event for details about copy semantics, etc. */ class UserEvent : public Event @@ -3000,14 +3000,14 @@ public: cl_int setStatus(cl_int status) { return detail::errHandler( - ::clSetUserEventStatus(object_,status), + ::clSetUserEventStatus(object_,status), __SET_USER_EVENT_STATUS_ERR); } }; #endif /*! \brief Blocks the calling thread until every event specified is complete. - * + * * Wraps clWaitForEvents(). */ inline static cl_int @@ -3034,7 +3034,7 @@ public: Memory() : detail::Wrapper() { } /*! \brief Constructor from cl_mem - takes ownership. - * + * * This effectively transfers ownership of a refcount on the cl_mem * into the new Memory object. */ @@ -3119,14 +3119,14 @@ public: * value - not the Memory class instance. */ cl_int setDestructorCallback( - void (CL_CALLBACK * pfn_notify)(cl_mem, void *), + void (CL_CALLBACK * pfn_notify)(cl_mem, void *), void * user_data = NULL) { return detail::errHandler( ::clSetMemObjectDestructorCallback( object_, pfn_notify, - user_data), + user_data), __SET_MEM_OBJECT_DESTRUCTOR_CALLBACK_ERR); } #endif @@ -3146,7 +3146,7 @@ cl_int copy( const CommandQueue &queue, const cl::Buffer &buffer, IteratorType s /*! \brief Class interface for Buffer Memory Objects. - * + * * See Memory for details about copy semantics, etc. * * \see Memory @@ -3231,7 +3231,7 @@ public: if( useHostPtr ) { flags |= CL_MEM_USE_HOST_PTR; } - + ::size_t size = sizeof(DataType)*(endIterator - startIterator); Context context = Context::getDefault(err); @@ -3291,7 +3291,7 @@ public: Memory::operator=(rhs); return *this; } - + /*! \brief Copy constructor to forward copy to the superclass correctly. * Required for MSVC. */ @@ -3305,7 +3305,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. @@ -3336,10 +3336,10 @@ public: Buffer result; cl_int error; result.object_ = ::clCreateSubBuffer( - object_, - flags, - buffer_create_type, - buffer_create_info, + object_, + flags, + buffer_create_type, + buffer_create_info, &error); detail::errHandler(error, __CREATE_SUBBUFFER_ERR); @@ -3348,7 +3348,7 @@ public: } return result; - } + } #endif }; @@ -3356,7 +3356,7 @@ public: /*! \brief Class interface for creating OpenCL buffers from ID3D10Buffer's. * * This is provided to facilitate interoperability with Direct3D. - * + * * See Memory for details about copy semantics, etc. * * \see Memory @@ -3462,9 +3462,9 @@ public: /*! \brief Class interface for GL Buffer Memory Objects. * * This is provided to facilitate interoperability with OpenGL. - * + * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class BufferGL : public Buffer @@ -3557,7 +3557,7 @@ public: /*! \brief C++ base class for Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image : public Memory @@ -3621,7 +3621,7 @@ public: detail::getInfo(&::clGetImageInfo, object_, name, param), __GET_IMAGE_INFO_ERR); } - + //! \brief Wrapper for clGetImageInfo() that returns by value. template typename detail::param_traits::param_type @@ -3641,7 +3641,7 @@ public: /*! \brief Class interface for 1D Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image1D : public Image @@ -3667,11 +3667,11 @@ public: 0, 0, 0, 0, 0, 0, 0, 0 }; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - host_ptr, + context(), + flags, + &format, + &desc, + host_ptr, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -3753,11 +3753,11 @@ public: buffer() }; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - NULL, + context(), + flags, + &format, + &desc, + NULL, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -3775,7 +3775,7 @@ public: Image::operator=(rhs); return *this; } - + /*! \brief Copy constructor to forward copy to the superclass correctly. * Required for MSVC. */ @@ -3834,11 +3834,11 @@ public: 0, 0, 0, 0 }; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - host_ptr, + context(), + flags, + &format, + &desc, + host_ptr, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -3856,7 +3856,7 @@ public: Image::operator=(rhs); return *this; } - + /*! \brief Copy constructor to forward copy to the superclass correctly. * Required for MSVC. */ @@ -3893,7 +3893,7 @@ public: /*! \brief Class interface for 2D Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image2D : public Image @@ -4023,9 +4023,9 @@ public: /*! \brief Class interface for GL 2D Image Memory objects. * * This is provided to facilitate interoperability with OpenGL. - * + * * See Memory for details about copy semantics, etc. - * + * * \see Memory * \note Deprecated for OpenCL 1.2. Please use ImageGL instead. */ @@ -4060,7 +4060,7 @@ public: } } - + //! \brief Default constructor - initializes to NULL. Image2DGL() : Image2D() { } @@ -4144,11 +4144,11 @@ public: 0, 0, 0 }; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - host_ptr, + context(), + flags, + &format, + &desc, + host_ptr, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -4166,7 +4166,7 @@ public: Image::operator=(rhs); return *this; } - + /*! \brief Copy constructor to forward copy to the superclass correctly. * Required for MSVC. */ @@ -4202,7 +4202,7 @@ public: /*! \brief Class interface for 3D Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image3D : public Image @@ -4254,11 +4254,11 @@ public: 0, 0, 0 }; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - host_ptr, + context(), + flags, + &format, + &desc, + host_ptr, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -4336,9 +4336,9 @@ public: /*! \brief Class interface for GL 3D Image Memory objects. * * This is provided to facilitate interoperability with OpenGL. - * + * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image3DGL : public Image3D @@ -4443,8 +4443,8 @@ public: { cl_int error; object_ = ::clCreateFromGLTexture( - context(), - flags, + context(), + flags, target, miplevel, texobj, @@ -4506,7 +4506,7 @@ public: * * \see Memory */ -class BufferRenderGL : +class BufferRenderGL : #if defined(CL_VERSION_1_2) public ImageGL #else // #if defined(CL_VERSION_1_2) @@ -4567,7 +4567,7 @@ public: #else // #if defined(CL_VERSION_1_2) Image2DGL::operator=(rhs); #endif //#if defined(CL_VERSION_1_2) - + return *this; } @@ -4602,7 +4602,7 @@ public: #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. @@ -4614,7 +4614,7 @@ public: #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) @@ -4636,7 +4636,7 @@ public: * to the same underlying cl_sampler as the original. For details, see * clRetainSampler() and clReleaseSampler(). * - * \see cl_sampler + * \see cl_sampler */ class Sampler : public detail::Wrapper { @@ -4657,7 +4657,7 @@ public: { cl_int error; object_ = ::clCreateSampler( - context(), + context(), normalized_coords, addressing_mode, filter_mode, @@ -4670,7 +4670,7 @@ public: } /*! \brief Constructor from cl_sampler - takes ownership. - * + * * This effectively transfers ownership of a refcount on the cl_sampler * into the new Sampler object. */ @@ -4783,11 +4783,11 @@ public: } /*! \brief Conversion operator to const ::size_t *. - * + * * \returns a pointer to the size of the first dimension. */ - operator const ::size_t*() const { - return (const ::size_t*) sizes_; + operator const ::size_t*() const { + return (const ::size_t*) sizes_; } //! \brief Queries the number of dimensions in the range. @@ -4819,7 +4819,7 @@ struct KernelArgumentHandler static const void* ptr(const LocalSpaceArg&) { return NULL; } }; -} +} //! \endcond /*! __local @@ -4864,7 +4864,7 @@ public: Kernel() { } /*! \brief Constructor from cl_kernel - takes ownership. - * + * * This effectively transfers ownership of a refcount on the cl_kernel * into the new Kernel object. */ @@ -5114,7 +5114,7 @@ public: * Set to CL_INVALID_BINARY if the binary provided is not valid for the matching device. * \param err if non-NULL will be set to CL_SUCCESS on successful operation or one of the following errors: * CL_INVALID_CONTEXT if context is not a valid context. - * CL_INVALID_VALUE if the length of devices is zero; or if the length of binaries does not match the length of devices; + * CL_INVALID_VALUE if the length of devices is zero; or if the length of binaries does not match the length of devices; * or if any entry in binaries is NULL or has length 0. * CL_INVALID_DEVICE if OpenCL devices listed in devices are not in the list of devices associated with context. * CL_INVALID_BINARY if an invalid program binary was encountered for any device. binaryStatus will return specific status for each device. @@ -5128,9 +5128,9 @@ public: cl_int* err = NULL) { cl_int error; - + const ::size_t numDevices = devices.size(); - + // Catch size mismatch early and return if(binaries.size() != numDevices) { error = CL_INVALID_VALUE; @@ -5157,7 +5157,7 @@ public: if(binaryStatus) { binaryStatus->resize(numDevices); } - + object_ = ::clCreateProgramWithBinary( context(), (cl_uint) devices.size(), deviceIDs, @@ -5171,7 +5171,7 @@ public: } } - + #if defined(CL_VERSION_1_2) /** * Create program using builtin kernels. @@ -5191,12 +5191,12 @@ public: for( ::size_t deviceIndex = 0; deviceIndex < numDevices; ++deviceIndex ) { deviceIDs[deviceIndex] = (devices[deviceIndex])(); } - + object_ = ::clCreateProgramWithBuiltInKernels( - context(), + context(), (cl_uint) devices.size(), deviceIDs, - kernelNames.c_str(), + kernelNames.c_str(), &error); detail::errHandler(error, __CREATE_PROGRAM_WITH_BUILT_IN_KERNELS_ERR); @@ -5378,7 +5378,7 @@ inline Program linkProgram( const char* options = NULL, void (CL_CALLBACK * notifyFptr)(cl_program, void *) = NULL, void* data = NULL, - cl_int* err = NULL) + cl_int* err = NULL) { cl_int error_local = CL_SUCCESS; @@ -5413,7 +5413,7 @@ inline Program linkProgram( const char* options = NULL, void (CL_CALLBACK * notifyFptr)(cl_program, void *) = NULL, void* data = NULL, - cl_int* err = NULL) + cl_int* err = NULL) { cl_int error_local = CL_SUCCESS; @@ -5423,7 +5423,7 @@ inline Program linkProgram( for (unsigned int i = 0; i < inputPrograms.size(); i++) { programs[i] = inputPrograms[i](); } - } + } Context ctx; if(inputPrograms.size() > 0) { @@ -5457,14 +5457,14 @@ inline VECTOR_CLASS cl::Program::getInfo(cl_int* er { VECTOR_CLASS< ::size_t> sizes = getInfo(); VECTOR_CLASS binaries; - for (VECTOR_CLASS< ::size_t>::iterator s = sizes.begin(); s != sizes.end(); ++s) + for (VECTOR_CLASS< ::size_t>::iterator s = sizes.begin(); s != sizes.end(); ++s) { char *ptr = NULL; - if (*s != 0) + if (*s != 0) ptr = new char[*s]; binaries.push_back(ptr); } - + cl_int result = getInfo(CL_PROGRAM_BINARIES, &binaries); if (err != NULL) { *err = result; @@ -5603,12 +5603,12 @@ public: } #endif // #if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED) - static CommandQueue getDefault(cl_int * err = NULL) + static CommandQueue getDefault(cl_int * err = NULL) { int state = detail::compare_exchange( - &default_initialized_, + &default_initialized_, __DEFAULT_BEING_INITIALIZED, __DEFAULT_NOT_INITIALIZED); - + if (state & __DEFAULT_INITIALIZED) { if (err != NULL) { *err = default_error_; @@ -5787,9 +5787,9 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueReadBufferRect( - object_, - buffer(), - blocking, + object_, + buffer(), + blocking, (const ::size_t *)buffer_offset, (const ::size_t *)host_offset, (const ::size_t *)region, @@ -5826,9 +5826,9 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueWriteBufferRect( - object_, - buffer(), - blocking, + object_, + buffer(), + blocking, (const ::size_t *)buffer_offset, (const ::size_t *)host_offset, (const ::size_t *)region, @@ -5864,11 +5864,11 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueCopyBufferRect( - object_, - src(), - dst(), - (const ::size_t *)src_origin, - (const ::size_t *)dst_origin, + object_, + src(), + dst(), + (const ::size_t *)src_origin, + (const ::size_t *)dst_origin, (const ::size_t *)region, src_row_pitch, src_slice_pitch, @@ -5889,7 +5889,7 @@ public: /** * Enqueue a command to fill a buffer object with a pattern * of a given size. The pattern is specified a as vector. - * \tparam PatternType The datatype of the pattern field. + * \tparam PatternType The datatype of the pattern field. * The pattern type must be an accepted OpenCL data type. */ template @@ -5904,11 +5904,11 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueFillBuffer( - object_, + object_, buffer(), static_cast(&pattern), - sizeof(PatternType), - offset, + sizeof(PatternType), + offset, size, (events != NULL) ? (cl_uint) events->size() : 0, (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL, @@ -6020,10 +6020,10 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueFillImage( - object_, + object_, image(), - static_cast(&fillColor), - (const ::size_t *) origin, + static_cast(&fillColor), + (const ::size_t *) origin, (const ::size_t *) region, (events != NULL) ? (cl_uint) events->size() : 0, (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL, @@ -6054,10 +6054,10 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueFillImage( - object_, + object_, image(), - static_cast(&fillColor), - (const ::size_t *) origin, + static_cast(&fillColor), + (const ::size_t *) origin, (const ::size_t *) region, (events != NULL) ? (cl_uint) events->size() : 0, (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL, @@ -6088,10 +6088,10 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueFillImage( - object_, + object_, image(), - static_cast(&fillColor), - (const ::size_t *) origin, + static_cast(&fillColor), + (const ::size_t *) origin, (const ::size_t *) region, (events != NULL) ? (cl_uint) events->size() : 0, (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL, @@ -6239,14 +6239,14 @@ public: #if defined(CL_VERSION_1_2) /** - * Enqueues a marker command which waits for either a list of events to complete, + * Enqueues a marker command which waits for either a list of events to complete, * or all previously enqueued commands to complete. * - * Enqueues a marker command which waits for either a list of events to complete, - * or if the list is empty it waits for all commands previously enqueued in command_queue - * to complete before it completes. This command returns an event which can be waited on, - * i.e. this event can be waited on to insure that all events either in the event_wait_list - * or all previously enqueued commands, queued before this command to command_queue, + * Enqueues a marker command which waits for either a list of events to complete, + * or if the list is empty it waits for all commands previously enqueued in command_queue + * to complete before it completes. This command returns an event which can be waited on, + * i.e. this event can be waited on to insure that all events either in the event_wait_list + * or all previously enqueued commands, queued before this command to command_queue, * have completed. */ cl_int enqueueMarkerWithWaitList( @@ -6271,12 +6271,12 @@ public: /** * A synchronization point that enqueues a barrier operation. * - * Enqueues a barrier command which waits for either a list of events to complete, - * or if the list is empty it waits for all commands previously enqueued in command_queue - * to complete before it completes. This command blocks command execution, that is, any - * following commands enqueued after it do not execute until it completes. This command - * returns an event which can be waited on, i.e. this event can be waited on to insure that - * all events either in the event_wait_list or all previously enqueued commands, queued + * Enqueues a barrier command which waits for either a list of events to complete, + * or if the list is empty it waits for all commands previously enqueued in command_queue + * to complete before it completes. This command blocks command execution, that is, any + * following commands enqueued after it do not execute until it completes. This command + * returns an event which can be waited on, i.e. this event can be waited on to insure that + * all events either in the event_wait_list or all previously enqueued commands, queued * before this command to command_queue, have completed. */ cl_int enqueueBarrierWithWaitList( @@ -6297,7 +6297,7 @@ public: return err; } - + /** * Enqueues a command to indicate with which device a set of memory objects * should be associated. @@ -6310,7 +6310,7 @@ public: ) const { cl_event tmp; - + cl_mem* localMemObjects = static_cast(alloca(memObjects.size() * sizeof(cl_mem))); for( int i = 0; i < (int)memObjects.size(); ++i ) { localMemObjects[i] = memObjects[i](); @@ -6319,8 +6319,8 @@ public: cl_int err = detail::errHandler( ::clEnqueueMigrateMemObjects( - object_, - (cl_uint)memObjects.size(), + object_, + (cl_uint)memObjects.size(), static_cast(localMemObjects), flags, (events != NULL) ? (cl_uint) events->size() : 0, @@ -6389,7 +6389,7 @@ public: const VECTOR_CLASS* events = NULL, Event* event = NULL) const { - cl_mem * mems = (mem_objects != NULL && mem_objects->size() > 0) + cl_mem * mems = (mem_objects != NULL && mem_objects->size() > 0) ? (cl_mem*) alloca(mem_objects->size() * sizeof(cl_mem)) : NULL; @@ -6420,14 +6420,14 @@ public: /** * Deprecated APIs for 1.2 */ -#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) || (defined(CL_VERSION_1_1) && !defined(CL_VERSION_1_2)) - CL_EXT_PREFIX__VERSION_1_1_DEPRECATED +#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) || (defined(CL_VERSION_1_1) && !defined(CL_VERSION_1_2)) + CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int enqueueMarker(Event* event = NULL) const CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED { cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueMarker( - object_, + object_, (event != NULL) ? &tmp : NULL), __ENQUEUE_MARKER_ERR); @@ -6518,7 +6518,7 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *PFN_clEnqueueReleaseD3D10ObjectsKHR)( #if defined(CL_VERSION_1_1) __INIT_CL_EXT_FCN_PTR(clEnqueueAcquireD3D10ObjectsKHR); #endif - + cl_event tmp; cl_int err = detail::errHandler( pfn_clEnqueueAcquireD3D10ObjectsKHR( @@ -6573,7 +6573,7 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *PFN_clEnqueueReleaseD3D10ObjectsKHR)( /** * Deprecated APIs for 1.2 */ -#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) || (defined(CL_VERSION_1_1) && !defined(CL_VERSION_1_2)) +#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) || (defined(CL_VERSION_1_1) && !defined(CL_VERSION_1_2)) CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int enqueueBarrier() const CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED { @@ -6634,7 +6634,7 @@ Buffer::Buffer( if( useHostPtr ) { flags |= CL_MEM_USE_HOST_PTR; } - + ::size_t size = sizeof(DataType)*(endIterator - startIterator); if( useHostPtr ) { @@ -6869,11 +6869,11 @@ inline cl_int copy( const CommandQueue &queue, IteratorType startIterator, Itera { typedef typename std::iterator_traits::value_type DataType; cl_int error; - + ::size_t length = endIterator-startIterator; ::size_t byteLength = length*sizeof(DataType); - DataType *pointer = + DataType *pointer = 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 ) { @@ -6881,8 +6881,8 @@ inline cl_int copy( const CommandQueue &queue, IteratorType startIterator, Itera } #if defined(_MSC_VER) std::copy( - startIterator, - endIterator, + startIterator, + endIterator, stdext::checked_array_iterator( pointer, length)); #else @@ -6891,7 +6891,7 @@ inline cl_int copy( const CommandQueue &queue, IteratorType startIterator, Itera Event endEvent; error = queue.enqueueUnmapMemObject(buffer, pointer, 0, &endEvent); // if exceptions enabled, enqueueUnmapMemObject will throw - if( error != CL_SUCCESS ) { + if( error != CL_SUCCESS ) { return error; } endEvent.wait(); @@ -6908,11 +6908,11 @@ inline cl_int copy( const CommandQueue &queue, const cl::Buffer &buffer, Iterato { typedef typename std::iterator_traits::value_type DataType; cl_int error; - + ::size_t length = endIterator-startIterator; ::size_t byteLength = length*sizeof(DataType); - DataType *pointer = + DataType *pointer = 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 ) { @@ -6922,7 +6922,7 @@ inline cl_int copy( const CommandQueue &queue, const cl::Buffer &buffer, Iterato Event endEvent; error = queue.enqueueUnmapMemObject(buffer, pointer, 0, &endEvent); // if exceptions enabled, enqueueUnmapMemObject will throw - if( error != CL_SUCCESS ) { + if( error != CL_SUCCESS ) { return error; } endEvent.wait(); @@ -6952,17 +6952,17 @@ inline cl_int enqueueReadBufferRect( } return queue.enqueueReadBufferRect( - buffer, - blocking, - buffer_offset, + buffer, + blocking, + buffer_offset, host_offset, region, buffer_row_pitch, buffer_slice_pitch, host_row_pitch, host_slice_pitch, - ptr, - events, + ptr, + events, event); } @@ -6988,17 +6988,17 @@ inline cl_int enqueueWriteBufferRect( } return queue.enqueueWriteBufferRect( - buffer, - blocking, - buffer_offset, + buffer, + blocking, + buffer_offset, host_offset, region, buffer_row_pitch, buffer_slice_pitch, host_row_pitch, host_slice_pitch, - ptr, - events, + ptr, + events, event); } @@ -7032,7 +7032,7 @@ inline cl_int enqueueCopyBufferRect( src_slice_pitch, dst_row_pitch, dst_slice_pitch, - events, + events, event); } #endif @@ -7046,7 +7046,7 @@ inline cl_int enqueueReadImage( ::size_t slice_pitch, void* ptr, const VECTOR_CLASS* events = NULL, - Event* event = NULL) + Event* event = NULL) { cl_int error; CommandQueue queue = CommandQueue::getDefault(&error); @@ -7063,7 +7063,7 @@ inline cl_int enqueueReadImage( row_pitch, slice_pitch, ptr, - events, + events, event); } @@ -7093,7 +7093,7 @@ inline cl_int enqueueWriteImage( row_pitch, slice_pitch, ptr, - events, + events, event); } @@ -7195,7 +7195,7 @@ inline cl_int finish(void) if (error != CL_SUCCESS) { return error; - } + } return queue.finish(); @@ -7214,63 +7214,63 @@ struct EnqueueArgs const NDRange local_; VECTOR_CLASS events_; - EnqueueArgs(NDRange global) : + EnqueueArgs(NDRange global) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange) { } - EnqueueArgs(NDRange global, NDRange local) : + EnqueueArgs(NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local) { } - EnqueueArgs(NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(NDRange offset, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(offset), + offset_(offset), global_(global), local_(local) { } - EnqueueArgs(Event e, NDRange global) : + EnqueueArgs(Event e, NDRange global) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange) { events_.push_back(e); } - EnqueueArgs(Event e, NDRange global, NDRange local) : + EnqueueArgs(Event e, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local) { events_.push_back(e); } - EnqueueArgs(Event e, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(Event e, NDRange offset, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(offset), + offset_(offset), global_(global), local_(local) { events_.push_back(e); } - EnqueueArgs(const VECTOR_CLASS &events, NDRange global) : + EnqueueArgs(const VECTOR_CLASS &events, NDRange global) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange), events_(events) @@ -7278,9 +7278,9 @@ struct EnqueueArgs } - EnqueueArgs(const VECTOR_CLASS &events, NDRange global, NDRange local) : + EnqueueArgs(const VECTOR_CLASS &events, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local), events_(events) @@ -7288,9 +7288,9 @@ struct EnqueueArgs } - EnqueueArgs(const VECTOR_CLASS &events, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(const VECTOR_CLASS &events, NDRange offset, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(offset), + offset_(offset), global_(global), local_(local), events_(events) @@ -7298,63 +7298,63 @@ struct EnqueueArgs } - EnqueueArgs(CommandQueue &queue, NDRange global) : + EnqueueArgs(CommandQueue &queue, NDRange global) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange) { } - EnqueueArgs(CommandQueue &queue, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, NDRange global, NDRange local) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local) { } - EnqueueArgs(CommandQueue &queue, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, NDRange offset, NDRange global, NDRange local) : queue_(queue), - offset_(offset), + offset_(offset), global_(global), local_(local) { } - EnqueueArgs(CommandQueue &queue, Event e, NDRange global) : + EnqueueArgs(CommandQueue &queue, Event e, NDRange global) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange) { events_.push_back(e); } - EnqueueArgs(CommandQueue &queue, Event e, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, Event e, NDRange global, NDRange local) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local) { events_.push_back(e); } - EnqueueArgs(CommandQueue &queue, Event e, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, Event e, NDRange offset, NDRange global, NDRange local) : queue_(queue), - offset_(offset), + offset_(offset), global_(global), local_(local) { events_.push_back(e); } - EnqueueArgs(CommandQueue &queue, const VECTOR_CLASS &events, NDRange global) : + EnqueueArgs(CommandQueue &queue, const VECTOR_CLASS &events, NDRange global) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange), events_(events) @@ -7362,9 +7362,9 @@ struct EnqueueArgs } - EnqueueArgs(CommandQueue &queue, const VECTOR_CLASS &events, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, const VECTOR_CLASS &events, NDRange global, NDRange local) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local), events_(events) @@ -7372,9 +7372,9 @@ struct EnqueueArgs } - EnqueueArgs(CommandQueue &queue, const VECTOR_CLASS &events, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, const VECTOR_CLASS &events, NDRange offset, NDRange global, NDRange local) : queue_(queue), - offset_(offset), + offset_(offset), global_(global), local_(local), events_(events) @@ -7394,13 +7394,13 @@ struct SetArg { kernel.setArg(index, arg); } -}; +}; template struct SetArg { static void set (Kernel, NullType) - { + { } }; @@ -7504,7 +7504,7 @@ public: SetArg<30, T30>::set(kernel_, t30); SetArg<31, T31>::set(kernel_, t31); - + args.queue_.enqueueNDRangeKernel( kernel_, args.offset_, @@ -7512,7 +7512,7 @@ public: args.local_, &args.events_, &event); - + return event; } @@ -7595,12 +7595,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 32)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -7821,12 +7821,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 31)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -8043,12 +8043,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 30)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -8261,12 +8261,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 29)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -8475,12 +8475,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 28)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -8685,12 +8685,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 27)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -8891,12 +8891,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 26)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -9093,12 +9093,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 25)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -9291,12 +9291,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 24)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -9485,12 +9485,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 23)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -9675,12 +9675,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 22)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -9861,12 +9861,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 21)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -10043,12 +10043,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 20)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -10221,12 +10221,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 19)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -10395,12 +10395,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 18)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -10565,12 +10565,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 17)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -10731,12 +10731,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 16)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -10893,12 +10893,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 15)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -11051,12 +11051,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 14)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -11205,12 +11205,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 13)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -11355,12 +11355,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 12)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -11501,12 +11501,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 11)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -11643,12 +11643,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 10)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -11781,12 +11781,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 9)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -11915,12 +11915,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 8)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -12045,12 +12045,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 7)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -12171,12 +12171,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 6)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -12293,12 +12293,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 5)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -12411,12 +12411,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 4)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -12525,12 +12525,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 3)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -12635,12 +12635,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 2)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -12741,12 +12741,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 1)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -12810,7 +12810,7 @@ struct make_kernel : > { public: - typedef detail::KernelFunctorGlobal< + typedef detail::KernelFunctorGlobal< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, @@ -12837,7 +12837,7 @@ public: T28, T29, T30, T31 >( - FunctorType(program, name, err)) + FunctorType(program, name, err)) {} make_kernel( @@ -12853,8 +12853,8 @@ public: T28, T29, T30, T31 >( - FunctorType(kernel)) - {} + FunctorType(kernel)) + {} }; @@ -12944,8 +12944,8 @@ public: #undef __PARAM_NAME_DEVICE_FISSION #endif // USE_CL_DEVICE_FISSION -#undef __DEFAULT_NOT_INITIALIZED -#undef __DEFAULT_BEING_INITIALIZED +#undef __DEFAULT_NOT_INITIALIZED +#undef __DEFAULT_BEING_INITIALIZED #undef __DEFAULT_INITIALIZED #undef CL_HPP_RVALUE_REFERENCES_SUPPORTED diff --git a/projects/clr/opencl/khronos/headers/opencl2.0/CL/cl2.hpp b/projects/clr/opencl/khronos/headers/opencl2.0/CL/cl2.hpp index 09764a0060..18ac0a935d 100644 --- a/projects/clr/opencl/khronos/headers/opencl2.0/CL/cl2.hpp +++ b/projects/clr/opencl/khronos/headers/opencl2.0/CL/cl2.hpp @@ -86,17 +86,17 @@ * fixes in the new header as well as additional OpenCL 2.0 features. * As a result the header is not directly backward compatible and for this * reason we release it as cl2.hpp rather than a new version of cl.hpp. - * + * * * \section compatibility Compatibility * Due to the evolution of the underlying OpenCL API the 2.0 C++ bindings * include an updated approach to defining supported feature versions * and the range of valid underlying OpenCL runtime versions supported. * - * The combination of preprocessor macros CL_HPP_TARGET_OPENCL_VERSION and + * The combination of preprocessor macros CL_HPP_TARGET_OPENCL_VERSION and * CL_HPP_MINIMUM_OPENCL_VERSION control this range. These are three digit - * decimal values representing OpenCL runime versions. The default for - * the target is 200, representing OpenCL 2.0 and the minimum is also + * decimal values representing OpenCL runime versions. The default for + * the target is 200, representing OpenCL 2.0 and the minimum is also * defined as 200. These settings would use 2.0 API calls only. * If backward compatibility with a 1.2 runtime is required, the minimum * version may be set to 120. @@ -104,21 +104,21 @@ * Note that this is a compile-time setting, and so affects linking against * a particular SDK version rather than the versioning of the loaded runtime. * - * The earlier versions of the header included basic vector and string - * classes based loosely on STL versions. These were difficult to + * The earlier versions of the header included basic vector and string + * classes based loosely on STL versions. These were difficult to * maintain and very rarely used. For the 2.0 header we now assume * the presence of the standard library unless requested otherwise. - * We use std::array, std::vector, std::shared_ptr and std::string - * throughout to safely manage memory and reduce the chance of a + * We use std::array, std::vector, std::shared_ptr and std::string + * throughout to safely manage memory and reduce the chance of a * recurrance of earlier memory management bugs. * - * These classes are used through typedefs in the cl namespace: + * These classes are used through typedefs in the cl namespace: * cl::array, cl::vector, cl::pointer and cl::string. * In addition cl::allocate_pointer forwards to std::allocate_shared * by default. - * In all cases these standard library classes can be replaced with - * custom interface-compatible versions using the CL_HPP_NO_STD_ARRAY, - * CL_HPP_NO_STD_VECTOR, CL_HPP_NO_STD_UNIQUE_PTR and + * In all cases these standard library classes can be replaced with + * custom interface-compatible versions using the CL_HPP_NO_STD_ARRAY, + * CL_HPP_NO_STD_VECTOR, CL_HPP_NO_STD_UNIQUE_PTR and * CL_HPP_NO_STD_STRING macros. * * The OpenCL 1.x versions of the C++ bindings included a size_t wrapper @@ -129,12 +129,12 @@ * using the CL_HPP_ENABLE_SIZE_T_COMPATIBILITY macro. * * Finally, the program construction interface used a clumsy vector-of-pairs - * design in the earlier versions. We have replaced that with a cleaner - * vector-of-vectors and vector-of-strings design. However, for backward + * design in the earlier versions. We have replaced that with a cleaner + * vector-of-vectors and vector-of-strings design. However, for backward * compatibility old behaviour can be regained with the * CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY macro. - * - * In OpenCL 2.0 OpenCL C is not entirely backward compatibility with + * + * In OpenCL 2.0 OpenCL C is not entirely backward compatibility with * earlier versions. As a result a flag must be passed to the OpenCL C * compiled to request OpenCL 2.0 compilation of kernels with 1.2 as * the default in the absence of the flag. @@ -485,17 +485,17 @@ #if defined(_MSC_VER) #include -#endif // _MSC_VER - +#endif // _MSC_VER + // Check for a valid C++ version -// Need to do both tests here because for some reason __cplusplus is not +// Need to do both tests here because for some reason __cplusplus is not // updated in visual studio #if (!defined(_MSC_VER) && __cplusplus < 201103L) || (defined(_MSC_VER) && _MSC_VER < 1700) #error Visual studio 2013 or another C++11-supporting compiler required #endif -// +// #if defined(CL_HPP_USE_CL_DEVICE_FISSION) || defined(CL_HPP_USE_CL_SUB_GROUPS_KHR) #include #endif @@ -521,14 +521,14 @@ // Define deprecated prefixes and suffixes to ensure compilation // in case they are not pre-defined #if !defined(CL_EXT_PREFIX__VERSION_1_1_DEPRECATED) -#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED +#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED #endif // #if !defined(CL_EXT_PREFIX__VERSION_1_1_DEPRECATED) #if !defined(CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED) #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED #endif // #if !defined(CL_EXT_PREFIX__VERSION_1_1_DEPRECATED) #if !defined(CL_EXT_PREFIX__VERSION_1_2_DEPRECATED) -#define CL_EXT_PREFIX__VERSION_1_2_DEPRECATED +#define CL_EXT_PREFIX__VERSION_1_2_DEPRECATED #endif // #if !defined(CL_EXT_PREFIX__VERSION_1_2_DEPRECATED) #if !defined(CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED) #define CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED @@ -587,7 +587,7 @@ namespace cl { template using pointer = std::unique_ptr; } // namespace cl -#endif +#endif #endif // #if CL_HPP_TARGET_OPENCL_VERSION >= 200 #if !defined(CL_HPP_NO_STD_ARRAY) #include @@ -703,8 +703,8 @@ namespace cl { class Pipe; #if defined(CL_HPP_ENABLE_EXCEPTIONS) - /*! \brief Exception class - * + /*! \brief Exception class + * * This may be thrown by API functions when CL_HPP_ENABLE_EXCEPTIONS is defined. */ class Error : public std::exception @@ -715,7 +715,7 @@ namespace cl { public: /*! \brief Create a new CL error exception for a given error code * and corresponding message. - * + * * \param err error code value. * * \param errStr a descriptive string that must remain in scope until @@ -1064,7 +1064,7 @@ inline cl_int getInfoHelper(Func f, cl_uint name, array* param, lo if (err != CL_SUCCESS) { return err; } - + // Bound the copy with N to prevent overruns // if passed N > than the amount copied if (elements > N) { @@ -1472,7 +1472,7 @@ struct ReferenceHandler /** * Retain the device. * \param device A valid device created using createSubDevices - * \return + * \return * CL_SUCCESS if the function executed successfully. * CL_INVALID_DEVICE if device was not a valid subdevice * CL_OUT_OF_RESOURCES @@ -1483,7 +1483,7 @@ struct ReferenceHandler /** * Retain the device. * \param device A valid device created using createSubDevices - * \return + * \return * CL_SUCCESS if the function executed successfully. * CL_INVALID_DEVICE if device was not a valid subdevice * CL_OUT_OF_RESOURCES @@ -1646,11 +1646,11 @@ protected: public: Wrapper() : object_(NULL) { } - - Wrapper(const cl_type &obj, bool retainObject) : object_(obj) + + Wrapper(const cl_type &obj, bool retainObject) : object_(obj) { - if (retainObject) { - detail::errHandler(retain(), __RETAIN_ERR); + if (retainObject) { + detail::errHandler(retain(), __RETAIN_ERR); } } @@ -1761,15 +1761,15 @@ protected: } public: - Wrapper() : object_(NULL), referenceCountable_(false) - { - } - - Wrapper(const cl_type &obj, bool retainObject) : - object_(obj), - referenceCountable_(false) + Wrapper() : object_(NULL), referenceCountable_(false) { - referenceCountable_ = isReferenceCountable(obj); + } + + Wrapper(const cl_type &obj, bool retainObject) : + object_(obj), + referenceCountable_(false) + { + referenceCountable_ = isReferenceCountable(obj); if (retainObject) { detail::errHandler(retain(), __RETAIN_ERR); @@ -1780,11 +1780,11 @@ public: { release(); } - + Wrapper(const Wrapper& rhs) { object_ = rhs.object_; - referenceCountable_ = isReferenceCountable(object_); + referenceCountable_ = isReferenceCountable(object_); detail::errHandler(retain(), __RETAIN_ERR); } @@ -1823,7 +1823,7 @@ public: { detail::errHandler(release(), __RELEASE_ERR); object_ = rhs; - referenceCountable_ = isReferenceCountable(object_); + referenceCountable_ = isReferenceCountable(object_); return *this; } @@ -2001,10 +2001,10 @@ public: Device() : detail::Wrapper() { } /*! \brief Constructor from cl_device_id. - * + * * This simply copies the device ID value, which is an inexpensive operation. */ - explicit Device(const cl_device_id &device, bool retainObject = false) : + explicit Device(const cl_device_id &device, bool retainObject = false) : detail::Wrapper(device, retainObject) { } /*! \brief Returns the first device on the default context. @@ -2037,7 +2037,7 @@ public: } /*! \brief Assignment operator from cl_device_id. - * + * * This simply copies the device ID value, which is an inexpensive operation. */ Device& operator = (const cl_device_id& rhs) @@ -2118,7 +2118,7 @@ public: return detail::errHandler(err, __CREATE_SUB_DEVICES_ERR); } - // Cannot trivially assign because we need to capture intermediates + // Cannot trivially assign because we need to capture intermediates // with safe construction if (devices) { devices->resize(ids.size()); @@ -2126,7 +2126,7 @@ public: // Assign to param, constructing with retain behaviour // to correctly capture each underlying CL object for (size_type i = 0; i < ids.size(); i++) { - // We do not need to retain because this device is being created + // We do not need to retain because this device is being created // by the runtime (*devices)[i] = Device(ids[i], false); } @@ -2143,7 +2143,7 @@ public: const cl_device_partition_property_ext * properties, vector* devices) { - typedef CL_API_ENTRY cl_int + typedef CL_API_ENTRY cl_int ( CL_API_CALL * PFN_clCreateSubDevicesEXT)( cl_device_id /*in_device*/, const cl_device_partition_property_ext * /* properties */, @@ -2165,7 +2165,7 @@ public: if (err != CL_SUCCESS) { return detail::errHandler(err, __CREATE_SUB_DEVICES_ERR); } - // Cannot trivially assign because we need to capture intermediates + // Cannot trivially assign because we need to capture intermediates // with safe construction if (devices) { devices->resize(ids.size()); @@ -2173,7 +2173,7 @@ public: // Assign to param, constructing with retain behaviour // to correctly capture each underlying CL object for (size_type i = 0; i < ids.size(); i++) { - // We do not need to retain because this device is being created + // We do not need to retain because this device is being created // by the runtime (*devices)[i] = Device(ids[i], false); } @@ -2252,7 +2252,7 @@ private: static void makeDefaultProvided(const Platform &p) { default_ = p; } - + public: #ifdef CL_HPP_UNIT_TEST_ENABLE /*! \brief Reset the default. @@ -2270,17 +2270,17 @@ public: Platform() : detail::Wrapper() { } /*! \brief Constructor from cl_platform_id. - * + * * \param retainObject will cause the constructor to retain its cl object. * Defaults to false to maintain compatibility with * earlier versions. * This simply copies the platform ID value, which is an inexpensive operation. */ - explicit Platform(const cl_platform_id &platform, bool retainObject = false) : + explicit Platform(const cl_platform_id &platform, bool retainObject = false) : detail::Wrapper(platform, retainObject) { } /*! \brief Assignment operator from cl_platform_id. - * + * * This simply copies the platform ID value, which is an inexpensive operation. */ Platform& operator = (const cl_platform_id& rhs) @@ -2301,10 +2301,10 @@ public: } /** - * Modify the default platform to be used by + * Modify the default platform to be used by * subsequent operations. * Will only set the default if no default was previously created. - * @return updated default platform. + * @return updated default platform. * Should be compared to the passed value to ensure that it was updated. */ static Platform setDefault(const Platform &default_platform) @@ -2337,7 +2337,7 @@ public: } /*! \brief Gets a list of devices for this platform. - * + * * Wraps clGetDeviceIDs(). */ cl_int getDevices( @@ -2359,7 +2359,7 @@ public: return detail::errHandler(err, __GET_DEVICE_IDS_ERR); } - // Cannot trivially assign because we need to capture intermediates + // Cannot trivially assign because we need to capture intermediates // with safe construction // We must retain things we obtain from the API to avoid releasing // API-owned objects. @@ -2406,8 +2406,8 @@ public: vector* devices) const { typedef CL_API_ENTRY cl_int (CL_API_CALL *PFN_clGetDeviceIDsFromD3D10KHR)( - cl_platform_id platform, - cl_d3d10_device_source_khr d3d_device_source, + cl_platform_id platform, + cl_d3d10_device_source_khr d3d_device_source, void * d3d_object, cl_d3d10_device_set_khr d3d_device_set, cl_uint num_entries, @@ -2423,12 +2423,12 @@ public: cl_uint n = 0; cl_int err = pfn_clGetDeviceIDsFromD3D10KHR( - object_, - d3d_device_source, + object_, + d3d_device_source, d3d_object, - d3d_device_set, - 0, - NULL, + d3d_device_set, + 0, + NULL, &n); if (err != CL_SUCCESS) { return detail::errHandler(err, __GET_DEVICE_IDS_ERR); @@ -2436,18 +2436,18 @@ public: vector ids(n); err = pfn_clGetDeviceIDsFromD3D10KHR( - object_, - d3d_device_source, + object_, + d3d_device_source, d3d_object, d3d_device_set, - n, - ids.data(), + n, + ids.data(), NULL); if (err != CL_SUCCESS) { return detail::errHandler(err, __GET_DEVICE_IDS_ERR); } - // Cannot trivially assign because we need to capture intermediates + // Cannot trivially assign because we need to capture intermediates // with safe construction // We must retain things we obtain from the API to avoid releasing // API-owned objects. @@ -2465,7 +2465,7 @@ public: #endif /*! \brief Gets a list of available platforms. - * + * * Wraps clGetPlatformIDs(). */ static cl_int get( @@ -2500,7 +2500,7 @@ public: } /*! \brief Gets the first available platform. - * + * * Wraps clGetPlatformIDs(), returning the first result. */ static cl_int get( @@ -2531,8 +2531,8 @@ public: *errResult = err; } return default_platform; - } - + } + #if CL_HPP_TARGET_OPENCL_VERSION >= 120 //! \brief Wrapper for clUnloadCompiler(). cl_int @@ -2573,7 +2573,7 @@ UnloadCompiler() * * \see cl_context */ -class Context +class Context : public detail::Wrapper { private: @@ -2627,7 +2627,7 @@ private: static void makeDefaultProvided(const Context &c) { default_ = c; } - + public: #ifdef CL_HPP_UNIT_TEST_ENABLE /*! \brief Reset the default. @@ -2701,7 +2701,7 @@ public: *err = error; } } - + /*! \brief Constructs a context including all or a subset of devices of a specified type. * * Wraps clCreateContextFromType(). @@ -2820,7 +2820,7 @@ public: * * \note All calls to this function return the same cl_context as the first. */ - static Context getDefault(cl_int * err = NULL) + static Context getDefault(cl_int * err = NULL) { std::call_once(default_initialized_, makeDefault); detail::errHandler(default_error_); @@ -2848,15 +2848,15 @@ public: Context() : detail::Wrapper() { } /*! \brief Constructor from cl_context - takes ownership. - * + * * This effectively transfers ownership of a refcount on the cl_context * into the new Context object. */ - explicit Context(const cl_context& context, bool retainObject = false) : + explicit Context(const cl_context& context, bool retainObject = false) : detail::Wrapper(context, retainObject) { } /*! \brief Assignment operator from cl_context - takes ownership. - * + * * This effectively transfers ownership of a refcount on the rhs and calls * clReleaseContext() on the value previously held by this instance. */ @@ -2890,7 +2890,7 @@ public: } /*! \brief Gets a list of supported image formats. - * + * * Wraps clGetSupportedImageFormats(). */ cl_int getSupportedImageFormats( @@ -2899,17 +2899,17 @@ public: vector* formats) const { cl_uint numEntries; - + if (!formats) { return CL_SUCCESS; } cl_int err = ::clGetSupportedImageFormats( - object_, + object_, flags, - type, - 0, - NULL, + type, + 0, + NULL, &numEntries); if (err != CL_SUCCESS) { return detail::errHandler(err, __GET_SUPPORTED_IMAGE_FORMATS_ERR); @@ -2987,14 +2987,14 @@ public: Event() : detail::Wrapper() { } /*! \brief Constructor from cl_event - takes ownership. - * + * * \param retainObject will cause the constructor to retain its cl object. * Defaults to false to maintain compatibility with * earlier versions. * This effectively transfers ownership of a refcount on the cl_event * into the new Event object. */ - explicit Event(const cl_event& event, bool retainObject = false) : + explicit Event(const cl_event& event, bool retainObject = false) : detail::Wrapper(event, retainObject) { } /*! \brief Assignment operator from cl_event - takes ownership. @@ -3055,7 +3055,7 @@ public: } /*! \brief Blocks the calling thread until this event completes. - * + * * Wraps clWaitForEvents(). */ cl_int wait() const @@ -3072,7 +3072,7 @@ public: */ cl_int setCallback( cl_int type, - void (CL_CALLBACK * pfn_notify)(cl_event, cl_int, void *), + void (CL_CALLBACK * pfn_notify)(cl_event, cl_int, void *), void * user_data = NULL) { return detail::errHandler( @@ -3080,13 +3080,13 @@ public: object_, type, pfn_notify, - user_data), + user_data), __SET_EVENT_CALLBACK_ERR); } #endif // CL_HPP_TARGET_OPENCL_VERSION >= 110 /*! \brief Blocks the calling thread until every event specified is complete. - * + * * Wraps clWaitForEvents(). */ static cl_int @@ -3101,7 +3101,7 @@ public: #if CL_HPP_TARGET_OPENCL_VERSION >= 110 /*! \brief Class interface for user events (a subset of cl_event's). - * + * * See Event for details about copy semantics, etc. */ class UserEvent : public Event @@ -3136,14 +3136,14 @@ public: cl_int setStatus(cl_int status) { return detail::errHandler( - ::clSetUserEventStatus(object_,status), + ::clSetUserEventStatus(object_,status), __SET_USER_EVENT_STATUS_ERR); } }; #endif // CL_HPP_TARGET_OPENCL_VERSION >= 110 /*! \brief Blocks the calling thread until every event specified is complete. - * + * * Wraps clWaitForEvents(). */ inline static cl_int @@ -3261,14 +3261,14 @@ public: * value - not the Memory class instance. */ cl_int setDestructorCallback( - void (CL_CALLBACK * pfn_notify)(cl_mem, void *), + void (CL_CALLBACK * pfn_notify)(cl_mem, void *), void * user_data = NULL) { return detail::errHandler( ::clSetMemObjectDestructorCallback( object_, pfn_notify, - user_data), + user_data), __SET_MEM_OBJECT_DESTRUCTOR_CALLBACK_ERR); } #endif // CL_HPP_TARGET_OPENCL_VERSION >= 110 @@ -3451,7 +3451,7 @@ public: * Allocate an SVM pointer. * * If the allocator is coarse-grained, this will take ownership to allow - * containers to correctly construct data in place. + * containers to correctly construct data in place. */ pointer allocate( size_type size, @@ -3501,7 +3501,7 @@ public: for (const Device &d : context_.getInfo()) { maxSize = std::min( - maxSize, + maxSize, static_cast(d.getInfo())); } @@ -3627,7 +3627,7 @@ cl::pointer>> allocate_svm(const cl #endif // #if !defined(CL_HPP_NO_STD_UNIQUE_PTR) /*! \brief Vector alias to simplify contruction of coarse-grained SVM containers. - * + * */ template < class T > using coarse_svm_vector = vector>>; @@ -3648,7 +3648,7 @@ using atomic_svm_vector = vector>> /*! \brief Class interface for Buffer Memory Objects. - * + * * See Memory for details about copy semantics, etc. * * \see Memory @@ -3733,7 +3733,7 @@ public: if( useHostPtr ) { flags |= CL_MEM_USE_HOST_PTR; } - + size_type size = sizeof(DataType)*(endIterator - startIterator); Context context = Context::getDefault(err); @@ -3766,7 +3766,7 @@ public: 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 be random access. @@ -3840,10 +3840,10 @@ public: Buffer result; cl_int error; result.object_ = ::clCreateSubBuffer( - object_, - flags, - buffer_create_type, - buffer_create_info, + object_, + flags, + buffer_create_type, + buffer_create_info, &error); detail::errHandler(error, __CREATE_SUBBUFFER_ERR); @@ -3852,7 +3852,7 @@ public: } return result; - } + } #endif // CL_HPP_TARGET_OPENCL_VERSION >= 110 }; @@ -3860,7 +3860,7 @@ public: /*! \brief Class interface for creating OpenCL buffers from ID3D10Buffer's. * * This is provided to facilitate interoperability with Direct3D. - * + * * See Memory for details about copy semantics, etc. * * \see Memory @@ -3868,7 +3868,7 @@ public: class BufferD3D10 : public Buffer { public: - + /*! \brief Constructs a BufferD3D10, in a specified context, from a * given ID3D10Buffer. @@ -3917,11 +3917,11 @@ public: /*! \brief Constructor from cl_mem - takes ownership. * * \param retainObject will cause the constructor to retain its cl object. - * Defaults to false to maintain compatibility with + * Defaults to false to maintain compatibility with * earlier versions. * See Memory for further details. */ - explicit BufferD3D10(const cl_mem& buffer, bool retainObject = false) : + explicit BufferD3D10(const cl_mem& buffer, bool retainObject = false) : Buffer(buffer, retainObject) { } /*! \brief Assignment from cl_mem - performs shallow copy. @@ -3937,7 +3937,7 @@ public: /*! \brief Copy constructor to forward copy to the superclass correctly. * Required for MSVC. */ - BufferD3D10(const BufferD3D10& buf) : + BufferD3D10(const BufferD3D10& buf) : Buffer(buf) {} /*! \brief Copy assignment to forward copy to the superclass correctly. @@ -3968,9 +3968,9 @@ public: /*! \brief Class interface for GL Buffer Memory Objects. * * This is provided to facilitate interoperability with OpenGL. - * + * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class BufferGL : public Buffer @@ -4065,9 +4065,9 @@ public: /*! \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 @@ -4103,7 +4103,7 @@ public: /*! \brief Constructor from cl_mem - takes ownership. * * \param retainObject will cause the constructor to retain its cl object. - * Defaults to false to maintain compatibility with + * Defaults to false to maintain compatibility with * earlier versions. * See Memory for further details. */ @@ -4162,7 +4162,7 @@ public: /*! \brief C++ base class for Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image : public Memory @@ -4229,7 +4229,7 @@ public: detail::getInfo(&::clGetImageInfo, object_, name, param), __GET_IMAGE_INFO_ERR); } - + //! \brief Wrapper for clGetImageInfo() that returns by value. template typename detail::param_traits::param_type @@ -4249,7 +4249,7 @@ public: /*! \brief Class interface for 1D Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image1D : public Image @@ -4275,11 +4275,11 @@ public: 0, 0, 0, 0, 0, 0, 0, 0 }; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - host_ptr, + context(), + flags, + &format, + &desc, + host_ptr, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -4364,11 +4364,11 @@ public: buffer() }; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - NULL, + context(), + flags, + &format, + &desc, + NULL, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -4452,11 +4452,11 @@ public: 0, 0, 0, 0 }; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - host_ptr, + context(), + flags, + &format, + &desc, + host_ptr, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -4466,7 +4466,7 @@ public: } Image1DArray() { } - + /*! \brief Constructor from cl_mem - takes ownership. * * \param retainObject will cause the constructor to retain its cl object. @@ -4519,7 +4519,7 @@ public: /*! \brief Class interface for 2D Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image2D : public Image @@ -4642,10 +4642,10 @@ public: * \note This will share storage with the underlying image but may * reinterpret the channel order and type. * - * The image will be created matching with a descriptor matching the source. + * The image will be created matching with a descriptor matching the source. * * \param order is the channel order to reinterpret the image data as. - * The channel order may differ as described in the OpenCL + * The channel order may differ as described in the OpenCL * 2.0 API specification. * * Wraps clCreateImage(). @@ -4659,9 +4659,9 @@ public: cl_int error; // Descriptor fields have to match source image - size_type sourceWidth = + size_type sourceWidth = sourceImage.getImageInfo(); - size_type sourceHeight = + size_type sourceHeight = sourceImage.getImageInfo(); size_type sourceRowPitch = sourceImage.getImageInfo(); @@ -4672,7 +4672,7 @@ public: cl_image_format sourceFormat = sourceImage.getImageInfo(); - // Update only the channel order. + // Update only the channel order. // Channel format inherited from source. sourceFormat.image_channel_order = order; cl_image_desc desc = @@ -4761,13 +4761,13 @@ public: /*! \brief Class interface for GL 2D Image Memory objects. * * This is provided to facilitate interoperability with OpenGL. - * + * * See Memory for details about copy semantics, etc. - * + * * \see Memory * \note Deprecated for OpenCL 1.2. Please use ImageGL instead. */ -class CL_EXT_PREFIX__VERSION_1_1_DEPRECATED Image2DGL : public Image2D +class CL_EXT_PREFIX__VERSION_1_1_DEPRECATED Image2DGL : public Image2D { public: /*! \brief Constructs an Image2DGL in a specified context, from a given @@ -4798,7 +4798,7 @@ public: } } - + //! \brief Default constructor - initializes to NULL. Image2DGL() : Image2D() { } @@ -4809,7 +4809,7 @@ public: * earlier versions. * See Memory for further details. */ - explicit Image2DGL(const cl_mem& image, bool retainObject = false) : + explicit Image2DGL(const cl_mem& image, bool retainObject = false) : Image2D(image, retainObject) { } /*! \brief Assignment from cl_mem - performs shallow copy. @@ -4885,11 +4885,11 @@ public: 0, 0, 0 }; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - host_ptr, + context(), + flags, + &format, + &desc, + host_ptr, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -4899,7 +4899,7 @@ public: } Image2DArray() { } - + /*! \brief Constructor from cl_mem - takes ownership. * * \param retainObject will cause the constructor to retain its cl object. @@ -4948,7 +4948,7 @@ public: /*! \brief Class interface for 3D Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image3D : public Image @@ -5000,11 +5000,11 @@ public: 0, 0, 0 }; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - host_ptr, + context(), + flags, + &format, + &desc, + host_ptr, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -5038,7 +5038,7 @@ public: * earlier versions. * See Memory for further details. */ - explicit Image3D(const cl_mem& image3D, bool retainObject = false) : + explicit Image3D(const cl_mem& image3D, bool retainObject = false) : Image(image3D, retainObject) { } /*! \brief Assignment from cl_mem - performs shallow copy. @@ -5084,9 +5084,9 @@ public: /*! \brief Class interface for GL 3D Image Memory objects. * * This is provided to facilitate interoperability with OpenGL. - * + * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image3DGL : public Image3D @@ -5130,7 +5130,7 @@ public: * earlier versions. * See Memory for further details. */ - explicit Image3DGL(const cl_mem& image, bool retainObject = false) : + explicit Image3DGL(const cl_mem& image, bool retainObject = false) : Image3D(image, retainObject) { } /*! \brief Assignment from cl_mem - performs shallow copy. @@ -5193,8 +5193,8 @@ public: { cl_int error; object_ = ::clCreateFromGLTexture( - context(), - flags, + context(), + flags, target, miplevel, texobj, @@ -5207,7 +5207,7 @@ public: } ImageGL() : Image() { } - + /*! \brief Constructor from cl_mem - takes ownership. * * \param retainObject will cause the constructor to retain its cl object. @@ -5215,7 +5215,7 @@ public: * earlier versions. * See Memory for further details. */ - explicit ImageGL(const cl_mem& image, bool retainObject = false) : + explicit ImageGL(const cl_mem& image, bool retainObject = false) : Image(image, retainObject) { } ImageGL& operator = (const cl_mem& rhs) @@ -5402,7 +5402,7 @@ public: * to the same underlying cl_sampler as the original. For details, see * clRetainSampler() and clReleaseSampler(). * - * \see cl_sampler + * \see cl_sampler */ class Sampler : public detail::Wrapper { @@ -5450,18 +5450,18 @@ public: if (err != NULL) { *err = error; } -#endif +#endif } /*! \brief Constructor from cl_sampler - takes ownership. - * + * * \param retainObject will cause the constructor to retain its cl object. * Defaults to false to maintain compatibility with * earlier versions. * This effectively transfers ownership of a refcount on the cl_sampler * into the new Sampler object. */ - explicit Sampler(const cl_sampler& sampler, bool retainObject = false) : + explicit Sampler(const cl_sampler& sampler, bool retainObject = false) : detail::Wrapper(sampler, retainObject) { } /*! \brief Assignment operator from cl_sampler - takes ownership. @@ -5577,17 +5577,17 @@ public: } /*! \brief Conversion operator to const size_type *. - * + * * \returns a pointer to the size of the first dimension. */ - operator const size_type*() const { - return sizes_; + operator const size_type*() const { + return sizes_; } //! \brief Queries the number of dimensions in the range. - size_type dimensions() const - { - return dimensions_; + size_type dimensions() const + { + return dimensions_; } //! \brief Returns the size of the object in bytes based on the @@ -5601,7 +5601,7 @@ public: { return sizes_; } - + const size_type* get() const { return sizes_; @@ -5649,7 +5649,7 @@ struct KernelArgumentHandler static const void* ptr(const LocalSpaceArg&) { return NULL; } }; -} +} //! \endcond /*! Local @@ -5679,14 +5679,14 @@ public: Kernel() { } /*! \brief Constructor from cl_kernel - takes ownership. - * + * * \param retainObject will cause the constructor to retain its cl object. * Defaults to false to maintain compatibility with * earlier versions. * This effectively transfers ownership of a refcount on the cl_kernel * into the new Kernel object. */ - explicit Kernel(const cl_kernel& kernel, bool retainObject = false) : + explicit Kernel(const cl_kernel& kernel, bool retainObject = false) : detail::Wrapper(kernel, retainObject) { } /*! \brief Assignment operator from cl_kernel - takes ownership. @@ -5794,7 +5794,7 @@ public: } return param; } - + #if CL_HPP_TARGET_OPENCL_VERSION >= 200 #if defined(CL_HPP_USE_CL_SUB_GROUPS_KHR) cl_int getSubGroupInfo(const cl::Device &dev, cl_kernel_sub_group_info name, const cl::NDRange &range, size_type* param) const @@ -5878,7 +5878,7 @@ public: #if CL_HPP_TARGET_OPENCL_VERSION >= 200 /*! - * Specify a vector of SVM pointers that the kernel may access in + * Specify a vector of SVM pointers that the kernel may access in * addition to its arguments. */ cl_int setSVMPointers(const vector &pointerList) @@ -5910,7 +5910,7 @@ public: * * \note It is only possible to enable fine-grained system SVM if all devices * in the context associated with kernel support it. - * + * * \param svmEnabled True if fine-grained system SVM is requested. False otherwise. * \return CL_SUCCESS if the function was executed succesfully. CL_INVALID_OPERATION * if no devices in the context support fine-grained system SVM. @@ -5929,7 +5929,7 @@ public: ) ); } - + template void setSVMPointersHelper(std::array &pointerList, const pointer &t0, Ts... ts) { @@ -5944,7 +5944,7 @@ public: pointerList[index] = static_cast(t0); setSVMPointersHelper(ts...); } - + template void setSVMPointersHelper(std::array &pointerList, const pointer &t0) { @@ -5987,7 +5987,7 @@ public: typedef vector > Binaries; typedef vector > Sources; #endif // #if !defined(CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY) - + Program( const string& source, bool build = false, @@ -6055,7 +6055,7 @@ public: #endif // #if !defined(CL_HPP_CL_1_2_DEFAULT_BUILD) NULL, NULL); - + detail::buildErrHandler(error, __BUILD_PROGRAM_ERR, getBuildInfo()); } @@ -6147,7 +6147,7 @@ public: * Set to CL_INVALID_BINARY if the binary provided is not valid for the matching device. * \param err if non-NULL will be set to CL_SUCCESS on successful operation or one of the following errors: * CL_INVALID_CONTEXT if context is not a valid context. - * CL_INVALID_VALUE if the length of devices is zero; or if the length of binaries does not match the length of devices; + * CL_INVALID_VALUE if the length of devices is zero; or if the length of binaries does not match the length of devices; * or if any entry in binaries is NULL or has length 0. * CL_INVALID_DEVICE if OpenCL devices listed in devices are not in the list of devices associated with context. * CL_INVALID_BINARY if an invalid program binary was encountered for any device. binaryStatus will return specific status for each device. @@ -6161,9 +6161,9 @@ public: cl_int* err = NULL) { cl_int error; - + const size_type numDevices = devices.size(); - + // Catch size mismatch early and return if(binaries.size() != numDevices) { error = CL_INVALID_VALUE; @@ -6188,7 +6188,7 @@ public: lengths[i] = binaries[(int)i].second; } #endif // #if !defined(CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY) - + vector deviceIDs(numDevices); for( size_type deviceIndex = 0; deviceIndex < numDevices; ++deviceIndex ) { deviceIDs[deviceIndex] = (devices[deviceIndex])(); @@ -6197,7 +6197,7 @@ public: if(binaryStatus) { binaryStatus->resize(numDevices); } - + object_ = ::clCreateProgramWithBinary( context(), (cl_uint) devices.size(), deviceIDs.data(), @@ -6211,7 +6211,7 @@ public: } } - + #if CL_HPP_TARGET_OPENCL_VERSION >= 120 /** * Create program using builtin kernels. @@ -6231,12 +6231,12 @@ public: for( size_type deviceIndex = 0; deviceIndex < numDevices; ++deviceIndex ) { deviceIDs[deviceIndex] = (devices[deviceIndex])(); } - + object_ = ::clCreateProgramWithBuiltInKernels( - context(), + context(), (cl_uint) devices.size(), deviceIDs.data(), - kernelNames.c_str(), + kernelNames.c_str(), &error); detail::errHandler(error, __CREATE_PROGRAM_WITH_BUILT_IN_KERNELS_ERR); @@ -6247,7 +6247,7 @@ public: #endif // CL_HPP_TARGET_OPENCL_VERSION >= 120 Program() { } - + /*! \brief Constructor from cl_mem - takes ownership. * @@ -6255,7 +6255,7 @@ public: * Defaults to false to maintain compatibility with * earlier versions. */ - explicit Program(const cl_program& program, bool retainObject = false) : + explicit Program(const cl_program& program, bool retainObject = false) : detail::Wrapper(program, retainObject) { } Program& operator = (const cl_program& rhs) @@ -6300,7 +6300,7 @@ public: { size_type numDevices = devices.size(); vector deviceIDs(numDevices); - + for( size_type deviceIndex = 0; deviceIndex < numDevices; ++deviceIndex ) { deviceIDs[deviceIndex] = (devices[deviceIndex])(); } @@ -6397,9 +6397,9 @@ public: } return param; } - + /** - * Build info function that returns a vector of device/info pairs for the specified + * Build info function that returns a vector of device/info pairs for the specified * info type and for all devices in the program. * On an error reading the info for any device, an empty vector of info will be returned. */ @@ -6451,7 +6451,7 @@ public: } vector value(numKernels); - + err = ::clCreateKernelsInProgram( object_, numKernels, value.data(), NULL); if (err != CL_SUCCESS) { @@ -6464,7 +6464,7 @@ public: // Assign to param, constructing with retain behaviour // to correctly capture each underlying CL object for (size_type i = 0; i < value.size(); i++) { - // We do not need to retain because this kernel is being created + // We do not need to retain because this kernel is being created // by the runtime (*kernels)[i] = Kernel(value[i], false); } @@ -6480,7 +6480,7 @@ inline Program linkProgram( const char* options = NULL, void (CL_CALLBACK * notifyFptr)(cl_program, void *) = NULL, void* data = NULL, - cl_int* err = NULL) + cl_int* err = NULL) { cl_int error_local = CL_SUCCESS; @@ -6515,7 +6515,7 @@ inline Program linkProgram( const char* options = NULL, void (CL_CALLBACK * notifyFptr)(cl_program, void *) = NULL, void* data = NULL, - cl_int* err = NULL) + cl_int* err = NULL) { cl_int error_local = CL_SUCCESS; @@ -6524,7 +6524,7 @@ inline Program linkProgram( for (unsigned int i = 0; i < inputPrograms.size(); i++) { programs[i] = inputPrograms[i](); } - + Context ctx; if(inputPrograms.size() > 0) { ctx = inputPrograms[0].getInfo(&error_local); @@ -6680,7 +6680,7 @@ public: default_ = CommandQueue(); } #endif // #ifdef CL_HPP_UNIT_TEST_ENABLE - + /*! * \brief Constructs a CommandQueue based on passed properties. @@ -6853,7 +6853,7 @@ public: CL_QUEUE_PROPERTIES, static_cast(properties), 0 }; object_ = ::clCreateCommandQueueWithProperties( context(), devices[0](), queue_properties, &error); - + detail::errHandler(error, __CREATE_COMMAND_QUEUE_WITH_PROPERTIES_ERR); if (err != NULL) { *err = error; @@ -6887,7 +6887,7 @@ public: CL_QUEUE_PROPERTIES, properties, 0 }; object_ = ::clCreateCommandQueueWithProperties( context(), device(), queue_properties, &error); - + detail::errHandler(error, __CREATE_COMMAND_QUEUE_WITH_PROPERTIES_ERR); if (err != NULL) { *err = error; @@ -6920,7 +6920,7 @@ public: CL_QUEUE_PROPERTIES, static_cast(properties), 0 }; object_ = ::clCreateCommandQueueWithProperties( context(), device(), queue_properties, &error); - + detail::errHandler(error, __CREATE_COMMAND_QUEUE_WITH_PROPERTIES_ERR); if (err != NULL) { *err = error; @@ -6936,7 +6936,7 @@ public: #endif } - static CommandQueue getDefault(cl_int * err = NULL) + static CommandQueue getDefault(cl_int * err = NULL) { std::call_once(default_initialized_, makeDefault); #if CL_HPP_TARGET_OPENCL_VERSION >= 200 @@ -6973,7 +6973,7 @@ public: * Defaults to false to maintain compatibility with * earlier versions. */ - explicit CommandQueue(const cl_command_queue& commandQueue, bool retainObject = false) : + explicit CommandQueue(const cl_command_queue& commandQueue, bool retainObject = false) : detail::Wrapper(commandQueue, retainObject) { } CommandQueue& operator = (const cl_command_queue& rhs) @@ -7123,8 +7123,8 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueReadBufferRect( - object_, - buffer(), + object_, + buffer(), blocking, buffer_offset.data(), host_offset.data(), @@ -7162,8 +7162,8 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueWriteBufferRect( - object_, - buffer(), + object_, + buffer(), blocking, buffer_offset.data(), host_offset.data(), @@ -7200,9 +7200,9 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueCopyBufferRect( - object_, - src(), - dst(), + object_, + src(), + dst(), src_origin.data(), dst_origin.data(), region.data(), @@ -7225,10 +7225,10 @@ public: /** * Enqueue a command to fill a buffer object with a pattern * of a given size. The pattern is specified as a vector type. - * \tparam PatternType The datatype of the pattern field. + * \tparam PatternType The datatype of the pattern field. * The pattern type must be an accepted OpenCL data type. - * \tparam offset Is the offset in bytes into the buffer at - * which to start filling. This must be a multiple of + * \tparam offset Is the offset in bytes into the buffer at + * which to start filling. This must be a multiple of * the pattern size. * \tparam size Is the size in bytes of the region to fill. * This must be a multiple of the pattern size. @@ -7245,11 +7245,11 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueFillBuffer( - object_, + object_, buffer(), static_cast(&pattern), - sizeof(PatternType), - offset, + sizeof(PatternType), + offset, size, (events != NULL) ? (cl_uint) events->size() : 0, (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL, @@ -7277,13 +7277,13 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueReadImage( - object_, - image(), - blocking, + object_, + image(), + blocking, origin.data(), - region.data(), - row_pitch, - slice_pitch, + region.data(), + row_pitch, + slice_pitch, ptr, (events != NULL) ? (cl_uint) events->size() : 0, (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL, @@ -7310,13 +7310,13 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueWriteImage( - object_, - image(), - blocking, + object_, + image(), + blocking, origin.data(), - region.data(), - row_pitch, - slice_pitch, + region.data(), + row_pitch, + slice_pitch, ptr, (events != NULL) ? (cl_uint) events->size() : 0, (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL, @@ -7341,11 +7341,11 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueCopyImage( - object_, - src(), - dst(), + object_, + src(), + dst(), src_origin.data(), - dst_origin.data(), + dst_origin.data(), region.data(), (events != NULL) ? (cl_uint) events->size() : 0, (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL, @@ -7377,9 +7377,9 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueFillImage( - object_, + object_, image(), - static_cast(&fillColor), + static_cast(&fillColor), origin.data(), region.data(), (events != NULL) ? (cl_uint) events->size() : 0, @@ -7411,9 +7411,9 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueFillImage( - object_, + object_, image(), - static_cast(&fillColor), + static_cast(&fillColor), origin.data(), region.data(), (events != NULL) ? (cl_uint) events->size() : 0, @@ -7445,9 +7445,9 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueFillImage( - object_, + object_, image(), - static_cast(&fillColor), + static_cast(&fillColor), origin.data(), region.data(), (events != NULL) ? (cl_uint) events->size() : 0, @@ -7474,11 +7474,11 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueCopyImageToBuffer( - object_, - src(), - dst(), + object_, + src(), + dst(), src_origin.data(), - region.data(), + region.data(), dst_offset, (events != NULL) ? (cl_uint) events->size() : 0, (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL, @@ -7503,11 +7503,11 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueCopyBufferToImage( - object_, - src(), - dst(), + object_, + src(), + dst(), src_offset, - dst_origin.data(), + dst_origin.data(), region.data(), (events != NULL) ? (cl_uint) events->size() : 0, (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL, @@ -7565,7 +7565,7 @@ public: cl_int error; void * result = ::clEnqueueMapImage( object_, buffer(), blocking, flags, - origin.data(), + origin.data(), region.data(), row_pitch, slice_pitch, (events != NULL) ? (cl_uint) events->size() : 0, @@ -7766,14 +7766,14 @@ public: #if CL_HPP_TARGET_OPENCL_VERSION >= 120 /** - * Enqueues a marker command which waits for either a list of events to complete, + * Enqueues a marker command which waits for either a list of events to complete, * or all previously enqueued commands to complete. * - * Enqueues a marker command which waits for either a list of events to complete, - * or if the list is empty it waits for all commands previously enqueued in command_queue - * to complete before it completes. This command returns an event which can be waited on, - * i.e. this event can be waited on to insure that all events either in the event_wait_list - * or all previously enqueued commands, queued before this command to command_queue, + * Enqueues a marker command which waits for either a list of events to complete, + * or if the list is empty it waits for all commands previously enqueued in command_queue + * to complete before it completes. This command returns an event which can be waited on, + * i.e. this event can be waited on to insure that all events either in the event_wait_list + * or all previously enqueued commands, queued before this command to command_queue, * have completed. */ cl_int enqueueMarkerWithWaitList( @@ -7798,12 +7798,12 @@ public: /** * A synchronization point that enqueues a barrier operation. * - * Enqueues a barrier command which waits for either a list of events to complete, - * or if the list is empty it waits for all commands previously enqueued in command_queue - * to complete before it completes. This command blocks command execution, that is, any - * following commands enqueued after it do not execute until it completes. This command - * returns an event which can be waited on, i.e. this event can be waited on to insure that - * all events either in the event_wait_list or all previously enqueued commands, queued + * Enqueues a barrier command which waits for either a list of events to complete, + * or if the list is empty it waits for all commands previously enqueued in command_queue + * to complete before it completes. This command blocks command execution, that is, any + * following commands enqueued after it do not execute until it completes. This command + * returns an event which can be waited on, i.e. this event can be waited on to insure that + * all events either in the event_wait_list or all previously enqueued commands, queued * before this command to command_queue, have completed. */ cl_int enqueueBarrierWithWaitList( @@ -7824,7 +7824,7 @@ public: return err; } - + /** * Enqueues a command to indicate with which device a set of memory objects * should be associated. @@ -7837,7 +7837,7 @@ public: ) const { cl_event tmp; - + vector localMemObjects(memObjects.size()); for( int i = 0; i < (int)memObjects.size(); ++i ) { @@ -7847,8 +7847,8 @@ public: cl_int err = detail::errHandler( ::clEnqueueMigrateMemObjects( - object_, - (cl_uint)memObjects.size(), + object_, + (cl_uint)memObjects.size(), localMemObjects.data(), flags, (events != NULL) ? (cl_uint) events->size() : 0, @@ -7927,7 +7927,7 @@ public: for (unsigned int i = 0; i < elements; i++) { mems[i] = ((*mem_objects)[i])(); } - + cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueNativeKernel( @@ -7950,13 +7950,13 @@ public: * Deprecated APIs for 1.2 */ #if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) - CL_EXT_PREFIX__VERSION_1_1_DEPRECATED + CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int enqueueMarker(Event* event = NULL) const CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED { cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueMarker( - object_, + object_, (event != NULL) ? &tmp : NULL), __ENQUEUE_MARKER_ERR); @@ -8047,7 +8047,7 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *PFN_clEnqueueReleaseD3D10ObjectsKHR)( #if CL_HPP_TARGET_OPENCL_VERSION >= 110 CL_HPP_INIT_CL_EXT_FCN_PTR_(clEnqueueAcquireD3D10ObjectsKHR); #endif - + cl_event tmp; cl_int err = detail::errHandler( pfn_clEnqueueAcquireD3D10ObjectsKHR( @@ -8215,7 +8215,7 @@ public: CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_ON_DEVICE | static_cast(properties); cl_queue_properties queue_properties[] = { CL_QUEUE_PROPERTIES, mergedProperties, - CL_QUEUE_SIZE, queueSize, + CL_QUEUE_SIZE, queueSize, 0 }; object_ = ::clCreateCommandQueueWithProperties( context(), device(), queue_properties, &error); @@ -8350,7 +8350,7 @@ public: } /*! - * Create a new default device command queue for the specified device + * Create a new default device command queue for the specified device * and of the requested size in bytes. * If there is already a default queue for the specified device this * function will return the pre-existing queue. @@ -8415,7 +8415,7 @@ Buffer::Buffer( if( useHostPtr ) { flags |= CL_MEM_USE_HOST_PTR; } - + size_type size = sizeof(DataType)*(endIterator - startIterator); if( useHostPtr ) { @@ -8588,7 +8588,7 @@ inline cl_int enqueueMapSVM( } /** - * Enqueues to the default queue a command that will allow the host to + * Enqueues to the default queue a command that will allow the host to * update a region of a coarse-grained SVM buffer. * This variant takes a cl::pointer instance. */ @@ -8666,7 +8666,7 @@ inline cl_int enqueueUnmapMemObject( #if CL_HPP_TARGET_OPENCL_VERSION >= 200 /** - * Enqueues to the default queue a command that will release a coarse-grained + * Enqueues to the default queue a command that will release a coarse-grained * SVM buffer back to the OpenCL runtime. * This variant takes a raw SVM pointer. */ @@ -8682,13 +8682,13 @@ inline cl_int enqueueUnmapSVM( return detail::errHandler(error, __ENQUEUE_UNMAP_MEM_OBJECT_ERR); } - return detail::errHandler(queue.enqueueUnmapSVM(ptr, events, event), + return detail::errHandler(queue.enqueueUnmapSVM(ptr, events, event), __ENQUEUE_UNMAP_MEM_OBJECT_ERR); } /** - * Enqueues to the default queue a command that will release a coarse-grained + * Enqueues to the default queue a command that will release a coarse-grained * SVM buffer back to the OpenCL runtime. * This variant takes a cl::pointer instance. */ @@ -8709,7 +8709,7 @@ inline cl_int enqueueUnmapSVM( } /** - * Enqueues to the default queue a command that will release a coarse-grained + * Enqueues to the default queue a command that will release a coarse-grained * SVM buffer back to the OpenCL runtime. * This variant takes a cl::vector instance. */ @@ -8792,11 +8792,11 @@ inline cl_int copy( const CommandQueue &queue, IteratorType startIterator, Itera { typedef typename std::iterator_traits::value_type DataType; cl_int error; - + size_type length = endIterator-startIterator; size_type byteLength = length*sizeof(DataType); - DataType *pointer = + DataType *pointer = 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 ) { @@ -8804,8 +8804,8 @@ inline cl_int copy( const CommandQueue &queue, IteratorType startIterator, Itera } #if defined(_MSC_VER) std::copy( - startIterator, - endIterator, + startIterator, + endIterator, stdext::checked_array_iterator( pointer, length)); #else @@ -8814,7 +8814,7 @@ inline cl_int copy( const CommandQueue &queue, IteratorType startIterator, Itera Event endEvent; error = queue.enqueueUnmapMemObject(buffer, pointer, 0, &endEvent); // if exceptions enabled, enqueueUnmapMemObject will throw - if( error != CL_SUCCESS ) { + if( error != CL_SUCCESS ) { return error; } endEvent.wait(); @@ -8831,11 +8831,11 @@ inline cl_int copy( const CommandQueue &queue, const cl::Buffer &buffer, Iterato { typedef typename std::iterator_traits::value_type DataType; cl_int error; - + size_type length = endIterator-startIterator; size_type byteLength = length*sizeof(DataType); - DataType *pointer = + DataType *pointer = 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 ) { @@ -8845,7 +8845,7 @@ inline cl_int copy( const CommandQueue &queue, const cl::Buffer &buffer, Iterato Event endEvent; error = queue.enqueueUnmapMemObject(buffer, pointer, 0, &endEvent); // if exceptions enabled, enqueueUnmapMemObject will throw - if( error != CL_SUCCESS ) { + if( error != CL_SUCCESS ) { return error; } endEvent.wait(); @@ -8897,17 +8897,17 @@ inline cl_int enqueueReadBufferRect( } return queue.enqueueReadBufferRect( - buffer, - blocking, - buffer_offset, + buffer, + blocking, + buffer_offset, host_offset, region, buffer_row_pitch, buffer_slice_pitch, host_row_pitch, host_slice_pitch, - ptr, - events, + ptr, + events, event); } @@ -8933,17 +8933,17 @@ inline cl_int enqueueWriteBufferRect( } return queue.enqueueWriteBufferRect( - buffer, - blocking, - buffer_offset, + buffer, + blocking, + buffer_offset, host_offset, region, buffer_row_pitch, buffer_slice_pitch, host_row_pitch, host_slice_pitch, - ptr, - events, + ptr, + events, event); } @@ -8977,7 +8977,7 @@ inline cl_int enqueueCopyBufferRect( src_slice_pitch, dst_row_pitch, dst_slice_pitch, - events, + events, event); } #endif // CL_HPP_TARGET_OPENCL_VERSION >= 110 @@ -8991,7 +8991,7 @@ inline cl_int enqueueReadImage( size_type slice_pitch, void* ptr, const vector* events = NULL, - Event* event = NULL) + Event* event = NULL) { cl_int error; CommandQueue queue = CommandQueue::getDefault(&error); @@ -9008,7 +9008,7 @@ inline cl_int enqueueReadImage( row_pitch, slice_pitch, ptr, - events, + events, event); } @@ -9038,7 +9038,7 @@ inline cl_int enqueueWriteImage( row_pitch, slice_pitch, ptr, - events, + events, event); } @@ -9140,7 +9140,7 @@ inline cl_int finish(void) if (error != CL_SUCCESS) { return error; - } + } return queue.finish(); @@ -9159,63 +9159,63 @@ private: friend class KernelFunctor; public: - EnqueueArgs(NDRange global) : + EnqueueArgs(NDRange global) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange) { } - EnqueueArgs(NDRange global, NDRange local) : + EnqueueArgs(NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local) { } - EnqueueArgs(NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(NDRange offset, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(offset), + offset_(offset), global_(global), local_(local) { } - EnqueueArgs(Event e, NDRange global) : + EnqueueArgs(Event e, NDRange global) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange) { events_.push_back(e); } - EnqueueArgs(Event e, NDRange global, NDRange local) : + EnqueueArgs(Event e, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local) { events_.push_back(e); } - EnqueueArgs(Event e, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(Event e, NDRange offset, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(offset), + offset_(offset), global_(global), local_(local) { events_.push_back(e); } - EnqueueArgs(const vector &events, NDRange global) : + EnqueueArgs(const vector &events, NDRange global) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange), events_(events) @@ -9223,9 +9223,9 @@ public: } - EnqueueArgs(const vector &events, NDRange global, NDRange local) : + EnqueueArgs(const vector &events, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local), events_(events) @@ -9233,9 +9233,9 @@ public: } - EnqueueArgs(const vector &events, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(const vector &events, NDRange offset, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(offset), + offset_(offset), global_(global), local_(local), events_(events) @@ -9243,63 +9243,63 @@ public: } - EnqueueArgs(CommandQueue &queue, NDRange global) : + EnqueueArgs(CommandQueue &queue, NDRange global) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange) { } - EnqueueArgs(CommandQueue &queue, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, NDRange global, NDRange local) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local) { } - EnqueueArgs(CommandQueue &queue, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, NDRange offset, NDRange global, NDRange local) : queue_(queue), - offset_(offset), + offset_(offset), global_(global), local_(local) { } - EnqueueArgs(CommandQueue &queue, Event e, NDRange global) : + EnqueueArgs(CommandQueue &queue, Event e, NDRange global) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange) { events_.push_back(e); } - EnqueueArgs(CommandQueue &queue, Event e, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, Event e, NDRange global, NDRange local) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local) { events_.push_back(e); } - EnqueueArgs(CommandQueue &queue, Event e, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, Event e, NDRange offset, NDRange global, NDRange local) : queue_(queue), - offset_(offset), + offset_(offset), global_(global), local_(local) { events_.push_back(e); } - EnqueueArgs(CommandQueue &queue, const vector &events, NDRange global) : + EnqueueArgs(CommandQueue &queue, const vector &events, NDRange global) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange), events_(events) @@ -9307,9 +9307,9 @@ public: } - EnqueueArgs(CommandQueue &queue, const vector &events, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, const vector &events, NDRange global, NDRange local) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local), events_(events) @@ -9317,9 +9317,9 @@ public: } - EnqueueArgs(CommandQueue &queue, const vector &events, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, const vector &events, NDRange offset, NDRange global, NDRange local) : queue_(queue), - offset_(offset), + offset_(offset), global_(global), local_(local), events_(events) @@ -9334,7 +9334,7 @@ public: /** * Type safe kernel functor. - * + * */ template class KernelFunctor @@ -9386,7 +9386,7 @@ public: { Event event; setArgs<0>(std::forward(ts)...); - + args.queue_.enqueueNDRangeKernel( kernel_, args.offset_, @@ -9419,7 +9419,7 @@ public: args.local_, &args.events_, &event); - + return event; } diff --git a/projects/clr/opencl/khronos/headers/opencl2.1/CL/cl.hpp b/projects/clr/opencl/khronos/headers/opencl2.1/CL/cl.hpp index 71e55e0678..f949a58691 100644 --- a/projects/clr/opencl/khronos/headers/opencl2.1/CL/cl.hpp +++ b/projects/clr/opencl/khronos/headers/opencl2.1/CL/cl.hpp @@ -28,16 +28,16 @@ /*! \file * - * \brief C++ bindings for OpenCL 1.0 (rev 48), OpenCL 1.1 (rev 33) and - * OpenCL 1.2 (rev 15) + * \brief C++ bindings for OpenCL 1.0 (rev 48), OpenCL 1.1 (rev 33) and + * OpenCL 1.2 (rev 15) * \author Benedict R. Gaster, Laurent Morichetti and Lee Howes - * + * * Additions and fixes from: - * Brian Cole, March 3rd 2010 and April 2012 + * 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.9 * \date December 2015 * @@ -77,7 +77,7 @@ * * \code * #define __CL_ENABLE_EXCEPTIONS - * + * * #if defined(__APPLE__) || defined(__MACOSX) * #include * #else @@ -86,13 +86,13 @@ * #include * #include * #include - * + * * const char * helloStr = "__kernel void " * "hello(void) " * "{ " * " " * "} "; - * + * * int * main(void) * { @@ -106,33 +106,33 @@ * return -1; * } * - * cl_context_properties properties[] = + * cl_context_properties properties[] = * { CL_CONTEXT_PLATFORM, (cl_context_properties)(platforms[0])(), 0}; - * cl::Context context(CL_DEVICE_TYPE_CPU, properties); - * + * cl::Context context(CL_DEVICE_TYPE_CPU, properties); + * * std::vector devices = context.getInfo(); - * + * * cl::Program::Sources source(1, * std::make_pair(helloStr,strlen(helloStr))); * cl::Program program_ = cl::Program(context, source); * program_.build(devices); - * + * * cl::Kernel kernel(program_, "hello", &err); - * + * * cl::Event event; * cl::CommandQueue queue(context, devices[0], 0, &err); * queue.enqueueNDRangeKernel( - * kernel, - * cl::NullRange, + * kernel, + * cl::NullRange, * cl::NDRange(4,4), * cl::NullRange, * NULL, - * &event); - * + * &event); + * * event.wait(); * } * catch (cl::Error err) { - * std::cerr + * std::cerr * << "ERROR: " * << err.what() * << "(" @@ -140,10 +140,10 @@ * << ")" * << std::endl; * } - * + * * return EXIT_SUCCESS; * } - * + * * \endcode * */ @@ -164,7 +164,7 @@ #include #endif // _MSC_VER -// +// #if defined(USE_CL_DEVICE_FISSION) #include #endif @@ -194,13 +194,13 @@ #if defined(CL_VERSION_1_2) && !defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) #define __CL_EXPLICIT_CONSTRUCTORS explicit #else // #if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) -#define __CL_EXPLICIT_CONSTRUCTORS +#define __CL_EXPLICIT_CONSTRUCTORS #endif // #if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) // Define deprecated prefixes and suffixes to ensure compilation // in case they are not pre-defined #if !defined(CL_EXT_PREFIX__VERSION_1_1_DEPRECATED) -#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED +#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED #endif // #if !defined(CL_EXT_PREFIX__VERSION_1_1_DEPRECATED) #if !defined(CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED) #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED @@ -224,7 +224,7 @@ #if !defined(__NO_STD_STRING) #include -#endif +#endif #if defined(__ANDROID__) || defined(linux) || defined(__APPLE__) || defined(__MACOSX) #include @@ -245,7 +245,7 @@ class Memory; /** * Deprecated APIs for 1.2 */ -#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) || (defined(CL_VERSION_1_1) && !defined(CL_VERSION_1_2)) +#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) || (defined(CL_VERSION_1_1) && !defined(CL_VERSION_1_2)) #define __INIT_CL_EXT_FCN_PTR(name) \ if(!pfn_##name) { \ pfn_##name = (PFN_##name) \ @@ -273,8 +273,8 @@ class Memory; class Buffer; #if defined(__CL_ENABLE_EXCEPTIONS) -/*! \brief Exception class - * +/*! \brief Exception class + * * This may be thrown by API functions when __CL_ENABLE_EXCEPTIONS is defined. */ class Error : public std::exception @@ -285,7 +285,7 @@ private: public: /*! \brief Create a new CL error exception for a given error code * and corresponding message. - * + * * \param err error code value. * * \param errStr a descriptive string that must remain in scope until @@ -452,7 +452,7 @@ static inline cl_int errHandler (cl_int err, const char * errStr = NULL) /** * Deprecated APIs for 1.2 */ -#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) || (defined(CL_VERSION_1_1) && !defined(CL_VERSION_1_2)) +#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) || (defined(CL_VERSION_1_1) && !defined(CL_VERSION_1_2)) #define __ENQUEUE_MARKER_ERR __ERR_STR(clEnqueueMarker) #define __ENQUEUE_WAIT_FOR_EVENTS_ERR __ERR_STR(clEnqueueWaitForEvents) #define __ENQUEUE_BARRIER_ERR __ERR_STR(clEnqueueBarrier) @@ -476,12 +476,12 @@ static inline cl_int errHandler (cl_int err, const char * errStr = NULL) #if !defined(__USE_DEV_STRING) && !defined(__NO_STD_STRING) typedef std::string STRING_CLASS; -#elif !defined(__USE_DEV_STRING) +#elif !defined(__USE_DEV_STRING) /*! \class string * \brief Simple string class, that provides a limited subset of std::string * functionality but avoids many of the issues that come with that class. - + * \note Deprecated. Please use std::string as default or * re-define the string class to match the std::string * interface by defining STRING_CLASS @@ -499,10 +499,10 @@ public: /*! \brief Constructs a string populated from an arbitrary value of * specified size. - * + * * An extra '\0' is added, in case none was contained in str. * - * \param str the initial value of the string instance. Note that '\0' + * \param str the initial value of the string instance. Note that '\0' * characters receive no special treatment. If NULL, * the string is left empty, with a size of 0. * @@ -555,7 +555,7 @@ public: } str_ = NULL; size_ = 0; - } + } else { char *newString = new char[n + 1]; ::size_t copySize = n; @@ -563,7 +563,7 @@ public: copySize = size_; } size_ = n; - + if(str_) { memcpy(newString, str_, (copySize + 1) * sizeof(char)); } @@ -608,11 +608,11 @@ public: if (rhs.size_ == 0 || rhs.str_ == NULL) { str_ = NULL; size_ = 0; - } + } else { str_ = new char[rhs.size_ + 1]; size_ = rhs.size_; - + if (str_ != NULL) { memcpy(str_, rhs.str_, (size_ + 1) * sizeof(char)); } @@ -641,7 +641,7 @@ public: delete[] str_; str_ = NULL; } - + //! \brief Queries the length of the string, excluding any added '\0's. ::size_t size(void) const { return size_; } @@ -654,19 +654,19 @@ public: 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) +#endif // #elif !defined(__USE_DEV_STRING) #if !defined(__USE_DEV_VECTOR) && !defined(__NO_STD_VECTOR) #define VECTOR_CLASS std::vector -#elif !defined(__USE_DEV_VECTOR) -#define VECTOR_CLASS cl::vector +#elif !defined(__USE_DEV_VECTOR) +#define VECTOR_CLASS cl::vector #if !defined(__MAX_DEFAULT_VECTOR_SIZE) #define __MAX_DEFAULT_VECTOR_SIZE 10 #endif /*! \class vector - * \brief Fixed sized vector implementation that mirroring + * \brief Fixed sized vector implementation that mirroring * * \note Deprecated. Please use std::vector as default or * re-define the vector class to match the std::vector @@ -696,12 +696,12 @@ private: public: //! \brief Constructs an empty vector with no memory allocated. - vector() : + vector() : size_(static_cast(0)) {} //! \brief Deallocates the vector's memory and destroys all of its elements. - ~vector() + ~vector() { clear(); } @@ -711,7 +711,7 @@ public: { return size_; } - + /*! \brief Empties the vector of all elements. * \note * This does not deallocate memory but will invoke destructors @@ -725,11 +725,11 @@ public: } /*! \brief Appends an element after the last valid element. - * Calling this on a vector that has reached capacity will throw an + * Calling this on a vector that has reached capacity will throw an * exception if exceptions are enabled. */ void push_back (const T& x) - { + { if (size() < N) { new (&data_[size_]) T(x); size_++; @@ -756,13 +756,13 @@ public: * * \param vec the vector to copy. */ - vector(const vector& vec) : + vector(const vector& vec) : size_(vec.size_) { if (size_ != 0) { assign(vec.begin(), vec.end()); } - } + } /*! \brief Constructs with a specified number of initial elements. * @@ -791,7 +791,7 @@ public: return *this; } - if (rhs.size_ != 0) { + if (rhs.size_ != 0) { assign(rhs.begin(), rhs.end()); } else { clear(); @@ -817,19 +817,19 @@ public: } return true; } - + //! \brief Conversion operator to T*. operator T* () { return data_; } //! \brief Conversion operator to const T*. operator const T* () const { return data_; } - + //! \brief Tests whether this instance has any elements. bool empty (void) const { return size_==0; } - + //! \brief Returns the maximum number of elements this instance can hold. unsigned int max_size (void) const { @@ -874,7 +874,7 @@ public: { return data_[index]; } - + /*! \brief Returns a const reference to a given element. * * \param index which element to access. @@ -886,7 +886,7 @@ public: { return data_[index]; } - + /*! \brief Assigns elements of the vector based on a source iterator range. * * \param start Beginning iterator of source range @@ -898,7 +898,7 @@ public: template void assign(I start, I end) { - clear(); + clear(); while(start != end) { push_back(*start); start++; @@ -916,12 +916,12 @@ public: /** * Internal iterator constructor to capture reference - * to the vector it iterates over rather than taking + * to the vector it iterates over rather than taking * the vector by copy. */ iterator (const vector &vec, int index) : vec_(&vec) - { + { if( !vec.empty() ) { index_ = index; } else { @@ -930,7 +930,7 @@ public: } public: - iterator(void) : + iterator(void) : index_(-1), vec_(NULL) { @@ -957,10 +957,10 @@ public: return i; } - + bool operator==(iterator i) { - return ((vec_ == i.vec_) && + return ((vec_ == i.vec_) && (index_ == i.index_)); } @@ -1048,7 +1048,7 @@ public: namespace detail { -#define __DEFAULT_NOT_INITIALIZED 1 +#define __DEFAULT_NOT_INITIALIZED 1 #define __DEFAULT_BEING_INITIALIZED 2 #define __DEFAULT_INITIALIZED 4 @@ -1089,14 +1089,14 @@ namespace detail { } } // namespace detail - + /*! \brief class used to interface between C++ and * OpenCL C calls that require arrays of size_t values, whose * size is known statically. */ template class size_t -{ +{ private: ::size_t data_[N]; @@ -1226,7 +1226,7 @@ inline cl_int getInfoHelper(Func f, cl_uint name, STRING_CLASS* param, long) *param = value; return CL_SUCCESS; -#else +#else ::size_t required; cl_int err = f(name, 0, NULL, &required); if (err != CL_SUCCESS) { @@ -1443,7 +1443,7 @@ inline cl_int getInfoHelper(Func f, cl_uint name, T* param, int, typename T::cl_ F(cl_event_info, CL_EVENT_CONTEXT, cl::Context) #endif // CL_VERSION_1_1 - + #if defined(CL_VERSION_1_2) #define __PARAM_NAME_INFO_1_2(F) \ F(cl_image_info, CL_IMAGE_BUFFER, cl::Buffer) \ @@ -1630,7 +1630,7 @@ struct ReferenceHandler /** * Retain the device. * \param device A valid device created using createSubDevices - * \return + * \return * CL_SUCCESS if the function executed successfully. * CL_INVALID_DEVICE if device was not a valid subdevice * CL_OUT_OF_RESOURCES @@ -1641,7 +1641,7 @@ struct ReferenceHandler /** * Retain the device. * \param device A valid device created using createSubDevices - * \return + * \return * CL_SUCCESS if the function executed successfully. * CL_INVALID_DEVICE if device was not a valid subdevice * CL_OUT_OF_RESOURCES @@ -1896,24 +1896,24 @@ protected: } public: - Wrapper() : object_(NULL), referenceCountable_(false) - { - } - - Wrapper(const cl_type &obj) : object_(obj), referenceCountable_(false) + Wrapper() : object_(NULL), referenceCountable_(false) { - referenceCountable_ = isReferenceCountable(obj); + } + + Wrapper(const cl_type &obj) : object_(obj), referenceCountable_(false) + { + referenceCountable_ = isReferenceCountable(obj); } ~Wrapper() { if (object_ != NULL) { release(); } } - + Wrapper(const Wrapper& rhs) { object_ = rhs.object_; - referenceCountable_ = isReferenceCountable(object_); + referenceCountable_ = isReferenceCountable(object_); if (object_ != NULL) { detail::errHandler(retain(), __RETAIN_ERR); } } @@ -1956,7 +1956,7 @@ public: { if (object_ != NULL) { detail::errHandler(release(), __RELEASE_ERR); } object_ = rhs; - referenceCountable_ = isReferenceCountable(object_); + referenceCountable_ = isReferenceCountable(object_); return *this; } @@ -2037,7 +2037,7 @@ public: Device() : detail::Wrapper() { } /*! \brief Constructor from cl_device_id. - * + * * This simply copies the device ID value, which is an inexpensive operation. */ __CL_EXPLICIT_CONSTRUCTORS Device(const cl_device_id &device) : detail::Wrapper(device) { } @@ -2049,7 +2049,7 @@ public: static Device getDefault(cl_int * err = NULL); /*! \brief Assignment operator from cl_device_id. - * + * * This simply copies the device ID value, which is an inexpensive operation. */ Device& operator = (const cl_device_id& rhs) @@ -2146,7 +2146,7 @@ public: const cl_device_partition_property_ext * properties, VECTOR_CLASS* devices) { - typedef CL_API_ENTRY cl_int + typedef CL_API_ENTRY cl_int ( CL_API_CALL * PFN_clCreateSubDevicesEXT)( cl_device_id /*in_device*/, const cl_device_partition_property_ext * /* properties */, @@ -2190,13 +2190,13 @@ public: Platform() : detail::Wrapper() { } /*! \brief Constructor from cl_platform_id. - * + * * This simply copies the platform ID value, which is an inexpensive operation. */ __CL_EXPLICIT_CONSTRUCTORS Platform(const cl_platform_id &platform) : detail::Wrapper(platform) { } /*! \brief Assignment operator from cl_platform_id. - * + * * This simply copies the platform ID value, which is an inexpensive operation. */ Platform& operator = (const cl_platform_id& rhs) @@ -2228,7 +2228,7 @@ public: } /*! \brief Gets a list of devices for this platform. - * + * * Wraps clGetDeviceIDs(). */ cl_int getDevices( @@ -2285,8 +2285,8 @@ public: VECTOR_CLASS* devices) const { typedef CL_API_ENTRY cl_int (CL_API_CALL *PFN_clGetDeviceIDsFromD3D10KHR)( - cl_platform_id platform, - cl_d3d10_device_source_khr d3d_device_source, + cl_platform_id platform, + cl_d3d10_device_source_khr d3d_device_source, void * d3d_object, cl_d3d10_device_set_khr d3d_device_set, cl_uint num_entries, @@ -2302,12 +2302,12 @@ public: cl_uint n = 0; cl_int err = pfn_clGetDeviceIDsFromD3D10KHR( - object_, - d3d_device_source, + object_, + d3d_device_source, d3d_object, - d3d_device_set, - 0, - NULL, + d3d_device_set, + 0, + NULL, &n); if (err != CL_SUCCESS) { return detail::errHandler(err, __GET_DEVICE_IDS_ERR); @@ -2315,12 +2315,12 @@ public: cl_device_id* ids = (cl_device_id*) alloca(n * sizeof(cl_device_id)); err = pfn_clGetDeviceIDsFromD3D10KHR( - object_, - d3d_device_source, + object_, + d3d_device_source, d3d_object, d3d_device_set, - n, - ids, + n, + ids, NULL); if (err != CL_SUCCESS) { return detail::errHandler(err, __GET_DEVICE_IDS_ERR); @@ -2332,7 +2332,7 @@ public: #endif /*! \brief Gets a list of available platforms. - * + * * Wraps clGetPlatformIDs(). */ static cl_int get( @@ -2361,7 +2361,7 @@ public: } /*! \brief Gets the first available platform. - * + * * Wraps clGetPlatformIDs(), returning the first result. */ static cl_int get( @@ -2390,7 +2390,7 @@ public: } /*! \brief Gets the first available platform, returning it by value. - * + * * Wraps clGetPlatformIDs(), returning the first result. */ static Platform get( @@ -2419,17 +2419,17 @@ public: return Platform(); } - + return Platform(ids[0]); } - static Platform getDefault( + static Platform getDefault( cl_int *errResult = NULL ) { return get(errResult); } - + #if defined(CL_VERSION_1_2) //! \brief Wrapper for clUnloadCompiler(). cl_int @@ -2465,7 +2465,7 @@ UnloadCompiler() * * \see cl_context */ -class Context +class Context : public detail::Wrapper { private: @@ -2657,12 +2657,12 @@ public: * * \note All calls to this function return the same cl_context as the first. */ - static Context getDefault(cl_int * err = NULL) + static Context getDefault(cl_int * err = NULL) { int state = detail::compare_exchange( - &default_initialized_, + &default_initialized_, __DEFAULT_BEING_INITIALIZED, __DEFAULT_NOT_INITIALIZED); - + if (state & __DEFAULT_INITIALIZED) { if (err != NULL) { *err = default_error_; @@ -2709,14 +2709,14 @@ public: Context() : detail::Wrapper() { } /*! \brief Constructor from cl_context - takes ownership. - * + * * This effectively transfers ownership of a refcount on the cl_context * into the new Context object. */ __CL_EXPLICIT_CONSTRUCTORS Context(const cl_context& context) : detail::Wrapper(context) { } /*! \brief Assignment operator from cl_context - takes ownership. - * + * * This effectively transfers ownership of a refcount on the rhs and calls * clReleaseContext() on the value previously held by this instance. */ @@ -2750,7 +2750,7 @@ public: } /*! \brief Gets a list of supported image formats. - * + * * Wraps clGetSupportedImageFormats(). */ cl_int getSupportedImageFormats( @@ -2855,7 +2855,7 @@ public: Event() : detail::Wrapper() { } /*! \brief Constructor from cl_event - takes ownership. - * + * * This effectively transfers ownership of a refcount on the cl_event * into the new Event object. */ @@ -2919,7 +2919,7 @@ public: } /*! \brief Blocks the calling thread until this event completes. - * + * * Wraps clWaitForEvents(). */ cl_int wait() const @@ -2936,7 +2936,7 @@ public: */ cl_int setCallback( cl_int type, - void (CL_CALLBACK * pfn_notify)(cl_event, cl_int, void *), + void (CL_CALLBACK * pfn_notify)(cl_event, cl_int, void *), void * user_data = NULL) { return detail::errHandler( @@ -2944,13 +2944,13 @@ public: object_, type, pfn_notify, - user_data), + user_data), __SET_EVENT_CALLBACK_ERR); } #endif /*! \brief Blocks the calling thread until every event specified is complete. - * + * * Wraps clWaitForEvents(). */ static cl_int @@ -2965,7 +2965,7 @@ public: #if defined(CL_VERSION_1_1) /*! \brief Class interface for user events (a subset of cl_event's). - * + * * See Event for details about copy semantics, etc. */ class UserEvent : public Event @@ -3000,14 +3000,14 @@ public: cl_int setStatus(cl_int status) { return detail::errHandler( - ::clSetUserEventStatus(object_,status), + ::clSetUserEventStatus(object_,status), __SET_USER_EVENT_STATUS_ERR); } }; #endif /*! \brief Blocks the calling thread until every event specified is complete. - * + * * Wraps clWaitForEvents(). */ inline static cl_int @@ -3034,7 +3034,7 @@ public: Memory() : detail::Wrapper() { } /*! \brief Constructor from cl_mem - takes ownership. - * + * * This effectively transfers ownership of a refcount on the cl_mem * into the new Memory object. */ @@ -3119,14 +3119,14 @@ public: * value - not the Memory class instance. */ cl_int setDestructorCallback( - void (CL_CALLBACK * pfn_notify)(cl_mem, void *), + void (CL_CALLBACK * pfn_notify)(cl_mem, void *), void * user_data = NULL) { return detail::errHandler( ::clSetMemObjectDestructorCallback( object_, pfn_notify, - user_data), + user_data), __SET_MEM_OBJECT_DESTRUCTOR_CALLBACK_ERR); } #endif @@ -3146,7 +3146,7 @@ cl_int copy( const CommandQueue &queue, const cl::Buffer &buffer, IteratorType s /*! \brief Class interface for Buffer Memory Objects. - * + * * See Memory for details about copy semantics, etc. * * \see Memory @@ -3231,7 +3231,7 @@ public: if( useHostPtr ) { flags |= CL_MEM_USE_HOST_PTR; } - + ::size_t size = sizeof(DataType)*(endIterator - startIterator); Context context = Context::getDefault(err); @@ -3291,7 +3291,7 @@ public: Memory::operator=(rhs); return *this; } - + /*! \brief Copy constructor to forward copy to the superclass correctly. * Required for MSVC. */ @@ -3305,7 +3305,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. @@ -3336,10 +3336,10 @@ public: Buffer result; cl_int error; result.object_ = ::clCreateSubBuffer( - object_, - flags, - buffer_create_type, - buffer_create_info, + object_, + flags, + buffer_create_type, + buffer_create_info, &error); detail::errHandler(error, __CREATE_SUBBUFFER_ERR); @@ -3348,7 +3348,7 @@ public: } return result; - } + } #endif }; @@ -3356,7 +3356,7 @@ public: /*! \brief Class interface for creating OpenCL buffers from ID3D10Buffer's. * * This is provided to facilitate interoperability with Direct3D. - * + * * See Memory for details about copy semantics, etc. * * \see Memory @@ -3462,9 +3462,9 @@ public: /*! \brief Class interface for GL Buffer Memory Objects. * * This is provided to facilitate interoperability with OpenGL. - * + * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class BufferGL : public Buffer @@ -3557,7 +3557,7 @@ public: /*! \brief C++ base class for Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image : public Memory @@ -3621,7 +3621,7 @@ public: detail::getInfo(&::clGetImageInfo, object_, name, param), __GET_IMAGE_INFO_ERR); } - + //! \brief Wrapper for clGetImageInfo() that returns by value. template typename detail::param_traits::param_type @@ -3641,7 +3641,7 @@ public: /*! \brief Class interface for 1D Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image1D : public Image @@ -3667,11 +3667,11 @@ public: 0, 0, 0, 0, 0, 0, 0, 0 }; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - host_ptr, + context(), + flags, + &format, + &desc, + host_ptr, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -3753,11 +3753,11 @@ public: buffer() }; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - NULL, + context(), + flags, + &format, + &desc, + NULL, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -3775,7 +3775,7 @@ public: Image::operator=(rhs); return *this; } - + /*! \brief Copy constructor to forward copy to the superclass correctly. * Required for MSVC. */ @@ -3834,11 +3834,11 @@ public: 0, 0, 0, 0 }; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - host_ptr, + context(), + flags, + &format, + &desc, + host_ptr, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -3856,7 +3856,7 @@ public: Image::operator=(rhs); return *this; } - + /*! \brief Copy constructor to forward copy to the superclass correctly. * Required for MSVC. */ @@ -3893,7 +3893,7 @@ public: /*! \brief Class interface for 2D Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image2D : public Image @@ -4023,9 +4023,9 @@ public: /*! \brief Class interface for GL 2D Image Memory objects. * * This is provided to facilitate interoperability with OpenGL. - * + * * See Memory for details about copy semantics, etc. - * + * * \see Memory * \note Deprecated for OpenCL 1.2. Please use ImageGL instead. */ @@ -4060,7 +4060,7 @@ public: } } - + //! \brief Default constructor - initializes to NULL. Image2DGL() : Image2D() { } @@ -4144,11 +4144,11 @@ public: 0, 0, 0 }; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - host_ptr, + context(), + flags, + &format, + &desc, + host_ptr, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -4166,7 +4166,7 @@ public: Image::operator=(rhs); return *this; } - + /*! \brief Copy constructor to forward copy to the superclass correctly. * Required for MSVC. */ @@ -4202,7 +4202,7 @@ public: /*! \brief Class interface for 3D Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image3D : public Image @@ -4254,11 +4254,11 @@ public: 0, 0, 0 }; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - host_ptr, + context(), + flags, + &format, + &desc, + host_ptr, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -4336,9 +4336,9 @@ public: /*! \brief Class interface for GL 3D Image Memory objects. * * This is provided to facilitate interoperability with OpenGL. - * + * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image3DGL : public Image3D @@ -4443,8 +4443,8 @@ public: { cl_int error; object_ = ::clCreateFromGLTexture( - context(), - flags, + context(), + flags, target, miplevel, texobj, @@ -4506,7 +4506,7 @@ public: * * \see Memory */ -class BufferRenderGL : +class BufferRenderGL : #if defined(CL_VERSION_1_2) public ImageGL #else // #if defined(CL_VERSION_1_2) @@ -4567,7 +4567,7 @@ public: #else // #if defined(CL_VERSION_1_2) Image2DGL::operator=(rhs); #endif //#if defined(CL_VERSION_1_2) - + return *this; } @@ -4602,7 +4602,7 @@ public: #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. @@ -4614,7 +4614,7 @@ public: #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) @@ -4636,7 +4636,7 @@ public: * to the same underlying cl_sampler as the original. For details, see * clRetainSampler() and clReleaseSampler(). * - * \see cl_sampler + * \see cl_sampler */ class Sampler : public detail::Wrapper { @@ -4657,7 +4657,7 @@ public: { cl_int error; object_ = ::clCreateSampler( - context(), + context(), normalized_coords, addressing_mode, filter_mode, @@ -4670,7 +4670,7 @@ public: } /*! \brief Constructor from cl_sampler - takes ownership. - * + * * This effectively transfers ownership of a refcount on the cl_sampler * into the new Sampler object. */ @@ -4783,11 +4783,11 @@ public: } /*! \brief Conversion operator to const ::size_t *. - * + * * \returns a pointer to the size of the first dimension. */ - operator const ::size_t*() const { - return (const ::size_t*) sizes_; + operator const ::size_t*() const { + return (const ::size_t*) sizes_; } //! \brief Queries the number of dimensions in the range. @@ -4819,7 +4819,7 @@ struct KernelArgumentHandler static const void* ptr(const LocalSpaceArg&) { return NULL; } }; -} +} //! \endcond /*! __local @@ -4864,7 +4864,7 @@ public: Kernel() { } /*! \brief Constructor from cl_kernel - takes ownership. - * + * * This effectively transfers ownership of a refcount on the cl_kernel * into the new Kernel object. */ @@ -5114,7 +5114,7 @@ public: * Set to CL_INVALID_BINARY if the binary provided is not valid for the matching device. * \param err if non-NULL will be set to CL_SUCCESS on successful operation or one of the following errors: * CL_INVALID_CONTEXT if context is not a valid context. - * CL_INVALID_VALUE if the length of devices is zero; or if the length of binaries does not match the length of devices; + * CL_INVALID_VALUE if the length of devices is zero; or if the length of binaries does not match the length of devices; * or if any entry in binaries is NULL or has length 0. * CL_INVALID_DEVICE if OpenCL devices listed in devices are not in the list of devices associated with context. * CL_INVALID_BINARY if an invalid program binary was encountered for any device. binaryStatus will return specific status for each device. @@ -5128,9 +5128,9 @@ public: cl_int* err = NULL) { cl_int error; - + const ::size_t numDevices = devices.size(); - + // Catch size mismatch early and return if(binaries.size() != numDevices) { error = CL_INVALID_VALUE; @@ -5157,7 +5157,7 @@ public: if(binaryStatus) { binaryStatus->resize(numDevices); } - + object_ = ::clCreateProgramWithBinary( context(), (cl_uint) devices.size(), deviceIDs, @@ -5171,7 +5171,7 @@ public: } } - + #if defined(CL_VERSION_1_2) /** * Create program using builtin kernels. @@ -5191,12 +5191,12 @@ public: for( ::size_t deviceIndex = 0; deviceIndex < numDevices; ++deviceIndex ) { deviceIDs[deviceIndex] = (devices[deviceIndex])(); } - + object_ = ::clCreateProgramWithBuiltInKernels( - context(), + context(), (cl_uint) devices.size(), deviceIDs, - kernelNames.c_str(), + kernelNames.c_str(), &error); detail::errHandler(error, __CREATE_PROGRAM_WITH_BUILT_IN_KERNELS_ERR); @@ -5378,7 +5378,7 @@ inline Program linkProgram( const char* options = NULL, void (CL_CALLBACK * notifyFptr)(cl_program, void *) = NULL, void* data = NULL, - cl_int* err = NULL) + cl_int* err = NULL) { cl_int error_local = CL_SUCCESS; @@ -5413,7 +5413,7 @@ inline Program linkProgram( const char* options = NULL, void (CL_CALLBACK * notifyFptr)(cl_program, void *) = NULL, void* data = NULL, - cl_int* err = NULL) + cl_int* err = NULL) { cl_int error_local = CL_SUCCESS; @@ -5423,7 +5423,7 @@ inline Program linkProgram( for (unsigned int i = 0; i < inputPrograms.size(); i++) { programs[i] = inputPrograms[i](); } - } + } Context ctx; if(inputPrograms.size() > 0) { @@ -5457,14 +5457,14 @@ inline VECTOR_CLASS cl::Program::getInfo(cl_int* er { VECTOR_CLASS< ::size_t> sizes = getInfo(); VECTOR_CLASS binaries; - for (VECTOR_CLASS< ::size_t>::iterator s = sizes.begin(); s != sizes.end(); ++s) + for (VECTOR_CLASS< ::size_t>::iterator s = sizes.begin(); s != sizes.end(); ++s) { char *ptr = NULL; - if (*s != 0) + if (*s != 0) ptr = new char[*s]; binaries.push_back(ptr); } - + cl_int result = getInfo(CL_PROGRAM_BINARIES, &binaries); if (err != NULL) { *err = result; @@ -5603,12 +5603,12 @@ public: } #endif // #if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED) - static CommandQueue getDefault(cl_int * err = NULL) + static CommandQueue getDefault(cl_int * err = NULL) { int state = detail::compare_exchange( - &default_initialized_, + &default_initialized_, __DEFAULT_BEING_INITIALIZED, __DEFAULT_NOT_INITIALIZED); - + if (state & __DEFAULT_INITIALIZED) { if (err != NULL) { *err = default_error_; @@ -5787,9 +5787,9 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueReadBufferRect( - object_, - buffer(), - blocking, + object_, + buffer(), + blocking, (const ::size_t *)buffer_offset, (const ::size_t *)host_offset, (const ::size_t *)region, @@ -5826,9 +5826,9 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueWriteBufferRect( - object_, - buffer(), - blocking, + object_, + buffer(), + blocking, (const ::size_t *)buffer_offset, (const ::size_t *)host_offset, (const ::size_t *)region, @@ -5864,11 +5864,11 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueCopyBufferRect( - object_, - src(), - dst(), - (const ::size_t *)src_origin, - (const ::size_t *)dst_origin, + object_, + src(), + dst(), + (const ::size_t *)src_origin, + (const ::size_t *)dst_origin, (const ::size_t *)region, src_row_pitch, src_slice_pitch, @@ -5889,7 +5889,7 @@ public: /** * Enqueue a command to fill a buffer object with a pattern * of a given size. The pattern is specified a as vector. - * \tparam PatternType The datatype of the pattern field. + * \tparam PatternType The datatype of the pattern field. * The pattern type must be an accepted OpenCL data type. */ template @@ -5904,11 +5904,11 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueFillBuffer( - object_, + object_, buffer(), static_cast(&pattern), - sizeof(PatternType), - offset, + sizeof(PatternType), + offset, size, (events != NULL) ? (cl_uint) events->size() : 0, (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL, @@ -6020,10 +6020,10 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueFillImage( - object_, + object_, image(), - static_cast(&fillColor), - (const ::size_t *) origin, + static_cast(&fillColor), + (const ::size_t *) origin, (const ::size_t *) region, (events != NULL) ? (cl_uint) events->size() : 0, (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL, @@ -6054,10 +6054,10 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueFillImage( - object_, + object_, image(), - static_cast(&fillColor), - (const ::size_t *) origin, + static_cast(&fillColor), + (const ::size_t *) origin, (const ::size_t *) region, (events != NULL) ? (cl_uint) events->size() : 0, (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL, @@ -6088,10 +6088,10 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueFillImage( - object_, + object_, image(), - static_cast(&fillColor), - (const ::size_t *) origin, + static_cast(&fillColor), + (const ::size_t *) origin, (const ::size_t *) region, (events != NULL) ? (cl_uint) events->size() : 0, (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL, @@ -6239,14 +6239,14 @@ public: #if defined(CL_VERSION_1_2) /** - * Enqueues a marker command which waits for either a list of events to complete, + * Enqueues a marker command which waits for either a list of events to complete, * or all previously enqueued commands to complete. * - * Enqueues a marker command which waits for either a list of events to complete, - * or if the list is empty it waits for all commands previously enqueued in command_queue - * to complete before it completes. This command returns an event which can be waited on, - * i.e. this event can be waited on to insure that all events either in the event_wait_list - * or all previously enqueued commands, queued before this command to command_queue, + * Enqueues a marker command which waits for either a list of events to complete, + * or if the list is empty it waits for all commands previously enqueued in command_queue + * to complete before it completes. This command returns an event which can be waited on, + * i.e. this event can be waited on to insure that all events either in the event_wait_list + * or all previously enqueued commands, queued before this command to command_queue, * have completed. */ cl_int enqueueMarkerWithWaitList( @@ -6271,12 +6271,12 @@ public: /** * A synchronization point that enqueues a barrier operation. * - * Enqueues a barrier command which waits for either a list of events to complete, - * or if the list is empty it waits for all commands previously enqueued in command_queue - * to complete before it completes. This command blocks command execution, that is, any - * following commands enqueued after it do not execute until it completes. This command - * returns an event which can be waited on, i.e. this event can be waited on to insure that - * all events either in the event_wait_list or all previously enqueued commands, queued + * Enqueues a barrier command which waits for either a list of events to complete, + * or if the list is empty it waits for all commands previously enqueued in command_queue + * to complete before it completes. This command blocks command execution, that is, any + * following commands enqueued after it do not execute until it completes. This command + * returns an event which can be waited on, i.e. this event can be waited on to insure that + * all events either in the event_wait_list or all previously enqueued commands, queued * before this command to command_queue, have completed. */ cl_int enqueueBarrierWithWaitList( @@ -6297,7 +6297,7 @@ public: return err; } - + /** * Enqueues a command to indicate with which device a set of memory objects * should be associated. @@ -6310,7 +6310,7 @@ public: ) const { cl_event tmp; - + cl_mem* localMemObjects = static_cast(alloca(memObjects.size() * sizeof(cl_mem))); for( int i = 0; i < (int)memObjects.size(); ++i ) { localMemObjects[i] = memObjects[i](); @@ -6319,8 +6319,8 @@ public: cl_int err = detail::errHandler( ::clEnqueueMigrateMemObjects( - object_, - (cl_uint)memObjects.size(), + object_, + (cl_uint)memObjects.size(), static_cast(localMemObjects), flags, (events != NULL) ? (cl_uint) events->size() : 0, @@ -6389,7 +6389,7 @@ public: const VECTOR_CLASS* events = NULL, Event* event = NULL) const { - cl_mem * mems = (mem_objects != NULL && mem_objects->size() > 0) + cl_mem * mems = (mem_objects != NULL && mem_objects->size() > 0) ? (cl_mem*) alloca(mem_objects->size() * sizeof(cl_mem)) : NULL; @@ -6420,14 +6420,14 @@ public: /** * Deprecated APIs for 1.2 */ -#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) || (defined(CL_VERSION_1_1) && !defined(CL_VERSION_1_2)) - CL_EXT_PREFIX__VERSION_1_1_DEPRECATED +#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) || (defined(CL_VERSION_1_1) && !defined(CL_VERSION_1_2)) + CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int enqueueMarker(Event* event = NULL) const CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED { cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueMarker( - object_, + object_, (event != NULL) ? &tmp : NULL), __ENQUEUE_MARKER_ERR); @@ -6518,7 +6518,7 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *PFN_clEnqueueReleaseD3D10ObjectsKHR)( #if defined(CL_VERSION_1_1) __INIT_CL_EXT_FCN_PTR(clEnqueueAcquireD3D10ObjectsKHR); #endif - + cl_event tmp; cl_int err = detail::errHandler( pfn_clEnqueueAcquireD3D10ObjectsKHR( @@ -6573,7 +6573,7 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *PFN_clEnqueueReleaseD3D10ObjectsKHR)( /** * Deprecated APIs for 1.2 */ -#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) || (defined(CL_VERSION_1_1) && !defined(CL_VERSION_1_2)) +#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) || (defined(CL_VERSION_1_1) && !defined(CL_VERSION_1_2)) CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int enqueueBarrier() const CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED { @@ -6634,7 +6634,7 @@ Buffer::Buffer( if( useHostPtr ) { flags |= CL_MEM_USE_HOST_PTR; } - + ::size_t size = sizeof(DataType)*(endIterator - startIterator); if( useHostPtr ) { @@ -6869,11 +6869,11 @@ inline cl_int copy( const CommandQueue &queue, IteratorType startIterator, Itera { typedef typename std::iterator_traits::value_type DataType; cl_int error; - + ::size_t length = endIterator-startIterator; ::size_t byteLength = length*sizeof(DataType); - DataType *pointer = + DataType *pointer = 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 ) { @@ -6881,8 +6881,8 @@ inline cl_int copy( const CommandQueue &queue, IteratorType startIterator, Itera } #if defined(_MSC_VER) std::copy( - startIterator, - endIterator, + startIterator, + endIterator, stdext::checked_array_iterator( pointer, length)); #else @@ -6891,7 +6891,7 @@ inline cl_int copy( const CommandQueue &queue, IteratorType startIterator, Itera Event endEvent; error = queue.enqueueUnmapMemObject(buffer, pointer, 0, &endEvent); // if exceptions enabled, enqueueUnmapMemObject will throw - if( error != CL_SUCCESS ) { + if( error != CL_SUCCESS ) { return error; } endEvent.wait(); @@ -6908,11 +6908,11 @@ inline cl_int copy( const CommandQueue &queue, const cl::Buffer &buffer, Iterato { typedef typename std::iterator_traits::value_type DataType; cl_int error; - + ::size_t length = endIterator-startIterator; ::size_t byteLength = length*sizeof(DataType); - DataType *pointer = + DataType *pointer = 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 ) { @@ -6922,7 +6922,7 @@ inline cl_int copy( const CommandQueue &queue, const cl::Buffer &buffer, Iterato Event endEvent; error = queue.enqueueUnmapMemObject(buffer, pointer, 0, &endEvent); // if exceptions enabled, enqueueUnmapMemObject will throw - if( error != CL_SUCCESS ) { + if( error != CL_SUCCESS ) { return error; } endEvent.wait(); @@ -6952,17 +6952,17 @@ inline cl_int enqueueReadBufferRect( } return queue.enqueueReadBufferRect( - buffer, - blocking, - buffer_offset, + buffer, + blocking, + buffer_offset, host_offset, region, buffer_row_pitch, buffer_slice_pitch, host_row_pitch, host_slice_pitch, - ptr, - events, + ptr, + events, event); } @@ -6988,17 +6988,17 @@ inline cl_int enqueueWriteBufferRect( } return queue.enqueueWriteBufferRect( - buffer, - blocking, - buffer_offset, + buffer, + blocking, + buffer_offset, host_offset, region, buffer_row_pitch, buffer_slice_pitch, host_row_pitch, host_slice_pitch, - ptr, - events, + ptr, + events, event); } @@ -7032,7 +7032,7 @@ inline cl_int enqueueCopyBufferRect( src_slice_pitch, dst_row_pitch, dst_slice_pitch, - events, + events, event); } #endif @@ -7046,7 +7046,7 @@ inline cl_int enqueueReadImage( ::size_t slice_pitch, void* ptr, const VECTOR_CLASS* events = NULL, - Event* event = NULL) + Event* event = NULL) { cl_int error; CommandQueue queue = CommandQueue::getDefault(&error); @@ -7063,7 +7063,7 @@ inline cl_int enqueueReadImage( row_pitch, slice_pitch, ptr, - events, + events, event); } @@ -7093,7 +7093,7 @@ inline cl_int enqueueWriteImage( row_pitch, slice_pitch, ptr, - events, + events, event); } @@ -7195,7 +7195,7 @@ inline cl_int finish(void) if (error != CL_SUCCESS) { return error; - } + } return queue.finish(); @@ -7214,63 +7214,63 @@ struct EnqueueArgs const NDRange local_; VECTOR_CLASS events_; - EnqueueArgs(NDRange global) : + EnqueueArgs(NDRange global) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange) { } - EnqueueArgs(NDRange global, NDRange local) : + EnqueueArgs(NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local) { } - EnqueueArgs(NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(NDRange offset, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(offset), + offset_(offset), global_(global), local_(local) { } - EnqueueArgs(Event e, NDRange global) : + EnqueueArgs(Event e, NDRange global) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange) { events_.push_back(e); } - EnqueueArgs(Event e, NDRange global, NDRange local) : + EnqueueArgs(Event e, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local) { events_.push_back(e); } - EnqueueArgs(Event e, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(Event e, NDRange offset, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(offset), + offset_(offset), global_(global), local_(local) { events_.push_back(e); } - EnqueueArgs(const VECTOR_CLASS &events, NDRange global) : + EnqueueArgs(const VECTOR_CLASS &events, NDRange global) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange), events_(events) @@ -7278,9 +7278,9 @@ struct EnqueueArgs } - EnqueueArgs(const VECTOR_CLASS &events, NDRange global, NDRange local) : + EnqueueArgs(const VECTOR_CLASS &events, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local), events_(events) @@ -7288,9 +7288,9 @@ struct EnqueueArgs } - EnqueueArgs(const VECTOR_CLASS &events, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(const VECTOR_CLASS &events, NDRange offset, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(offset), + offset_(offset), global_(global), local_(local), events_(events) @@ -7298,63 +7298,63 @@ struct EnqueueArgs } - EnqueueArgs(CommandQueue &queue, NDRange global) : + EnqueueArgs(CommandQueue &queue, NDRange global) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange) { } - EnqueueArgs(CommandQueue &queue, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, NDRange global, NDRange local) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local) { } - EnqueueArgs(CommandQueue &queue, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, NDRange offset, NDRange global, NDRange local) : queue_(queue), - offset_(offset), + offset_(offset), global_(global), local_(local) { } - EnqueueArgs(CommandQueue &queue, Event e, NDRange global) : + EnqueueArgs(CommandQueue &queue, Event e, NDRange global) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange) { events_.push_back(e); } - EnqueueArgs(CommandQueue &queue, Event e, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, Event e, NDRange global, NDRange local) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local) { events_.push_back(e); } - EnqueueArgs(CommandQueue &queue, Event e, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, Event e, NDRange offset, NDRange global, NDRange local) : queue_(queue), - offset_(offset), + offset_(offset), global_(global), local_(local) { events_.push_back(e); } - EnqueueArgs(CommandQueue &queue, const VECTOR_CLASS &events, NDRange global) : + EnqueueArgs(CommandQueue &queue, const VECTOR_CLASS &events, NDRange global) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange), events_(events) @@ -7362,9 +7362,9 @@ struct EnqueueArgs } - EnqueueArgs(CommandQueue &queue, const VECTOR_CLASS &events, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, const VECTOR_CLASS &events, NDRange global, NDRange local) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local), events_(events) @@ -7372,9 +7372,9 @@ struct EnqueueArgs } - EnqueueArgs(CommandQueue &queue, const VECTOR_CLASS &events, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, const VECTOR_CLASS &events, NDRange offset, NDRange global, NDRange local) : queue_(queue), - offset_(offset), + offset_(offset), global_(global), local_(local), events_(events) @@ -7394,13 +7394,13 @@ struct SetArg { kernel.setArg(index, arg); } -}; +}; template struct SetArg { static void set (Kernel, NullType) - { + { } }; @@ -7504,7 +7504,7 @@ public: SetArg<30, T30>::set(kernel_, t30); SetArg<31, T31>::set(kernel_, t31); - + args.queue_.enqueueNDRangeKernel( kernel_, args.offset_, @@ -7512,7 +7512,7 @@ public: args.local_, &args.events_, &event); - + return event; } @@ -7595,12 +7595,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 32)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -7821,12 +7821,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 31)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -8043,12 +8043,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 30)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -8261,12 +8261,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 29)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -8475,12 +8475,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 28)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -8685,12 +8685,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 27)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -8891,12 +8891,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 26)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -9093,12 +9093,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 25)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -9291,12 +9291,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 24)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -9485,12 +9485,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 23)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -9675,12 +9675,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 22)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -9861,12 +9861,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 21)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -10043,12 +10043,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 20)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -10221,12 +10221,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 19)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -10395,12 +10395,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 18)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -10565,12 +10565,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 17)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -10731,12 +10731,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 16)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -10893,12 +10893,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 15)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -11051,12 +11051,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 14)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -11205,12 +11205,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 13)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -11355,12 +11355,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 12)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -11501,12 +11501,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 11)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -11643,12 +11643,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 10)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -11781,12 +11781,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 9)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -11915,12 +11915,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 8)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -12045,12 +12045,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 7)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -12171,12 +12171,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 6)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -12293,12 +12293,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 5)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -12411,12 +12411,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 4)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -12525,12 +12525,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 3)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -12635,12 +12635,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 2)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -12741,12 +12741,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 1)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -12810,7 +12810,7 @@ struct make_kernel : > { public: - typedef detail::KernelFunctorGlobal< + typedef detail::KernelFunctorGlobal< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, @@ -12837,7 +12837,7 @@ public: T28, T29, T30, T31 >( - FunctorType(program, name, err)) + FunctorType(program, name, err)) {} make_kernel( @@ -12853,8 +12853,8 @@ public: T28, T29, T30, T31 >( - FunctorType(kernel)) - {} + FunctorType(kernel)) + {} }; @@ -12944,8 +12944,8 @@ public: #undef __PARAM_NAME_DEVICE_FISSION #endif // USE_CL_DEVICE_FISSION -#undef __DEFAULT_NOT_INITIALIZED -#undef __DEFAULT_BEING_INITIALIZED +#undef __DEFAULT_NOT_INITIALIZED +#undef __DEFAULT_BEING_INITIALIZED #undef __DEFAULT_INITIALIZED #undef CL_HPP_RVALUE_REFERENCES_SUPPORTED diff --git a/projects/clr/opencl/khronos/headers/opencl2.1/CL/cl2.hpp b/projects/clr/opencl/khronos/headers/opencl2.1/CL/cl2.hpp index 09764a0060..18ac0a935d 100644 --- a/projects/clr/opencl/khronos/headers/opencl2.1/CL/cl2.hpp +++ b/projects/clr/opencl/khronos/headers/opencl2.1/CL/cl2.hpp @@ -86,17 +86,17 @@ * fixes in the new header as well as additional OpenCL 2.0 features. * As a result the header is not directly backward compatible and for this * reason we release it as cl2.hpp rather than a new version of cl.hpp. - * + * * * \section compatibility Compatibility * Due to the evolution of the underlying OpenCL API the 2.0 C++ bindings * include an updated approach to defining supported feature versions * and the range of valid underlying OpenCL runtime versions supported. * - * The combination of preprocessor macros CL_HPP_TARGET_OPENCL_VERSION and + * The combination of preprocessor macros CL_HPP_TARGET_OPENCL_VERSION and * CL_HPP_MINIMUM_OPENCL_VERSION control this range. These are three digit - * decimal values representing OpenCL runime versions. The default for - * the target is 200, representing OpenCL 2.0 and the minimum is also + * decimal values representing OpenCL runime versions. The default for + * the target is 200, representing OpenCL 2.0 and the minimum is also * defined as 200. These settings would use 2.0 API calls only. * If backward compatibility with a 1.2 runtime is required, the minimum * version may be set to 120. @@ -104,21 +104,21 @@ * Note that this is a compile-time setting, and so affects linking against * a particular SDK version rather than the versioning of the loaded runtime. * - * The earlier versions of the header included basic vector and string - * classes based loosely on STL versions. These were difficult to + * The earlier versions of the header included basic vector and string + * classes based loosely on STL versions. These were difficult to * maintain and very rarely used. For the 2.0 header we now assume * the presence of the standard library unless requested otherwise. - * We use std::array, std::vector, std::shared_ptr and std::string - * throughout to safely manage memory and reduce the chance of a + * We use std::array, std::vector, std::shared_ptr and std::string + * throughout to safely manage memory and reduce the chance of a * recurrance of earlier memory management bugs. * - * These classes are used through typedefs in the cl namespace: + * These classes are used through typedefs in the cl namespace: * cl::array, cl::vector, cl::pointer and cl::string. * In addition cl::allocate_pointer forwards to std::allocate_shared * by default. - * In all cases these standard library classes can be replaced with - * custom interface-compatible versions using the CL_HPP_NO_STD_ARRAY, - * CL_HPP_NO_STD_VECTOR, CL_HPP_NO_STD_UNIQUE_PTR and + * In all cases these standard library classes can be replaced with + * custom interface-compatible versions using the CL_HPP_NO_STD_ARRAY, + * CL_HPP_NO_STD_VECTOR, CL_HPP_NO_STD_UNIQUE_PTR and * CL_HPP_NO_STD_STRING macros. * * The OpenCL 1.x versions of the C++ bindings included a size_t wrapper @@ -129,12 +129,12 @@ * using the CL_HPP_ENABLE_SIZE_T_COMPATIBILITY macro. * * Finally, the program construction interface used a clumsy vector-of-pairs - * design in the earlier versions. We have replaced that with a cleaner - * vector-of-vectors and vector-of-strings design. However, for backward + * design in the earlier versions. We have replaced that with a cleaner + * vector-of-vectors and vector-of-strings design. However, for backward * compatibility old behaviour can be regained with the * CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY macro. - * - * In OpenCL 2.0 OpenCL C is not entirely backward compatibility with + * + * In OpenCL 2.0 OpenCL C is not entirely backward compatibility with * earlier versions. As a result a flag must be passed to the OpenCL C * compiled to request OpenCL 2.0 compilation of kernels with 1.2 as * the default in the absence of the flag. @@ -485,17 +485,17 @@ #if defined(_MSC_VER) #include -#endif // _MSC_VER - +#endif // _MSC_VER + // Check for a valid C++ version -// Need to do both tests here because for some reason __cplusplus is not +// Need to do both tests here because for some reason __cplusplus is not // updated in visual studio #if (!defined(_MSC_VER) && __cplusplus < 201103L) || (defined(_MSC_VER) && _MSC_VER < 1700) #error Visual studio 2013 or another C++11-supporting compiler required #endif -// +// #if defined(CL_HPP_USE_CL_DEVICE_FISSION) || defined(CL_HPP_USE_CL_SUB_GROUPS_KHR) #include #endif @@ -521,14 +521,14 @@ // Define deprecated prefixes and suffixes to ensure compilation // in case they are not pre-defined #if !defined(CL_EXT_PREFIX__VERSION_1_1_DEPRECATED) -#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED +#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED #endif // #if !defined(CL_EXT_PREFIX__VERSION_1_1_DEPRECATED) #if !defined(CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED) #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED #endif // #if !defined(CL_EXT_PREFIX__VERSION_1_1_DEPRECATED) #if !defined(CL_EXT_PREFIX__VERSION_1_2_DEPRECATED) -#define CL_EXT_PREFIX__VERSION_1_2_DEPRECATED +#define CL_EXT_PREFIX__VERSION_1_2_DEPRECATED #endif // #if !defined(CL_EXT_PREFIX__VERSION_1_2_DEPRECATED) #if !defined(CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED) #define CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED @@ -587,7 +587,7 @@ namespace cl { template using pointer = std::unique_ptr; } // namespace cl -#endif +#endif #endif // #if CL_HPP_TARGET_OPENCL_VERSION >= 200 #if !defined(CL_HPP_NO_STD_ARRAY) #include @@ -703,8 +703,8 @@ namespace cl { class Pipe; #if defined(CL_HPP_ENABLE_EXCEPTIONS) - /*! \brief Exception class - * + /*! \brief Exception class + * * This may be thrown by API functions when CL_HPP_ENABLE_EXCEPTIONS is defined. */ class Error : public std::exception @@ -715,7 +715,7 @@ namespace cl { public: /*! \brief Create a new CL error exception for a given error code * and corresponding message. - * + * * \param err error code value. * * \param errStr a descriptive string that must remain in scope until @@ -1064,7 +1064,7 @@ inline cl_int getInfoHelper(Func f, cl_uint name, array* param, lo if (err != CL_SUCCESS) { return err; } - + // Bound the copy with N to prevent overruns // if passed N > than the amount copied if (elements > N) { @@ -1472,7 +1472,7 @@ struct ReferenceHandler /** * Retain the device. * \param device A valid device created using createSubDevices - * \return + * \return * CL_SUCCESS if the function executed successfully. * CL_INVALID_DEVICE if device was not a valid subdevice * CL_OUT_OF_RESOURCES @@ -1483,7 +1483,7 @@ struct ReferenceHandler /** * Retain the device. * \param device A valid device created using createSubDevices - * \return + * \return * CL_SUCCESS if the function executed successfully. * CL_INVALID_DEVICE if device was not a valid subdevice * CL_OUT_OF_RESOURCES @@ -1646,11 +1646,11 @@ protected: public: Wrapper() : object_(NULL) { } - - Wrapper(const cl_type &obj, bool retainObject) : object_(obj) + + Wrapper(const cl_type &obj, bool retainObject) : object_(obj) { - if (retainObject) { - detail::errHandler(retain(), __RETAIN_ERR); + if (retainObject) { + detail::errHandler(retain(), __RETAIN_ERR); } } @@ -1761,15 +1761,15 @@ protected: } public: - Wrapper() : object_(NULL), referenceCountable_(false) - { - } - - Wrapper(const cl_type &obj, bool retainObject) : - object_(obj), - referenceCountable_(false) + Wrapper() : object_(NULL), referenceCountable_(false) { - referenceCountable_ = isReferenceCountable(obj); + } + + Wrapper(const cl_type &obj, bool retainObject) : + object_(obj), + referenceCountable_(false) + { + referenceCountable_ = isReferenceCountable(obj); if (retainObject) { detail::errHandler(retain(), __RETAIN_ERR); @@ -1780,11 +1780,11 @@ public: { release(); } - + Wrapper(const Wrapper& rhs) { object_ = rhs.object_; - referenceCountable_ = isReferenceCountable(object_); + referenceCountable_ = isReferenceCountable(object_); detail::errHandler(retain(), __RETAIN_ERR); } @@ -1823,7 +1823,7 @@ public: { detail::errHandler(release(), __RELEASE_ERR); object_ = rhs; - referenceCountable_ = isReferenceCountable(object_); + referenceCountable_ = isReferenceCountable(object_); return *this; } @@ -2001,10 +2001,10 @@ public: Device() : detail::Wrapper() { } /*! \brief Constructor from cl_device_id. - * + * * This simply copies the device ID value, which is an inexpensive operation. */ - explicit Device(const cl_device_id &device, bool retainObject = false) : + explicit Device(const cl_device_id &device, bool retainObject = false) : detail::Wrapper(device, retainObject) { } /*! \brief Returns the first device on the default context. @@ -2037,7 +2037,7 @@ public: } /*! \brief Assignment operator from cl_device_id. - * + * * This simply copies the device ID value, which is an inexpensive operation. */ Device& operator = (const cl_device_id& rhs) @@ -2118,7 +2118,7 @@ public: return detail::errHandler(err, __CREATE_SUB_DEVICES_ERR); } - // Cannot trivially assign because we need to capture intermediates + // Cannot trivially assign because we need to capture intermediates // with safe construction if (devices) { devices->resize(ids.size()); @@ -2126,7 +2126,7 @@ public: // Assign to param, constructing with retain behaviour // to correctly capture each underlying CL object for (size_type i = 0; i < ids.size(); i++) { - // We do not need to retain because this device is being created + // We do not need to retain because this device is being created // by the runtime (*devices)[i] = Device(ids[i], false); } @@ -2143,7 +2143,7 @@ public: const cl_device_partition_property_ext * properties, vector* devices) { - typedef CL_API_ENTRY cl_int + typedef CL_API_ENTRY cl_int ( CL_API_CALL * PFN_clCreateSubDevicesEXT)( cl_device_id /*in_device*/, const cl_device_partition_property_ext * /* properties */, @@ -2165,7 +2165,7 @@ public: if (err != CL_SUCCESS) { return detail::errHandler(err, __CREATE_SUB_DEVICES_ERR); } - // Cannot trivially assign because we need to capture intermediates + // Cannot trivially assign because we need to capture intermediates // with safe construction if (devices) { devices->resize(ids.size()); @@ -2173,7 +2173,7 @@ public: // Assign to param, constructing with retain behaviour // to correctly capture each underlying CL object for (size_type i = 0; i < ids.size(); i++) { - // We do not need to retain because this device is being created + // We do not need to retain because this device is being created // by the runtime (*devices)[i] = Device(ids[i], false); } @@ -2252,7 +2252,7 @@ private: static void makeDefaultProvided(const Platform &p) { default_ = p; } - + public: #ifdef CL_HPP_UNIT_TEST_ENABLE /*! \brief Reset the default. @@ -2270,17 +2270,17 @@ public: Platform() : detail::Wrapper() { } /*! \brief Constructor from cl_platform_id. - * + * * \param retainObject will cause the constructor to retain its cl object. * Defaults to false to maintain compatibility with * earlier versions. * This simply copies the platform ID value, which is an inexpensive operation. */ - explicit Platform(const cl_platform_id &platform, bool retainObject = false) : + explicit Platform(const cl_platform_id &platform, bool retainObject = false) : detail::Wrapper(platform, retainObject) { } /*! \brief Assignment operator from cl_platform_id. - * + * * This simply copies the platform ID value, which is an inexpensive operation. */ Platform& operator = (const cl_platform_id& rhs) @@ -2301,10 +2301,10 @@ public: } /** - * Modify the default platform to be used by + * Modify the default platform to be used by * subsequent operations. * Will only set the default if no default was previously created. - * @return updated default platform. + * @return updated default platform. * Should be compared to the passed value to ensure that it was updated. */ static Platform setDefault(const Platform &default_platform) @@ -2337,7 +2337,7 @@ public: } /*! \brief Gets a list of devices for this platform. - * + * * Wraps clGetDeviceIDs(). */ cl_int getDevices( @@ -2359,7 +2359,7 @@ public: return detail::errHandler(err, __GET_DEVICE_IDS_ERR); } - // Cannot trivially assign because we need to capture intermediates + // Cannot trivially assign because we need to capture intermediates // with safe construction // We must retain things we obtain from the API to avoid releasing // API-owned objects. @@ -2406,8 +2406,8 @@ public: vector* devices) const { typedef CL_API_ENTRY cl_int (CL_API_CALL *PFN_clGetDeviceIDsFromD3D10KHR)( - cl_platform_id platform, - cl_d3d10_device_source_khr d3d_device_source, + cl_platform_id platform, + cl_d3d10_device_source_khr d3d_device_source, void * d3d_object, cl_d3d10_device_set_khr d3d_device_set, cl_uint num_entries, @@ -2423,12 +2423,12 @@ public: cl_uint n = 0; cl_int err = pfn_clGetDeviceIDsFromD3D10KHR( - object_, - d3d_device_source, + object_, + d3d_device_source, d3d_object, - d3d_device_set, - 0, - NULL, + d3d_device_set, + 0, + NULL, &n); if (err != CL_SUCCESS) { return detail::errHandler(err, __GET_DEVICE_IDS_ERR); @@ -2436,18 +2436,18 @@ public: vector ids(n); err = pfn_clGetDeviceIDsFromD3D10KHR( - object_, - d3d_device_source, + object_, + d3d_device_source, d3d_object, d3d_device_set, - n, - ids.data(), + n, + ids.data(), NULL); if (err != CL_SUCCESS) { return detail::errHandler(err, __GET_DEVICE_IDS_ERR); } - // Cannot trivially assign because we need to capture intermediates + // Cannot trivially assign because we need to capture intermediates // with safe construction // We must retain things we obtain from the API to avoid releasing // API-owned objects. @@ -2465,7 +2465,7 @@ public: #endif /*! \brief Gets a list of available platforms. - * + * * Wraps clGetPlatformIDs(). */ static cl_int get( @@ -2500,7 +2500,7 @@ public: } /*! \brief Gets the first available platform. - * + * * Wraps clGetPlatformIDs(), returning the first result. */ static cl_int get( @@ -2531,8 +2531,8 @@ public: *errResult = err; } return default_platform; - } - + } + #if CL_HPP_TARGET_OPENCL_VERSION >= 120 //! \brief Wrapper for clUnloadCompiler(). cl_int @@ -2573,7 +2573,7 @@ UnloadCompiler() * * \see cl_context */ -class Context +class Context : public detail::Wrapper { private: @@ -2627,7 +2627,7 @@ private: static void makeDefaultProvided(const Context &c) { default_ = c; } - + public: #ifdef CL_HPP_UNIT_TEST_ENABLE /*! \brief Reset the default. @@ -2701,7 +2701,7 @@ public: *err = error; } } - + /*! \brief Constructs a context including all or a subset of devices of a specified type. * * Wraps clCreateContextFromType(). @@ -2820,7 +2820,7 @@ public: * * \note All calls to this function return the same cl_context as the first. */ - static Context getDefault(cl_int * err = NULL) + static Context getDefault(cl_int * err = NULL) { std::call_once(default_initialized_, makeDefault); detail::errHandler(default_error_); @@ -2848,15 +2848,15 @@ public: Context() : detail::Wrapper() { } /*! \brief Constructor from cl_context - takes ownership. - * + * * This effectively transfers ownership of a refcount on the cl_context * into the new Context object. */ - explicit Context(const cl_context& context, bool retainObject = false) : + explicit Context(const cl_context& context, bool retainObject = false) : detail::Wrapper(context, retainObject) { } /*! \brief Assignment operator from cl_context - takes ownership. - * + * * This effectively transfers ownership of a refcount on the rhs and calls * clReleaseContext() on the value previously held by this instance. */ @@ -2890,7 +2890,7 @@ public: } /*! \brief Gets a list of supported image formats. - * + * * Wraps clGetSupportedImageFormats(). */ cl_int getSupportedImageFormats( @@ -2899,17 +2899,17 @@ public: vector* formats) const { cl_uint numEntries; - + if (!formats) { return CL_SUCCESS; } cl_int err = ::clGetSupportedImageFormats( - object_, + object_, flags, - type, - 0, - NULL, + type, + 0, + NULL, &numEntries); if (err != CL_SUCCESS) { return detail::errHandler(err, __GET_SUPPORTED_IMAGE_FORMATS_ERR); @@ -2987,14 +2987,14 @@ public: Event() : detail::Wrapper() { } /*! \brief Constructor from cl_event - takes ownership. - * + * * \param retainObject will cause the constructor to retain its cl object. * Defaults to false to maintain compatibility with * earlier versions. * This effectively transfers ownership of a refcount on the cl_event * into the new Event object. */ - explicit Event(const cl_event& event, bool retainObject = false) : + explicit Event(const cl_event& event, bool retainObject = false) : detail::Wrapper(event, retainObject) { } /*! \brief Assignment operator from cl_event - takes ownership. @@ -3055,7 +3055,7 @@ public: } /*! \brief Blocks the calling thread until this event completes. - * + * * Wraps clWaitForEvents(). */ cl_int wait() const @@ -3072,7 +3072,7 @@ public: */ cl_int setCallback( cl_int type, - void (CL_CALLBACK * pfn_notify)(cl_event, cl_int, void *), + void (CL_CALLBACK * pfn_notify)(cl_event, cl_int, void *), void * user_data = NULL) { return detail::errHandler( @@ -3080,13 +3080,13 @@ public: object_, type, pfn_notify, - user_data), + user_data), __SET_EVENT_CALLBACK_ERR); } #endif // CL_HPP_TARGET_OPENCL_VERSION >= 110 /*! \brief Blocks the calling thread until every event specified is complete. - * + * * Wraps clWaitForEvents(). */ static cl_int @@ -3101,7 +3101,7 @@ public: #if CL_HPP_TARGET_OPENCL_VERSION >= 110 /*! \brief Class interface for user events (a subset of cl_event's). - * + * * See Event for details about copy semantics, etc. */ class UserEvent : public Event @@ -3136,14 +3136,14 @@ public: cl_int setStatus(cl_int status) { return detail::errHandler( - ::clSetUserEventStatus(object_,status), + ::clSetUserEventStatus(object_,status), __SET_USER_EVENT_STATUS_ERR); } }; #endif // CL_HPP_TARGET_OPENCL_VERSION >= 110 /*! \brief Blocks the calling thread until every event specified is complete. - * + * * Wraps clWaitForEvents(). */ inline static cl_int @@ -3261,14 +3261,14 @@ public: * value - not the Memory class instance. */ cl_int setDestructorCallback( - void (CL_CALLBACK * pfn_notify)(cl_mem, void *), + void (CL_CALLBACK * pfn_notify)(cl_mem, void *), void * user_data = NULL) { return detail::errHandler( ::clSetMemObjectDestructorCallback( object_, pfn_notify, - user_data), + user_data), __SET_MEM_OBJECT_DESTRUCTOR_CALLBACK_ERR); } #endif // CL_HPP_TARGET_OPENCL_VERSION >= 110 @@ -3451,7 +3451,7 @@ public: * Allocate an SVM pointer. * * If the allocator is coarse-grained, this will take ownership to allow - * containers to correctly construct data in place. + * containers to correctly construct data in place. */ pointer allocate( size_type size, @@ -3501,7 +3501,7 @@ public: for (const Device &d : context_.getInfo()) { maxSize = std::min( - maxSize, + maxSize, static_cast(d.getInfo())); } @@ -3627,7 +3627,7 @@ cl::pointer>> allocate_svm(const cl #endif // #if !defined(CL_HPP_NO_STD_UNIQUE_PTR) /*! \brief Vector alias to simplify contruction of coarse-grained SVM containers. - * + * */ template < class T > using coarse_svm_vector = vector>>; @@ -3648,7 +3648,7 @@ using atomic_svm_vector = vector>> /*! \brief Class interface for Buffer Memory Objects. - * + * * See Memory for details about copy semantics, etc. * * \see Memory @@ -3733,7 +3733,7 @@ public: if( useHostPtr ) { flags |= CL_MEM_USE_HOST_PTR; } - + size_type size = sizeof(DataType)*(endIterator - startIterator); Context context = Context::getDefault(err); @@ -3766,7 +3766,7 @@ public: 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 be random access. @@ -3840,10 +3840,10 @@ public: Buffer result; cl_int error; result.object_ = ::clCreateSubBuffer( - object_, - flags, - buffer_create_type, - buffer_create_info, + object_, + flags, + buffer_create_type, + buffer_create_info, &error); detail::errHandler(error, __CREATE_SUBBUFFER_ERR); @@ -3852,7 +3852,7 @@ public: } return result; - } + } #endif // CL_HPP_TARGET_OPENCL_VERSION >= 110 }; @@ -3860,7 +3860,7 @@ public: /*! \brief Class interface for creating OpenCL buffers from ID3D10Buffer's. * * This is provided to facilitate interoperability with Direct3D. - * + * * See Memory for details about copy semantics, etc. * * \see Memory @@ -3868,7 +3868,7 @@ public: class BufferD3D10 : public Buffer { public: - + /*! \brief Constructs a BufferD3D10, in a specified context, from a * given ID3D10Buffer. @@ -3917,11 +3917,11 @@ public: /*! \brief Constructor from cl_mem - takes ownership. * * \param retainObject will cause the constructor to retain its cl object. - * Defaults to false to maintain compatibility with + * Defaults to false to maintain compatibility with * earlier versions. * See Memory for further details. */ - explicit BufferD3D10(const cl_mem& buffer, bool retainObject = false) : + explicit BufferD3D10(const cl_mem& buffer, bool retainObject = false) : Buffer(buffer, retainObject) { } /*! \brief Assignment from cl_mem - performs shallow copy. @@ -3937,7 +3937,7 @@ public: /*! \brief Copy constructor to forward copy to the superclass correctly. * Required for MSVC. */ - BufferD3D10(const BufferD3D10& buf) : + BufferD3D10(const BufferD3D10& buf) : Buffer(buf) {} /*! \brief Copy assignment to forward copy to the superclass correctly. @@ -3968,9 +3968,9 @@ public: /*! \brief Class interface for GL Buffer Memory Objects. * * This is provided to facilitate interoperability with OpenGL. - * + * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class BufferGL : public Buffer @@ -4065,9 +4065,9 @@ public: /*! \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 @@ -4103,7 +4103,7 @@ public: /*! \brief Constructor from cl_mem - takes ownership. * * \param retainObject will cause the constructor to retain its cl object. - * Defaults to false to maintain compatibility with + * Defaults to false to maintain compatibility with * earlier versions. * See Memory for further details. */ @@ -4162,7 +4162,7 @@ public: /*! \brief C++ base class for Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image : public Memory @@ -4229,7 +4229,7 @@ public: detail::getInfo(&::clGetImageInfo, object_, name, param), __GET_IMAGE_INFO_ERR); } - + //! \brief Wrapper for clGetImageInfo() that returns by value. template typename detail::param_traits::param_type @@ -4249,7 +4249,7 @@ public: /*! \brief Class interface for 1D Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image1D : public Image @@ -4275,11 +4275,11 @@ public: 0, 0, 0, 0, 0, 0, 0, 0 }; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - host_ptr, + context(), + flags, + &format, + &desc, + host_ptr, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -4364,11 +4364,11 @@ public: buffer() }; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - NULL, + context(), + flags, + &format, + &desc, + NULL, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -4452,11 +4452,11 @@ public: 0, 0, 0, 0 }; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - host_ptr, + context(), + flags, + &format, + &desc, + host_ptr, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -4466,7 +4466,7 @@ public: } Image1DArray() { } - + /*! \brief Constructor from cl_mem - takes ownership. * * \param retainObject will cause the constructor to retain its cl object. @@ -4519,7 +4519,7 @@ public: /*! \brief Class interface for 2D Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image2D : public Image @@ -4642,10 +4642,10 @@ public: * \note This will share storage with the underlying image but may * reinterpret the channel order and type. * - * The image will be created matching with a descriptor matching the source. + * The image will be created matching with a descriptor matching the source. * * \param order is the channel order to reinterpret the image data as. - * The channel order may differ as described in the OpenCL + * The channel order may differ as described in the OpenCL * 2.0 API specification. * * Wraps clCreateImage(). @@ -4659,9 +4659,9 @@ public: cl_int error; // Descriptor fields have to match source image - size_type sourceWidth = + size_type sourceWidth = sourceImage.getImageInfo(); - size_type sourceHeight = + size_type sourceHeight = sourceImage.getImageInfo(); size_type sourceRowPitch = sourceImage.getImageInfo(); @@ -4672,7 +4672,7 @@ public: cl_image_format sourceFormat = sourceImage.getImageInfo(); - // Update only the channel order. + // Update only the channel order. // Channel format inherited from source. sourceFormat.image_channel_order = order; cl_image_desc desc = @@ -4761,13 +4761,13 @@ public: /*! \brief Class interface for GL 2D Image Memory objects. * * This is provided to facilitate interoperability with OpenGL. - * + * * See Memory for details about copy semantics, etc. - * + * * \see Memory * \note Deprecated for OpenCL 1.2. Please use ImageGL instead. */ -class CL_EXT_PREFIX__VERSION_1_1_DEPRECATED Image2DGL : public Image2D +class CL_EXT_PREFIX__VERSION_1_1_DEPRECATED Image2DGL : public Image2D { public: /*! \brief Constructs an Image2DGL in a specified context, from a given @@ -4798,7 +4798,7 @@ public: } } - + //! \brief Default constructor - initializes to NULL. Image2DGL() : Image2D() { } @@ -4809,7 +4809,7 @@ public: * earlier versions. * See Memory for further details. */ - explicit Image2DGL(const cl_mem& image, bool retainObject = false) : + explicit Image2DGL(const cl_mem& image, bool retainObject = false) : Image2D(image, retainObject) { } /*! \brief Assignment from cl_mem - performs shallow copy. @@ -4885,11 +4885,11 @@ public: 0, 0, 0 }; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - host_ptr, + context(), + flags, + &format, + &desc, + host_ptr, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -4899,7 +4899,7 @@ public: } Image2DArray() { } - + /*! \brief Constructor from cl_mem - takes ownership. * * \param retainObject will cause the constructor to retain its cl object. @@ -4948,7 +4948,7 @@ public: /*! \brief Class interface for 3D Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image3D : public Image @@ -5000,11 +5000,11 @@ public: 0, 0, 0 }; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - host_ptr, + context(), + flags, + &format, + &desc, + host_ptr, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -5038,7 +5038,7 @@ public: * earlier versions. * See Memory for further details. */ - explicit Image3D(const cl_mem& image3D, bool retainObject = false) : + explicit Image3D(const cl_mem& image3D, bool retainObject = false) : Image(image3D, retainObject) { } /*! \brief Assignment from cl_mem - performs shallow copy. @@ -5084,9 +5084,9 @@ public: /*! \brief Class interface for GL 3D Image Memory objects. * * This is provided to facilitate interoperability with OpenGL. - * + * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image3DGL : public Image3D @@ -5130,7 +5130,7 @@ public: * earlier versions. * See Memory for further details. */ - explicit Image3DGL(const cl_mem& image, bool retainObject = false) : + explicit Image3DGL(const cl_mem& image, bool retainObject = false) : Image3D(image, retainObject) { } /*! \brief Assignment from cl_mem - performs shallow copy. @@ -5193,8 +5193,8 @@ public: { cl_int error; object_ = ::clCreateFromGLTexture( - context(), - flags, + context(), + flags, target, miplevel, texobj, @@ -5207,7 +5207,7 @@ public: } ImageGL() : Image() { } - + /*! \brief Constructor from cl_mem - takes ownership. * * \param retainObject will cause the constructor to retain its cl object. @@ -5215,7 +5215,7 @@ public: * earlier versions. * See Memory for further details. */ - explicit ImageGL(const cl_mem& image, bool retainObject = false) : + explicit ImageGL(const cl_mem& image, bool retainObject = false) : Image(image, retainObject) { } ImageGL& operator = (const cl_mem& rhs) @@ -5402,7 +5402,7 @@ public: * to the same underlying cl_sampler as the original. For details, see * clRetainSampler() and clReleaseSampler(). * - * \see cl_sampler + * \see cl_sampler */ class Sampler : public detail::Wrapper { @@ -5450,18 +5450,18 @@ public: if (err != NULL) { *err = error; } -#endif +#endif } /*! \brief Constructor from cl_sampler - takes ownership. - * + * * \param retainObject will cause the constructor to retain its cl object. * Defaults to false to maintain compatibility with * earlier versions. * This effectively transfers ownership of a refcount on the cl_sampler * into the new Sampler object. */ - explicit Sampler(const cl_sampler& sampler, bool retainObject = false) : + explicit Sampler(const cl_sampler& sampler, bool retainObject = false) : detail::Wrapper(sampler, retainObject) { } /*! \brief Assignment operator from cl_sampler - takes ownership. @@ -5577,17 +5577,17 @@ public: } /*! \brief Conversion operator to const size_type *. - * + * * \returns a pointer to the size of the first dimension. */ - operator const size_type*() const { - return sizes_; + operator const size_type*() const { + return sizes_; } //! \brief Queries the number of dimensions in the range. - size_type dimensions() const - { - return dimensions_; + size_type dimensions() const + { + return dimensions_; } //! \brief Returns the size of the object in bytes based on the @@ -5601,7 +5601,7 @@ public: { return sizes_; } - + const size_type* get() const { return sizes_; @@ -5649,7 +5649,7 @@ struct KernelArgumentHandler static const void* ptr(const LocalSpaceArg&) { return NULL; } }; -} +} //! \endcond /*! Local @@ -5679,14 +5679,14 @@ public: Kernel() { } /*! \brief Constructor from cl_kernel - takes ownership. - * + * * \param retainObject will cause the constructor to retain its cl object. * Defaults to false to maintain compatibility with * earlier versions. * This effectively transfers ownership of a refcount on the cl_kernel * into the new Kernel object. */ - explicit Kernel(const cl_kernel& kernel, bool retainObject = false) : + explicit Kernel(const cl_kernel& kernel, bool retainObject = false) : detail::Wrapper(kernel, retainObject) { } /*! \brief Assignment operator from cl_kernel - takes ownership. @@ -5794,7 +5794,7 @@ public: } return param; } - + #if CL_HPP_TARGET_OPENCL_VERSION >= 200 #if defined(CL_HPP_USE_CL_SUB_GROUPS_KHR) cl_int getSubGroupInfo(const cl::Device &dev, cl_kernel_sub_group_info name, const cl::NDRange &range, size_type* param) const @@ -5878,7 +5878,7 @@ public: #if CL_HPP_TARGET_OPENCL_VERSION >= 200 /*! - * Specify a vector of SVM pointers that the kernel may access in + * Specify a vector of SVM pointers that the kernel may access in * addition to its arguments. */ cl_int setSVMPointers(const vector &pointerList) @@ -5910,7 +5910,7 @@ public: * * \note It is only possible to enable fine-grained system SVM if all devices * in the context associated with kernel support it. - * + * * \param svmEnabled True if fine-grained system SVM is requested. False otherwise. * \return CL_SUCCESS if the function was executed succesfully. CL_INVALID_OPERATION * if no devices in the context support fine-grained system SVM. @@ -5929,7 +5929,7 @@ public: ) ); } - + template void setSVMPointersHelper(std::array &pointerList, const pointer &t0, Ts... ts) { @@ -5944,7 +5944,7 @@ public: pointerList[index] = static_cast(t0); setSVMPointersHelper(ts...); } - + template void setSVMPointersHelper(std::array &pointerList, const pointer &t0) { @@ -5987,7 +5987,7 @@ public: typedef vector > Binaries; typedef vector > Sources; #endif // #if !defined(CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY) - + Program( const string& source, bool build = false, @@ -6055,7 +6055,7 @@ public: #endif // #if !defined(CL_HPP_CL_1_2_DEFAULT_BUILD) NULL, NULL); - + detail::buildErrHandler(error, __BUILD_PROGRAM_ERR, getBuildInfo()); } @@ -6147,7 +6147,7 @@ public: * Set to CL_INVALID_BINARY if the binary provided is not valid for the matching device. * \param err if non-NULL will be set to CL_SUCCESS on successful operation or one of the following errors: * CL_INVALID_CONTEXT if context is not a valid context. - * CL_INVALID_VALUE if the length of devices is zero; or if the length of binaries does not match the length of devices; + * CL_INVALID_VALUE if the length of devices is zero; or if the length of binaries does not match the length of devices; * or if any entry in binaries is NULL or has length 0. * CL_INVALID_DEVICE if OpenCL devices listed in devices are not in the list of devices associated with context. * CL_INVALID_BINARY if an invalid program binary was encountered for any device. binaryStatus will return specific status for each device. @@ -6161,9 +6161,9 @@ public: cl_int* err = NULL) { cl_int error; - + const size_type numDevices = devices.size(); - + // Catch size mismatch early and return if(binaries.size() != numDevices) { error = CL_INVALID_VALUE; @@ -6188,7 +6188,7 @@ public: lengths[i] = binaries[(int)i].second; } #endif // #if !defined(CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY) - + vector deviceIDs(numDevices); for( size_type deviceIndex = 0; deviceIndex < numDevices; ++deviceIndex ) { deviceIDs[deviceIndex] = (devices[deviceIndex])(); @@ -6197,7 +6197,7 @@ public: if(binaryStatus) { binaryStatus->resize(numDevices); } - + object_ = ::clCreateProgramWithBinary( context(), (cl_uint) devices.size(), deviceIDs.data(), @@ -6211,7 +6211,7 @@ public: } } - + #if CL_HPP_TARGET_OPENCL_VERSION >= 120 /** * Create program using builtin kernels. @@ -6231,12 +6231,12 @@ public: for( size_type deviceIndex = 0; deviceIndex < numDevices; ++deviceIndex ) { deviceIDs[deviceIndex] = (devices[deviceIndex])(); } - + object_ = ::clCreateProgramWithBuiltInKernels( - context(), + context(), (cl_uint) devices.size(), deviceIDs.data(), - kernelNames.c_str(), + kernelNames.c_str(), &error); detail::errHandler(error, __CREATE_PROGRAM_WITH_BUILT_IN_KERNELS_ERR); @@ -6247,7 +6247,7 @@ public: #endif // CL_HPP_TARGET_OPENCL_VERSION >= 120 Program() { } - + /*! \brief Constructor from cl_mem - takes ownership. * @@ -6255,7 +6255,7 @@ public: * Defaults to false to maintain compatibility with * earlier versions. */ - explicit Program(const cl_program& program, bool retainObject = false) : + explicit Program(const cl_program& program, bool retainObject = false) : detail::Wrapper(program, retainObject) { } Program& operator = (const cl_program& rhs) @@ -6300,7 +6300,7 @@ public: { size_type numDevices = devices.size(); vector deviceIDs(numDevices); - + for( size_type deviceIndex = 0; deviceIndex < numDevices; ++deviceIndex ) { deviceIDs[deviceIndex] = (devices[deviceIndex])(); } @@ -6397,9 +6397,9 @@ public: } return param; } - + /** - * Build info function that returns a vector of device/info pairs for the specified + * Build info function that returns a vector of device/info pairs for the specified * info type and for all devices in the program. * On an error reading the info for any device, an empty vector of info will be returned. */ @@ -6451,7 +6451,7 @@ public: } vector value(numKernels); - + err = ::clCreateKernelsInProgram( object_, numKernels, value.data(), NULL); if (err != CL_SUCCESS) { @@ -6464,7 +6464,7 @@ public: // Assign to param, constructing with retain behaviour // to correctly capture each underlying CL object for (size_type i = 0; i < value.size(); i++) { - // We do not need to retain because this kernel is being created + // We do not need to retain because this kernel is being created // by the runtime (*kernels)[i] = Kernel(value[i], false); } @@ -6480,7 +6480,7 @@ inline Program linkProgram( const char* options = NULL, void (CL_CALLBACK * notifyFptr)(cl_program, void *) = NULL, void* data = NULL, - cl_int* err = NULL) + cl_int* err = NULL) { cl_int error_local = CL_SUCCESS; @@ -6515,7 +6515,7 @@ inline Program linkProgram( const char* options = NULL, void (CL_CALLBACK * notifyFptr)(cl_program, void *) = NULL, void* data = NULL, - cl_int* err = NULL) + cl_int* err = NULL) { cl_int error_local = CL_SUCCESS; @@ -6524,7 +6524,7 @@ inline Program linkProgram( for (unsigned int i = 0; i < inputPrograms.size(); i++) { programs[i] = inputPrograms[i](); } - + Context ctx; if(inputPrograms.size() > 0) { ctx = inputPrograms[0].getInfo(&error_local); @@ -6680,7 +6680,7 @@ public: default_ = CommandQueue(); } #endif // #ifdef CL_HPP_UNIT_TEST_ENABLE - + /*! * \brief Constructs a CommandQueue based on passed properties. @@ -6853,7 +6853,7 @@ public: CL_QUEUE_PROPERTIES, static_cast(properties), 0 }; object_ = ::clCreateCommandQueueWithProperties( context(), devices[0](), queue_properties, &error); - + detail::errHandler(error, __CREATE_COMMAND_QUEUE_WITH_PROPERTIES_ERR); if (err != NULL) { *err = error; @@ -6887,7 +6887,7 @@ public: CL_QUEUE_PROPERTIES, properties, 0 }; object_ = ::clCreateCommandQueueWithProperties( context(), device(), queue_properties, &error); - + detail::errHandler(error, __CREATE_COMMAND_QUEUE_WITH_PROPERTIES_ERR); if (err != NULL) { *err = error; @@ -6920,7 +6920,7 @@ public: CL_QUEUE_PROPERTIES, static_cast(properties), 0 }; object_ = ::clCreateCommandQueueWithProperties( context(), device(), queue_properties, &error); - + detail::errHandler(error, __CREATE_COMMAND_QUEUE_WITH_PROPERTIES_ERR); if (err != NULL) { *err = error; @@ -6936,7 +6936,7 @@ public: #endif } - static CommandQueue getDefault(cl_int * err = NULL) + static CommandQueue getDefault(cl_int * err = NULL) { std::call_once(default_initialized_, makeDefault); #if CL_HPP_TARGET_OPENCL_VERSION >= 200 @@ -6973,7 +6973,7 @@ public: * Defaults to false to maintain compatibility with * earlier versions. */ - explicit CommandQueue(const cl_command_queue& commandQueue, bool retainObject = false) : + explicit CommandQueue(const cl_command_queue& commandQueue, bool retainObject = false) : detail::Wrapper(commandQueue, retainObject) { } CommandQueue& operator = (const cl_command_queue& rhs) @@ -7123,8 +7123,8 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueReadBufferRect( - object_, - buffer(), + object_, + buffer(), blocking, buffer_offset.data(), host_offset.data(), @@ -7162,8 +7162,8 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueWriteBufferRect( - object_, - buffer(), + object_, + buffer(), blocking, buffer_offset.data(), host_offset.data(), @@ -7200,9 +7200,9 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueCopyBufferRect( - object_, - src(), - dst(), + object_, + src(), + dst(), src_origin.data(), dst_origin.data(), region.data(), @@ -7225,10 +7225,10 @@ public: /** * Enqueue a command to fill a buffer object with a pattern * of a given size. The pattern is specified as a vector type. - * \tparam PatternType The datatype of the pattern field. + * \tparam PatternType The datatype of the pattern field. * The pattern type must be an accepted OpenCL data type. - * \tparam offset Is the offset in bytes into the buffer at - * which to start filling. This must be a multiple of + * \tparam offset Is the offset in bytes into the buffer at + * which to start filling. This must be a multiple of * the pattern size. * \tparam size Is the size in bytes of the region to fill. * This must be a multiple of the pattern size. @@ -7245,11 +7245,11 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueFillBuffer( - object_, + object_, buffer(), static_cast(&pattern), - sizeof(PatternType), - offset, + sizeof(PatternType), + offset, size, (events != NULL) ? (cl_uint) events->size() : 0, (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL, @@ -7277,13 +7277,13 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueReadImage( - object_, - image(), - blocking, + object_, + image(), + blocking, origin.data(), - region.data(), - row_pitch, - slice_pitch, + region.data(), + row_pitch, + slice_pitch, ptr, (events != NULL) ? (cl_uint) events->size() : 0, (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL, @@ -7310,13 +7310,13 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueWriteImage( - object_, - image(), - blocking, + object_, + image(), + blocking, origin.data(), - region.data(), - row_pitch, - slice_pitch, + region.data(), + row_pitch, + slice_pitch, ptr, (events != NULL) ? (cl_uint) events->size() : 0, (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL, @@ -7341,11 +7341,11 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueCopyImage( - object_, - src(), - dst(), + object_, + src(), + dst(), src_origin.data(), - dst_origin.data(), + dst_origin.data(), region.data(), (events != NULL) ? (cl_uint) events->size() : 0, (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL, @@ -7377,9 +7377,9 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueFillImage( - object_, + object_, image(), - static_cast(&fillColor), + static_cast(&fillColor), origin.data(), region.data(), (events != NULL) ? (cl_uint) events->size() : 0, @@ -7411,9 +7411,9 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueFillImage( - object_, + object_, image(), - static_cast(&fillColor), + static_cast(&fillColor), origin.data(), region.data(), (events != NULL) ? (cl_uint) events->size() : 0, @@ -7445,9 +7445,9 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueFillImage( - object_, + object_, image(), - static_cast(&fillColor), + static_cast(&fillColor), origin.data(), region.data(), (events != NULL) ? (cl_uint) events->size() : 0, @@ -7474,11 +7474,11 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueCopyImageToBuffer( - object_, - src(), - dst(), + object_, + src(), + dst(), src_origin.data(), - region.data(), + region.data(), dst_offset, (events != NULL) ? (cl_uint) events->size() : 0, (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL, @@ -7503,11 +7503,11 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueCopyBufferToImage( - object_, - src(), - dst(), + object_, + src(), + dst(), src_offset, - dst_origin.data(), + dst_origin.data(), region.data(), (events != NULL) ? (cl_uint) events->size() : 0, (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL, @@ -7565,7 +7565,7 @@ public: cl_int error; void * result = ::clEnqueueMapImage( object_, buffer(), blocking, flags, - origin.data(), + origin.data(), region.data(), row_pitch, slice_pitch, (events != NULL) ? (cl_uint) events->size() : 0, @@ -7766,14 +7766,14 @@ public: #if CL_HPP_TARGET_OPENCL_VERSION >= 120 /** - * Enqueues a marker command which waits for either a list of events to complete, + * Enqueues a marker command which waits for either a list of events to complete, * or all previously enqueued commands to complete. * - * Enqueues a marker command which waits for either a list of events to complete, - * or if the list is empty it waits for all commands previously enqueued in command_queue - * to complete before it completes. This command returns an event which can be waited on, - * i.e. this event can be waited on to insure that all events either in the event_wait_list - * or all previously enqueued commands, queued before this command to command_queue, + * Enqueues a marker command which waits for either a list of events to complete, + * or if the list is empty it waits for all commands previously enqueued in command_queue + * to complete before it completes. This command returns an event which can be waited on, + * i.e. this event can be waited on to insure that all events either in the event_wait_list + * or all previously enqueued commands, queued before this command to command_queue, * have completed. */ cl_int enqueueMarkerWithWaitList( @@ -7798,12 +7798,12 @@ public: /** * A synchronization point that enqueues a barrier operation. * - * Enqueues a barrier command which waits for either a list of events to complete, - * or if the list is empty it waits for all commands previously enqueued in command_queue - * to complete before it completes. This command blocks command execution, that is, any - * following commands enqueued after it do not execute until it completes. This command - * returns an event which can be waited on, i.e. this event can be waited on to insure that - * all events either in the event_wait_list or all previously enqueued commands, queued + * Enqueues a barrier command which waits for either a list of events to complete, + * or if the list is empty it waits for all commands previously enqueued in command_queue + * to complete before it completes. This command blocks command execution, that is, any + * following commands enqueued after it do not execute until it completes. This command + * returns an event which can be waited on, i.e. this event can be waited on to insure that + * all events either in the event_wait_list or all previously enqueued commands, queued * before this command to command_queue, have completed. */ cl_int enqueueBarrierWithWaitList( @@ -7824,7 +7824,7 @@ public: return err; } - + /** * Enqueues a command to indicate with which device a set of memory objects * should be associated. @@ -7837,7 +7837,7 @@ public: ) const { cl_event tmp; - + vector localMemObjects(memObjects.size()); for( int i = 0; i < (int)memObjects.size(); ++i ) { @@ -7847,8 +7847,8 @@ public: cl_int err = detail::errHandler( ::clEnqueueMigrateMemObjects( - object_, - (cl_uint)memObjects.size(), + object_, + (cl_uint)memObjects.size(), localMemObjects.data(), flags, (events != NULL) ? (cl_uint) events->size() : 0, @@ -7927,7 +7927,7 @@ public: for (unsigned int i = 0; i < elements; i++) { mems[i] = ((*mem_objects)[i])(); } - + cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueNativeKernel( @@ -7950,13 +7950,13 @@ public: * Deprecated APIs for 1.2 */ #if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) - CL_EXT_PREFIX__VERSION_1_1_DEPRECATED + CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int enqueueMarker(Event* event = NULL) const CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED { cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueMarker( - object_, + object_, (event != NULL) ? &tmp : NULL), __ENQUEUE_MARKER_ERR); @@ -8047,7 +8047,7 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *PFN_clEnqueueReleaseD3D10ObjectsKHR)( #if CL_HPP_TARGET_OPENCL_VERSION >= 110 CL_HPP_INIT_CL_EXT_FCN_PTR_(clEnqueueAcquireD3D10ObjectsKHR); #endif - + cl_event tmp; cl_int err = detail::errHandler( pfn_clEnqueueAcquireD3D10ObjectsKHR( @@ -8215,7 +8215,7 @@ public: CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_ON_DEVICE | static_cast(properties); cl_queue_properties queue_properties[] = { CL_QUEUE_PROPERTIES, mergedProperties, - CL_QUEUE_SIZE, queueSize, + CL_QUEUE_SIZE, queueSize, 0 }; object_ = ::clCreateCommandQueueWithProperties( context(), device(), queue_properties, &error); @@ -8350,7 +8350,7 @@ public: } /*! - * Create a new default device command queue for the specified device + * Create a new default device command queue for the specified device * and of the requested size in bytes. * If there is already a default queue for the specified device this * function will return the pre-existing queue. @@ -8415,7 +8415,7 @@ Buffer::Buffer( if( useHostPtr ) { flags |= CL_MEM_USE_HOST_PTR; } - + size_type size = sizeof(DataType)*(endIterator - startIterator); if( useHostPtr ) { @@ -8588,7 +8588,7 @@ inline cl_int enqueueMapSVM( } /** - * Enqueues to the default queue a command that will allow the host to + * Enqueues to the default queue a command that will allow the host to * update a region of a coarse-grained SVM buffer. * This variant takes a cl::pointer instance. */ @@ -8666,7 +8666,7 @@ inline cl_int enqueueUnmapMemObject( #if CL_HPP_TARGET_OPENCL_VERSION >= 200 /** - * Enqueues to the default queue a command that will release a coarse-grained + * Enqueues to the default queue a command that will release a coarse-grained * SVM buffer back to the OpenCL runtime. * This variant takes a raw SVM pointer. */ @@ -8682,13 +8682,13 @@ inline cl_int enqueueUnmapSVM( return detail::errHandler(error, __ENQUEUE_UNMAP_MEM_OBJECT_ERR); } - return detail::errHandler(queue.enqueueUnmapSVM(ptr, events, event), + return detail::errHandler(queue.enqueueUnmapSVM(ptr, events, event), __ENQUEUE_UNMAP_MEM_OBJECT_ERR); } /** - * Enqueues to the default queue a command that will release a coarse-grained + * Enqueues to the default queue a command that will release a coarse-grained * SVM buffer back to the OpenCL runtime. * This variant takes a cl::pointer instance. */ @@ -8709,7 +8709,7 @@ inline cl_int enqueueUnmapSVM( } /** - * Enqueues to the default queue a command that will release a coarse-grained + * Enqueues to the default queue a command that will release a coarse-grained * SVM buffer back to the OpenCL runtime. * This variant takes a cl::vector instance. */ @@ -8792,11 +8792,11 @@ inline cl_int copy( const CommandQueue &queue, IteratorType startIterator, Itera { typedef typename std::iterator_traits::value_type DataType; cl_int error; - + size_type length = endIterator-startIterator; size_type byteLength = length*sizeof(DataType); - DataType *pointer = + DataType *pointer = 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 ) { @@ -8804,8 +8804,8 @@ inline cl_int copy( const CommandQueue &queue, IteratorType startIterator, Itera } #if defined(_MSC_VER) std::copy( - startIterator, - endIterator, + startIterator, + endIterator, stdext::checked_array_iterator( pointer, length)); #else @@ -8814,7 +8814,7 @@ inline cl_int copy( const CommandQueue &queue, IteratorType startIterator, Itera Event endEvent; error = queue.enqueueUnmapMemObject(buffer, pointer, 0, &endEvent); // if exceptions enabled, enqueueUnmapMemObject will throw - if( error != CL_SUCCESS ) { + if( error != CL_SUCCESS ) { return error; } endEvent.wait(); @@ -8831,11 +8831,11 @@ inline cl_int copy( const CommandQueue &queue, const cl::Buffer &buffer, Iterato { typedef typename std::iterator_traits::value_type DataType; cl_int error; - + size_type length = endIterator-startIterator; size_type byteLength = length*sizeof(DataType); - DataType *pointer = + DataType *pointer = 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 ) { @@ -8845,7 +8845,7 @@ inline cl_int copy( const CommandQueue &queue, const cl::Buffer &buffer, Iterato Event endEvent; error = queue.enqueueUnmapMemObject(buffer, pointer, 0, &endEvent); // if exceptions enabled, enqueueUnmapMemObject will throw - if( error != CL_SUCCESS ) { + if( error != CL_SUCCESS ) { return error; } endEvent.wait(); @@ -8897,17 +8897,17 @@ inline cl_int enqueueReadBufferRect( } return queue.enqueueReadBufferRect( - buffer, - blocking, - buffer_offset, + buffer, + blocking, + buffer_offset, host_offset, region, buffer_row_pitch, buffer_slice_pitch, host_row_pitch, host_slice_pitch, - ptr, - events, + ptr, + events, event); } @@ -8933,17 +8933,17 @@ inline cl_int enqueueWriteBufferRect( } return queue.enqueueWriteBufferRect( - buffer, - blocking, - buffer_offset, + buffer, + blocking, + buffer_offset, host_offset, region, buffer_row_pitch, buffer_slice_pitch, host_row_pitch, host_slice_pitch, - ptr, - events, + ptr, + events, event); } @@ -8977,7 +8977,7 @@ inline cl_int enqueueCopyBufferRect( src_slice_pitch, dst_row_pitch, dst_slice_pitch, - events, + events, event); } #endif // CL_HPP_TARGET_OPENCL_VERSION >= 110 @@ -8991,7 +8991,7 @@ inline cl_int enqueueReadImage( size_type slice_pitch, void* ptr, const vector* events = NULL, - Event* event = NULL) + Event* event = NULL) { cl_int error; CommandQueue queue = CommandQueue::getDefault(&error); @@ -9008,7 +9008,7 @@ inline cl_int enqueueReadImage( row_pitch, slice_pitch, ptr, - events, + events, event); } @@ -9038,7 +9038,7 @@ inline cl_int enqueueWriteImage( row_pitch, slice_pitch, ptr, - events, + events, event); } @@ -9140,7 +9140,7 @@ inline cl_int finish(void) if (error != CL_SUCCESS) { return error; - } + } return queue.finish(); @@ -9159,63 +9159,63 @@ private: friend class KernelFunctor; public: - EnqueueArgs(NDRange global) : + EnqueueArgs(NDRange global) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange) { } - EnqueueArgs(NDRange global, NDRange local) : + EnqueueArgs(NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local) { } - EnqueueArgs(NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(NDRange offset, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(offset), + offset_(offset), global_(global), local_(local) { } - EnqueueArgs(Event e, NDRange global) : + EnqueueArgs(Event e, NDRange global) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange) { events_.push_back(e); } - EnqueueArgs(Event e, NDRange global, NDRange local) : + EnqueueArgs(Event e, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local) { events_.push_back(e); } - EnqueueArgs(Event e, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(Event e, NDRange offset, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(offset), + offset_(offset), global_(global), local_(local) { events_.push_back(e); } - EnqueueArgs(const vector &events, NDRange global) : + EnqueueArgs(const vector &events, NDRange global) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange), events_(events) @@ -9223,9 +9223,9 @@ public: } - EnqueueArgs(const vector &events, NDRange global, NDRange local) : + EnqueueArgs(const vector &events, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local), events_(events) @@ -9233,9 +9233,9 @@ public: } - EnqueueArgs(const vector &events, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(const vector &events, NDRange offset, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(offset), + offset_(offset), global_(global), local_(local), events_(events) @@ -9243,63 +9243,63 @@ public: } - EnqueueArgs(CommandQueue &queue, NDRange global) : + EnqueueArgs(CommandQueue &queue, NDRange global) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange) { } - EnqueueArgs(CommandQueue &queue, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, NDRange global, NDRange local) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local) { } - EnqueueArgs(CommandQueue &queue, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, NDRange offset, NDRange global, NDRange local) : queue_(queue), - offset_(offset), + offset_(offset), global_(global), local_(local) { } - EnqueueArgs(CommandQueue &queue, Event e, NDRange global) : + EnqueueArgs(CommandQueue &queue, Event e, NDRange global) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange) { events_.push_back(e); } - EnqueueArgs(CommandQueue &queue, Event e, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, Event e, NDRange global, NDRange local) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local) { events_.push_back(e); } - EnqueueArgs(CommandQueue &queue, Event e, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, Event e, NDRange offset, NDRange global, NDRange local) : queue_(queue), - offset_(offset), + offset_(offset), global_(global), local_(local) { events_.push_back(e); } - EnqueueArgs(CommandQueue &queue, const vector &events, NDRange global) : + EnqueueArgs(CommandQueue &queue, const vector &events, NDRange global) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange), events_(events) @@ -9307,9 +9307,9 @@ public: } - EnqueueArgs(CommandQueue &queue, const vector &events, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, const vector &events, NDRange global, NDRange local) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local), events_(events) @@ -9317,9 +9317,9 @@ public: } - EnqueueArgs(CommandQueue &queue, const vector &events, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, const vector &events, NDRange offset, NDRange global, NDRange local) : queue_(queue), - offset_(offset), + offset_(offset), global_(global), local_(local), events_(events) @@ -9334,7 +9334,7 @@ public: /** * Type safe kernel functor. - * + * */ template class KernelFunctor @@ -9386,7 +9386,7 @@ public: { Event event; setArgs<0>(std::forward(ts)...); - + args.queue_.enqueueNDRangeKernel( kernel_, args.offset_, @@ -9419,7 +9419,7 @@ public: args.local_, &args.events_, &event); - + return event; } diff --git a/projects/clr/opencl/khronos/headers/opencl2.2/CL/cl.hpp b/projects/clr/opencl/khronos/headers/opencl2.2/CL/cl.hpp index 0ffc16b51d..5cfd7fb184 100644 --- a/projects/clr/opencl/khronos/headers/opencl2.2/CL/cl.hpp +++ b/projects/clr/opencl/khronos/headers/opencl2.2/CL/cl.hpp @@ -28,16 +28,16 @@ /*! \file * - * \brief C++ bindings for OpenCL 1.0 (rev 48), OpenCL 1.1 (rev 33) and - * OpenCL 1.2 (rev 15) + * \brief C++ bindings for OpenCL 1.0 (rev 48), OpenCL 1.1 (rev 33) and + * OpenCL 1.2 (rev 15) * \author Benedict R. Gaster, Laurent Morichetti and Lee Howes - * + * * Additions and fixes from: - * Brian Cole, March 3rd 2010 and April 2012 + * 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.9 * \date December 2015 * @@ -77,7 +77,7 @@ * * \code * #define __CL_ENABLE_EXCEPTIONS - * + * * #if defined(__APPLE__) || defined(__MACOSX) * #include * #else @@ -86,13 +86,13 @@ * #include * #include * #include - * + * * const char * helloStr = "__kernel void " * "hello(void) " * "{ " * " " * "} "; - * + * * int * main(void) * { @@ -106,33 +106,33 @@ * return -1; * } * - * cl_context_properties properties[] = + * cl_context_properties properties[] = * { CL_CONTEXT_PLATFORM, (cl_context_properties)(platforms[0])(), 0}; - * cl::Context context(CL_DEVICE_TYPE_CPU, properties); - * + * cl::Context context(CL_DEVICE_TYPE_CPU, properties); + * * std::vector devices = context.getInfo(); - * + * * cl::Program::Sources source(1, * std::make_pair(helloStr,strlen(helloStr))); * cl::Program program_ = cl::Program(context, source); * program_.build(devices); - * + * * cl::Kernel kernel(program_, "hello", &err); - * + * * cl::Event event; * cl::CommandQueue queue(context, devices[0], 0, &err); * queue.enqueueNDRangeKernel( - * kernel, - * cl::NullRange, + * kernel, + * cl::NullRange, * cl::NDRange(4,4), * cl::NullRange, * NULL, - * &event); - * + * &event); + * * event.wait(); * } * catch (cl::Error err) { - * std::cerr + * std::cerr * << "ERROR: " * << err.what() * << "(" @@ -140,10 +140,10 @@ * << ")" * << std::endl; * } - * + * * return EXIT_SUCCESS; * } - * + * * \endcode * */ @@ -164,7 +164,7 @@ #include #endif // _MSC_VER -// +// #if defined(USE_CL_DEVICE_FISSION) #include #endif @@ -194,13 +194,13 @@ #if defined(CL_VERSION_1_2) && !defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) #define __CL_EXPLICIT_CONSTRUCTORS explicit #else // #if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) -#define __CL_EXPLICIT_CONSTRUCTORS +#define __CL_EXPLICIT_CONSTRUCTORS #endif // #if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) // Define deprecated prefixes and suffixes to ensure compilation // in case they are not pre-defined #if !defined(CL_EXT_PREFIX__VERSION_1_1_DEPRECATED) -#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED +#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED #endif // #if !defined(CL_EXT_PREFIX__VERSION_1_1_DEPRECATED) #if !defined(CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED) #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED @@ -224,7 +224,7 @@ #if !defined(__NO_STD_STRING) #include -#endif +#endif #if defined(__ANDROID__) || defined(linux) || defined(__APPLE__) || defined(__MACOSX) #include @@ -245,7 +245,7 @@ class Memory; /** * Deprecated APIs for 1.2 */ -#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) || (defined(CL_VERSION_1_1) && !defined(CL_VERSION_1_2)) +#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) || (defined(CL_VERSION_1_1) && !defined(CL_VERSION_1_2)) #define __INIT_CL_EXT_FCN_PTR(name) \ if(!pfn_##name) { \ pfn_##name = (PFN_##name) \ @@ -273,8 +273,8 @@ class Memory; class Buffer; #if defined(__CL_ENABLE_EXCEPTIONS) -/*! \brief Exception class - * +/*! \brief Exception class + * * This may be thrown by API functions when __CL_ENABLE_EXCEPTIONS is defined. */ class Error : public std::exception @@ -285,7 +285,7 @@ private: public: /*! \brief Create a new CL error exception for a given error code * and corresponding message. - * + * * \param err error code value. * * \param errStr a descriptive string that must remain in scope until @@ -452,7 +452,7 @@ static inline cl_int errHandler (cl_int err, const char * errStr = NULL) /** * Deprecated APIs for 1.2 */ -#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) || (defined(CL_VERSION_1_1) && !defined(CL_VERSION_1_2)) +#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) || (defined(CL_VERSION_1_1) && !defined(CL_VERSION_1_2)) #define __ENQUEUE_MARKER_ERR __ERR_STR(clEnqueueMarker) #define __ENQUEUE_WAIT_FOR_EVENTS_ERR __ERR_STR(clEnqueueWaitForEvents) #define __ENQUEUE_BARRIER_ERR __ERR_STR(clEnqueueBarrier) @@ -476,12 +476,12 @@ static inline cl_int errHandler (cl_int err, const char * errStr = NULL) #if !defined(__USE_DEV_STRING) && !defined(__NO_STD_STRING) typedef std::string STRING_CLASS; -#elif !defined(__USE_DEV_STRING) +#elif !defined(__USE_DEV_STRING) /*! \class string * \brief Simple string class, that provides a limited subset of std::string * functionality but avoids many of the issues that come with that class. - + * \note Deprecated. Please use std::string as default or * re-define the string class to match the std::string * interface by defining STRING_CLASS @@ -499,10 +499,10 @@ public: /*! \brief Constructs a string populated from an arbitrary value of * specified size. - * + * * An extra '\0' is added, in case none was contained in str. * - * \param str the initial value of the string instance. Note that '\0' + * \param str the initial value of the string instance. Note that '\0' * characters receive no special treatment. If NULL, * the string is left empty, with a size of 0. * @@ -555,7 +555,7 @@ public: } str_ = NULL; size_ = 0; - } + } else { char *newString = new char[n + 1]; ::size_t copySize = n; @@ -563,7 +563,7 @@ public: copySize = size_; } size_ = n; - + if(str_) { memcpy(newString, str_, (copySize + 1) * sizeof(char)); } @@ -608,11 +608,11 @@ public: if (rhs.size_ == 0 || rhs.str_ == NULL) { str_ = NULL; size_ = 0; - } + } else { str_ = new char[rhs.size_ + 1]; size_ = rhs.size_; - + if (str_ != NULL) { memcpy(str_, rhs.str_, (size_ + 1) * sizeof(char)); } @@ -641,7 +641,7 @@ public: delete[] str_; str_ = NULL; } - + //! \brief Queries the length of the string, excluding any added '\0's. ::size_t size(void) const { return size_; } @@ -654,19 +654,19 @@ public: 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) +#endif // #elif !defined(__USE_DEV_STRING) #if !defined(__USE_DEV_VECTOR) && !defined(__NO_STD_VECTOR) #define VECTOR_CLASS std::vector -#elif !defined(__USE_DEV_VECTOR) -#define VECTOR_CLASS cl::vector +#elif !defined(__USE_DEV_VECTOR) +#define VECTOR_CLASS cl::vector #if !defined(__MAX_DEFAULT_VECTOR_SIZE) #define __MAX_DEFAULT_VECTOR_SIZE 10 #endif /*! \class vector - * \brief Fixed sized vector implementation that mirroring + * \brief Fixed sized vector implementation that mirroring * * \note Deprecated. Please use std::vector as default or * re-define the vector class to match the std::vector @@ -696,12 +696,12 @@ private: public: //! \brief Constructs an empty vector with no memory allocated. - vector() : + vector() : size_(static_cast(0)) {} //! \brief Deallocates the vector's memory and destroys all of its elements. - ~vector() + ~vector() { clear(); } @@ -711,7 +711,7 @@ public: { return size_; } - + /*! \brief Empties the vector of all elements. * \note * This does not deallocate memory but will invoke destructors @@ -725,11 +725,11 @@ public: } /*! \brief Appends an element after the last valid element. - * Calling this on a vector that has reached capacity will throw an + * Calling this on a vector that has reached capacity will throw an * exception if exceptions are enabled. */ void push_back (const T& x) - { + { if (size() < N) { new (&data_[size_]) T(x); size_++; @@ -756,13 +756,13 @@ public: * * \param vec the vector to copy. */ - vector(const vector& vec) : + vector(const vector& vec) : size_(vec.size_) { if (size_ != 0) { assign(vec.begin(), vec.end()); } - } + } /*! \brief Constructs with a specified number of initial elements. * @@ -791,7 +791,7 @@ public: return *this; } - if (rhs.size_ != 0) { + if (rhs.size_ != 0) { assign(rhs.begin(), rhs.end()); } else { clear(); @@ -817,19 +817,19 @@ public: } return true; } - + //! \brief Conversion operator to T*. operator T* () { return data_; } //! \brief Conversion operator to const T*. operator const T* () const { return data_; } - + //! \brief Tests whether this instance has any elements. bool empty (void) const { return size_==0; } - + //! \brief Returns the maximum number of elements this instance can hold. unsigned int max_size (void) const { @@ -874,7 +874,7 @@ public: { return data_[index]; } - + /*! \brief Returns a const reference to a given element. * * \param index which element to access. @@ -886,7 +886,7 @@ public: { return data_[index]; } - + /*! \brief Assigns elements of the vector based on a source iterator range. * * \param start Beginning iterator of source range @@ -898,7 +898,7 @@ public: template void assign(I start, I end) { - clear(); + clear(); while(start != end) { push_back(*start); start++; @@ -916,12 +916,12 @@ public: /** * Internal iterator constructor to capture reference - * to the vector it iterates over rather than taking + * to the vector it iterates over rather than taking * the vector by copy. */ iterator (const vector &vec, int index) : vec_(&vec) - { + { if( !vec.empty() ) { index_ = index; } else { @@ -930,7 +930,7 @@ public: } public: - iterator(void) : + iterator(void) : index_(-1), vec_(NULL) { @@ -957,10 +957,10 @@ public: return i; } - + bool operator==(iterator i) { - return ((vec_ == i.vec_) && + return ((vec_ == i.vec_) && (index_ == i.index_)); } @@ -1048,7 +1048,7 @@ public: namespace detail { -#define __DEFAULT_NOT_INITIALIZED 1 +#define __DEFAULT_NOT_INITIALIZED 1 #define __DEFAULT_BEING_INITIALIZED 2 #define __DEFAULT_INITIALIZED 4 @@ -1089,14 +1089,14 @@ namespace detail { } } // namespace detail - + /*! \brief class used to interface between C++ and * OpenCL C calls that require arrays of size_t values, whose * size is known statically. */ template class size_t -{ +{ private: ::size_t data_[N]; @@ -1226,7 +1226,7 @@ inline cl_int getInfoHelper(Func f, cl_uint name, STRING_CLASS* param, long) *param = value; return CL_SUCCESS; -#else +#else ::size_t required; cl_int err = f(name, 0, NULL, &required); if (err != CL_SUCCESS) { @@ -1443,7 +1443,7 @@ inline cl_int getInfoHelper(Func f, cl_uint name, T* param, int, typename T::cl_ F(cl_event_info, CL_EVENT_CONTEXT, cl::Context) #endif // CL_VERSION_1_1 - + #if defined(CL_VERSION_1_2) #define __PARAM_NAME_INFO_1_2(F) \ F(cl_image_info, CL_IMAGE_BUFFER, cl::Buffer) \ @@ -1630,7 +1630,7 @@ struct ReferenceHandler /** * Retain the device. * \param device A valid device created using createSubDevices - * \return + * \return * CL_SUCCESS if the function executed successfully. * CL_INVALID_DEVICE if device was not a valid subdevice * CL_OUT_OF_RESOURCES @@ -1641,7 +1641,7 @@ struct ReferenceHandler /** * Retain the device. * \param device A valid device created using createSubDevices - * \return + * \return * CL_SUCCESS if the function executed successfully. * CL_INVALID_DEVICE if device was not a valid subdevice * CL_OUT_OF_RESOURCES @@ -1896,24 +1896,24 @@ protected: } public: - Wrapper() : object_(NULL), referenceCountable_(false) - { - } - - Wrapper(const cl_type &obj) : object_(obj), referenceCountable_(false) + Wrapper() : object_(NULL), referenceCountable_(false) { - referenceCountable_ = isReferenceCountable(obj); + } + + Wrapper(const cl_type &obj) : object_(obj), referenceCountable_(false) + { + referenceCountable_ = isReferenceCountable(obj); } ~Wrapper() { if (object_ != NULL) { release(); } } - + Wrapper(const Wrapper& rhs) { object_ = rhs.object_; - referenceCountable_ = isReferenceCountable(object_); + referenceCountable_ = isReferenceCountable(object_); if (object_ != NULL) { detail::errHandler(retain(), __RETAIN_ERR); } } @@ -1956,7 +1956,7 @@ public: { if (object_ != NULL) { detail::errHandler(release(), __RELEASE_ERR); } object_ = rhs; - referenceCountable_ = isReferenceCountable(object_); + referenceCountable_ = isReferenceCountable(object_); return *this; } @@ -2037,7 +2037,7 @@ public: Device() : detail::Wrapper() { } /*! \brief Constructor from cl_device_id. - * + * * This simply copies the device ID value, which is an inexpensive operation. */ __CL_EXPLICIT_CONSTRUCTORS Device(const cl_device_id &device) : detail::Wrapper(device) { } @@ -2049,7 +2049,7 @@ public: static Device getDefault(cl_int * err = NULL); /*! \brief Assignment operator from cl_device_id. - * + * * This simply copies the device ID value, which is an inexpensive operation. */ Device& operator = (const cl_device_id& rhs) @@ -2146,7 +2146,7 @@ public: const cl_device_partition_property_ext * properties, VECTOR_CLASS* devices) { - typedef CL_API_ENTRY cl_int + typedef CL_API_ENTRY cl_int ( CL_API_CALL * PFN_clCreateSubDevicesEXT)( cl_device_id /*in_device*/, const cl_device_partition_property_ext * /* properties */, @@ -2190,13 +2190,13 @@ public: Platform() : detail::Wrapper() { } /*! \brief Constructor from cl_platform_id. - * + * * This simply copies the platform ID value, which is an inexpensive operation. */ __CL_EXPLICIT_CONSTRUCTORS Platform(const cl_platform_id &platform) : detail::Wrapper(platform) { } /*! \brief Assignment operator from cl_platform_id. - * + * * This simply copies the platform ID value, which is an inexpensive operation. */ Platform& operator = (const cl_platform_id& rhs) @@ -2228,7 +2228,7 @@ public: } /*! \brief Gets a list of devices for this platform. - * + * * Wraps clGetDeviceIDs(). */ cl_int getDevices( @@ -2290,8 +2290,8 @@ public: VECTOR_CLASS* devices) const { typedef CL_API_ENTRY cl_int (CL_API_CALL *PFN_clGetDeviceIDsFromD3D10KHR)( - cl_platform_id platform, - cl_d3d10_device_source_khr d3d_device_source, + cl_platform_id platform, + cl_d3d10_device_source_khr d3d_device_source, void * d3d_object, cl_d3d10_device_set_khr d3d_device_set, cl_uint num_entries, @@ -2307,12 +2307,12 @@ public: cl_uint n = 0; cl_int err = pfn_clGetDeviceIDsFromD3D10KHR( - object_, - d3d_device_source, + object_, + d3d_device_source, d3d_object, - d3d_device_set, - 0, - NULL, + d3d_device_set, + 0, + NULL, &n); if (err != CL_SUCCESS) { return detail::errHandler(err, __GET_DEVICE_IDS_ERR); @@ -2320,12 +2320,12 @@ public: cl_device_id* ids = (cl_device_id*) alloca(n * sizeof(cl_device_id)); err = pfn_clGetDeviceIDsFromD3D10KHR( - object_, - d3d_device_source, + object_, + d3d_device_source, d3d_object, d3d_device_set, - n, - ids, + n, + ids, NULL); if (err != CL_SUCCESS) { return detail::errHandler(err, __GET_DEVICE_IDS_ERR); @@ -2337,7 +2337,7 @@ public: #endif /*! \brief Gets a list of available platforms. - * + * * Wraps clGetPlatformIDs(). */ static cl_int get( @@ -2366,7 +2366,7 @@ public: } /*! \brief Gets the first available platform. - * + * * Wraps clGetPlatformIDs(), returning the first result. */ static cl_int get( @@ -2395,7 +2395,7 @@ public: } /*! \brief Gets the first available platform, returning it by value. - * + * * Wraps clGetPlatformIDs(), returning the first result. */ static Platform get( @@ -2424,17 +2424,17 @@ public: return Platform(); } - + return Platform(ids[0]); } - static Platform getDefault( + static Platform getDefault( cl_int *errResult = NULL ) { return get(errResult); } - + #if defined(CL_VERSION_1_2) //! \brief Wrapper for clUnloadCompiler(). cl_int @@ -2470,7 +2470,7 @@ UnloadCompiler() * * \see cl_context */ -class Context +class Context : public detail::Wrapper { private: @@ -2662,12 +2662,12 @@ public: * * \note All calls to this function return the same cl_context as the first. */ - static Context getDefault(cl_int * err = NULL) + static Context getDefault(cl_int * err = NULL) { int state = detail::compare_exchange( - &default_initialized_, + &default_initialized_, __DEFAULT_BEING_INITIALIZED, __DEFAULT_NOT_INITIALIZED); - + if (state & __DEFAULT_INITIALIZED) { if (err != NULL) { *err = default_error_; @@ -2714,14 +2714,14 @@ public: Context() : detail::Wrapper() { } /*! \brief Constructor from cl_context - takes ownership. - * + * * This effectively transfers ownership of a refcount on the cl_context * into the new Context object. */ __CL_EXPLICIT_CONSTRUCTORS Context(const cl_context& context) : detail::Wrapper(context) { } /*! \brief Assignment operator from cl_context - takes ownership. - * + * * This effectively transfers ownership of a refcount on the rhs and calls * clReleaseContext() on the value previously held by this instance. */ @@ -2755,7 +2755,7 @@ public: } /*! \brief Gets a list of supported image formats. - * + * * Wraps clGetSupportedImageFormats(). */ cl_int getSupportedImageFormats( @@ -2860,7 +2860,7 @@ public: Event() : detail::Wrapper() { } /*! \brief Constructor from cl_event - takes ownership. - * + * * This effectively transfers ownership of a refcount on the cl_event * into the new Event object. */ @@ -2924,7 +2924,7 @@ public: } /*! \brief Blocks the calling thread until this event completes. - * + * * Wraps clWaitForEvents(). */ cl_int wait() const @@ -2941,7 +2941,7 @@ public: */ cl_int setCallback( cl_int type, - void (CL_CALLBACK * pfn_notify)(cl_event, cl_int, void *), + void (CL_CALLBACK * pfn_notify)(cl_event, cl_int, void *), void * user_data = NULL) { return detail::errHandler( @@ -2949,13 +2949,13 @@ public: object_, type, pfn_notify, - user_data), + user_data), __SET_EVENT_CALLBACK_ERR); } #endif /*! \brief Blocks the calling thread until every event specified is complete. - * + * * Wraps clWaitForEvents(). */ static cl_int @@ -2970,7 +2970,7 @@ public: #if defined(CL_VERSION_1_1) /*! \brief Class interface for user events (a subset of cl_event's). - * + * * See Event for details about copy semantics, etc. */ class UserEvent : public Event @@ -3005,14 +3005,14 @@ public: cl_int setStatus(cl_int status) { return detail::errHandler( - ::clSetUserEventStatus(object_,status), + ::clSetUserEventStatus(object_,status), __SET_USER_EVENT_STATUS_ERR); } }; #endif /*! \brief Blocks the calling thread until every event specified is complete. - * + * * Wraps clWaitForEvents(). */ inline static cl_int @@ -3039,7 +3039,7 @@ public: Memory() : detail::Wrapper() { } /*! \brief Constructor from cl_mem - takes ownership. - * + * * This effectively transfers ownership of a refcount on the cl_mem * into the new Memory object. */ @@ -3124,14 +3124,14 @@ public: * value - not the Memory class instance. */ cl_int setDestructorCallback( - void (CL_CALLBACK * pfn_notify)(cl_mem, void *), + void (CL_CALLBACK * pfn_notify)(cl_mem, void *), void * user_data = NULL) { return detail::errHandler( ::clSetMemObjectDestructorCallback( object_, pfn_notify, - user_data), + user_data), __SET_MEM_OBJECT_DESTRUCTOR_CALLBACK_ERR); } #endif @@ -3151,7 +3151,7 @@ cl_int copy( const CommandQueue &queue, const cl::Buffer &buffer, IteratorType s /*! \brief Class interface for Buffer Memory Objects. - * + * * See Memory for details about copy semantics, etc. * * \see Memory @@ -3236,7 +3236,7 @@ public: if( useHostPtr ) { flags |= CL_MEM_USE_HOST_PTR; } - + ::size_t size = sizeof(DataType)*(endIterator - startIterator); Context context = Context::getDefault(err); @@ -3296,7 +3296,7 @@ public: Memory::operator=(rhs); return *this; } - + /*! \brief Copy constructor to forward copy to the superclass correctly. * Required for MSVC. */ @@ -3310,7 +3310,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. @@ -3341,10 +3341,10 @@ public: Buffer result; cl_int error; result.object_ = ::clCreateSubBuffer( - object_, - flags, - buffer_create_type, - buffer_create_info, + object_, + flags, + buffer_create_type, + buffer_create_info, &error); detail::errHandler(error, __CREATE_SUBBUFFER_ERR); @@ -3353,7 +3353,7 @@ public: } return result; - } + } #endif }; @@ -3361,7 +3361,7 @@ public: /*! \brief Class interface for creating OpenCL buffers from ID3D10Buffer's. * * This is provided to facilitate interoperability with Direct3D. - * + * * See Memory for details about copy semantics, etc. * * \see Memory @@ -3467,9 +3467,9 @@ public: /*! \brief Class interface for GL Buffer Memory Objects. * * This is provided to facilitate interoperability with OpenGL. - * + * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class BufferGL : public Buffer @@ -3562,7 +3562,7 @@ public: /*! \brief C++ base class for Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image : public Memory @@ -3626,7 +3626,7 @@ public: detail::getInfo(&::clGetImageInfo, object_, name, param), __GET_IMAGE_INFO_ERR); } - + //! \brief Wrapper for clGetImageInfo() that returns by value. template typename detail::param_traits::param_type @@ -3646,7 +3646,7 @@ public: /*! \brief Class interface for 1D Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image1D : public Image @@ -3672,11 +3672,11 @@ public: 0, 0, 0, 0, 0, 0, 0, 0 }; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - host_ptr, + context(), + flags, + &format, + &desc, + host_ptr, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -3758,11 +3758,11 @@ public: buffer() }; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - NULL, + context(), + flags, + &format, + &desc, + NULL, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -3780,7 +3780,7 @@ public: Image::operator=(rhs); return *this; } - + /*! \brief Copy constructor to forward copy to the superclass correctly. * Required for MSVC. */ @@ -3839,11 +3839,11 @@ public: 0, 0, 0, 0 }; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - host_ptr, + context(), + flags, + &format, + &desc, + host_ptr, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -3861,7 +3861,7 @@ public: Image::operator=(rhs); return *this; } - + /*! \brief Copy constructor to forward copy to the superclass correctly. * Required for MSVC. */ @@ -3898,7 +3898,7 @@ public: /*! \brief Class interface for 2D Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image2D : public Image @@ -4028,9 +4028,9 @@ public: /*! \brief Class interface for GL 2D Image Memory objects. * * This is provided to facilitate interoperability with OpenGL. - * + * * See Memory for details about copy semantics, etc. - * + * * \see Memory * \note Deprecated for OpenCL 1.2. Please use ImageGL instead. */ @@ -4065,7 +4065,7 @@ public: } } - + //! \brief Default constructor - initializes to NULL. Image2DGL() : Image2D() { } @@ -4149,11 +4149,11 @@ public: 0, 0, 0 }; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - host_ptr, + context(), + flags, + &format, + &desc, + host_ptr, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -4171,7 +4171,7 @@ public: Image::operator=(rhs); return *this; } - + /*! \brief Copy constructor to forward copy to the superclass correctly. * Required for MSVC. */ @@ -4207,7 +4207,7 @@ public: /*! \brief Class interface for 3D Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image3D : public Image @@ -4259,11 +4259,11 @@ public: 0, 0, 0 }; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - host_ptr, + context(), + flags, + &format, + &desc, + host_ptr, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -4341,9 +4341,9 @@ public: /*! \brief Class interface for GL 3D Image Memory objects. * * This is provided to facilitate interoperability with OpenGL. - * + * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image3DGL : public Image3D @@ -4448,8 +4448,8 @@ public: { cl_int error; object_ = ::clCreateFromGLTexture( - context(), - flags, + context(), + flags, target, miplevel, texobj, @@ -4511,7 +4511,7 @@ public: * * \see Memory */ -class BufferRenderGL : +class BufferRenderGL : #if defined(CL_VERSION_1_2) public ImageGL #else // #if defined(CL_VERSION_1_2) @@ -4572,7 +4572,7 @@ public: #else // #if defined(CL_VERSION_1_2) Image2DGL::operator=(rhs); #endif //#if defined(CL_VERSION_1_2) - + return *this; } @@ -4607,7 +4607,7 @@ public: #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. @@ -4619,7 +4619,7 @@ public: #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) @@ -4641,7 +4641,7 @@ public: * to the same underlying cl_sampler as the original. For details, see * clRetainSampler() and clReleaseSampler(). * - * \see cl_sampler + * \see cl_sampler */ class Sampler : public detail::Wrapper { @@ -4662,7 +4662,7 @@ public: { cl_int error; object_ = ::clCreateSampler( - context(), + context(), normalized_coords, addressing_mode, filter_mode, @@ -4675,7 +4675,7 @@ public: } /*! \brief Constructor from cl_sampler - takes ownership. - * + * * This effectively transfers ownership of a refcount on the cl_sampler * into the new Sampler object. */ @@ -4788,11 +4788,11 @@ public: } /*! \brief Conversion operator to const ::size_t *. - * + * * \returns a pointer to the size of the first dimension. */ - operator const ::size_t*() const { - return (const ::size_t*) sizes_; + operator const ::size_t*() const { + return (const ::size_t*) sizes_; } //! \brief Queries the number of dimensions in the range. @@ -4824,7 +4824,7 @@ struct KernelArgumentHandler static const void* ptr(const LocalSpaceArg&) { return NULL; } }; -} +} //! \endcond /*! __local @@ -4869,7 +4869,7 @@ public: Kernel() { } /*! \brief Constructor from cl_kernel - takes ownership. - * + * * This effectively transfers ownership of a refcount on the cl_kernel * into the new Kernel object. */ @@ -5119,7 +5119,7 @@ public: * Set to CL_INVALID_BINARY if the binary provided is not valid for the matching device. * \param err if non-NULL will be set to CL_SUCCESS on successful operation or one of the following errors: * CL_INVALID_CONTEXT if context is not a valid context. - * CL_INVALID_VALUE if the length of devices is zero; or if the length of binaries does not match the length of devices; + * CL_INVALID_VALUE if the length of devices is zero; or if the length of binaries does not match the length of devices; * or if any entry in binaries is NULL or has length 0. * CL_INVALID_DEVICE if OpenCL devices listed in devices are not in the list of devices associated with context. * CL_INVALID_BINARY if an invalid program binary was encountered for any device. binaryStatus will return specific status for each device. @@ -5133,9 +5133,9 @@ public: cl_int* err = NULL) { cl_int error; - + const ::size_t numDevices = devices.size(); - + // Catch size mismatch early and return if(binaries.size() != numDevices) { error = CL_INVALID_VALUE; @@ -5162,7 +5162,7 @@ public: if(binaryStatus) { binaryStatus->resize(numDevices); } - + object_ = ::clCreateProgramWithBinary( context(), (cl_uint) devices.size(), deviceIDs, @@ -5176,7 +5176,7 @@ public: } } - + #if defined(CL_VERSION_1_2) /** * Create program using builtin kernels. @@ -5196,12 +5196,12 @@ public: for( ::size_t deviceIndex = 0; deviceIndex < numDevices; ++deviceIndex ) { deviceIDs[deviceIndex] = (devices[deviceIndex])(); } - + object_ = ::clCreateProgramWithBuiltInKernels( - context(), + context(), (cl_uint) devices.size(), deviceIDs, - kernelNames.c_str(), + kernelNames.c_str(), &error); detail::errHandler(error, __CREATE_PROGRAM_WITH_BUILT_IN_KERNELS_ERR); @@ -5383,7 +5383,7 @@ inline Program linkProgram( const char* options = NULL, void (CL_CALLBACK * notifyFptr)(cl_program, void *) = NULL, void* data = NULL, - cl_int* err = NULL) + cl_int* err = NULL) { cl_int error_local = CL_SUCCESS; @@ -5418,7 +5418,7 @@ inline Program linkProgram( const char* options = NULL, void (CL_CALLBACK * notifyFptr)(cl_program, void *) = NULL, void* data = NULL, - cl_int* err = NULL) + cl_int* err = NULL) { cl_int error_local = CL_SUCCESS; @@ -5428,7 +5428,7 @@ inline Program linkProgram( for (unsigned int i = 0; i < inputPrograms.size(); i++) { programs[i] = inputPrograms[i](); } - } + } Context ctx; if(inputPrograms.size() > 0) { @@ -5462,14 +5462,14 @@ inline VECTOR_CLASS cl::Program::getInfo(cl_int* er { VECTOR_CLASS< ::size_t> sizes = getInfo(); VECTOR_CLASS binaries; - for (VECTOR_CLASS< ::size_t>::iterator s = sizes.begin(); s != sizes.end(); ++s) + for (VECTOR_CLASS< ::size_t>::iterator s = sizes.begin(); s != sizes.end(); ++s) { char *ptr = NULL; - if (*s != 0) + if (*s != 0) ptr = new char[*s]; binaries.push_back(ptr); } - + cl_int result = getInfo(CL_PROGRAM_BINARIES, &binaries); if (err != NULL) { *err = result; @@ -5608,12 +5608,12 @@ public: } #endif // #if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED) - static CommandQueue getDefault(cl_int * err = NULL) + static CommandQueue getDefault(cl_int * err = NULL) { int state = detail::compare_exchange( - &default_initialized_, + &default_initialized_, __DEFAULT_BEING_INITIALIZED, __DEFAULT_NOT_INITIALIZED); - + if (state & __DEFAULT_INITIALIZED) { if (err != NULL) { *err = default_error_; @@ -5792,9 +5792,9 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueReadBufferRect( - object_, - buffer(), - blocking, + object_, + buffer(), + blocking, (const ::size_t *)buffer_offset, (const ::size_t *)host_offset, (const ::size_t *)region, @@ -5831,9 +5831,9 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueWriteBufferRect( - object_, - buffer(), - blocking, + object_, + buffer(), + blocking, (const ::size_t *)buffer_offset, (const ::size_t *)host_offset, (const ::size_t *)region, @@ -5869,11 +5869,11 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueCopyBufferRect( - object_, - src(), - dst(), - (const ::size_t *)src_origin, - (const ::size_t *)dst_origin, + object_, + src(), + dst(), + (const ::size_t *)src_origin, + (const ::size_t *)dst_origin, (const ::size_t *)region, src_row_pitch, src_slice_pitch, @@ -5894,7 +5894,7 @@ public: /** * Enqueue a command to fill a buffer object with a pattern * of a given size. The pattern is specified a as vector. - * \tparam PatternType The datatype of the pattern field. + * \tparam PatternType The datatype of the pattern field. * The pattern type must be an accepted OpenCL data type. */ template @@ -5909,11 +5909,11 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueFillBuffer( - object_, + object_, buffer(), static_cast(&pattern), - sizeof(PatternType), - offset, + sizeof(PatternType), + offset, size, (events != NULL) ? (cl_uint) events->size() : 0, (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL, @@ -6025,10 +6025,10 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueFillImage( - object_, + object_, image(), - static_cast(&fillColor), - (const ::size_t *) origin, + static_cast(&fillColor), + (const ::size_t *) origin, (const ::size_t *) region, (events != NULL) ? (cl_uint) events->size() : 0, (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL, @@ -6059,10 +6059,10 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueFillImage( - object_, + object_, image(), - static_cast(&fillColor), - (const ::size_t *) origin, + static_cast(&fillColor), + (const ::size_t *) origin, (const ::size_t *) region, (events != NULL) ? (cl_uint) events->size() : 0, (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL, @@ -6093,10 +6093,10 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueFillImage( - object_, + object_, image(), - static_cast(&fillColor), - (const ::size_t *) origin, + static_cast(&fillColor), + (const ::size_t *) origin, (const ::size_t *) region, (events != NULL) ? (cl_uint) events->size() : 0, (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL, @@ -6244,14 +6244,14 @@ public: #if defined(CL_VERSION_1_2) /** - * Enqueues a marker command which waits for either a list of events to complete, + * Enqueues a marker command which waits for either a list of events to complete, * or all previously enqueued commands to complete. * - * Enqueues a marker command which waits for either a list of events to complete, - * or if the list is empty it waits for all commands previously enqueued in command_queue - * to complete before it completes. This command returns an event which can be waited on, - * i.e. this event can be waited on to insure that all events either in the event_wait_list - * or all previously enqueued commands, queued before this command to command_queue, + * Enqueues a marker command which waits for either a list of events to complete, + * or if the list is empty it waits for all commands previously enqueued in command_queue + * to complete before it completes. This command returns an event which can be waited on, + * i.e. this event can be waited on to insure that all events either in the event_wait_list + * or all previously enqueued commands, queued before this command to command_queue, * have completed. */ cl_int enqueueMarkerWithWaitList( @@ -6276,12 +6276,12 @@ public: /** * A synchronization point that enqueues a barrier operation. * - * Enqueues a barrier command which waits for either a list of events to complete, - * or if the list is empty it waits for all commands previously enqueued in command_queue - * to complete before it completes. This command blocks command execution, that is, any - * following commands enqueued after it do not execute until it completes. This command - * returns an event which can be waited on, i.e. this event can be waited on to insure that - * all events either in the event_wait_list or all previously enqueued commands, queued + * Enqueues a barrier command which waits for either a list of events to complete, + * or if the list is empty it waits for all commands previously enqueued in command_queue + * to complete before it completes. This command blocks command execution, that is, any + * following commands enqueued after it do not execute until it completes. This command + * returns an event which can be waited on, i.e. this event can be waited on to insure that + * all events either in the event_wait_list or all previously enqueued commands, queued * before this command to command_queue, have completed. */ cl_int enqueueBarrierWithWaitList( @@ -6302,7 +6302,7 @@ public: return err; } - + /** * Enqueues a command to indicate with which device a set of memory objects * should be associated. @@ -6315,7 +6315,7 @@ public: ) const { cl_event tmp; - + cl_mem* localMemObjects = static_cast(alloca(memObjects.size() * sizeof(cl_mem))); for( int i = 0; i < (int)memObjects.size(); ++i ) { localMemObjects[i] = memObjects[i](); @@ -6324,8 +6324,8 @@ public: cl_int err = detail::errHandler( ::clEnqueueMigrateMemObjects( - object_, - (cl_uint)memObjects.size(), + object_, + (cl_uint)memObjects.size(), static_cast(localMemObjects), flags, (events != NULL) ? (cl_uint) events->size() : 0, @@ -6394,7 +6394,7 @@ public: const VECTOR_CLASS* events = NULL, Event* event = NULL) const { - cl_mem * mems = (mem_objects != NULL && mem_objects->size() > 0) + cl_mem * mems = (mem_objects != NULL && mem_objects->size() > 0) ? (cl_mem*) alloca(mem_objects->size() * sizeof(cl_mem)) : NULL; @@ -6425,14 +6425,14 @@ public: /** * Deprecated APIs for 1.2 */ -#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) || (defined(CL_VERSION_1_1) && !defined(CL_VERSION_1_2)) - CL_EXT_PREFIX__VERSION_1_1_DEPRECATED +#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) || (defined(CL_VERSION_1_1) && !defined(CL_VERSION_1_2)) + CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int enqueueMarker(Event* event = NULL) const CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED { cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueMarker( - object_, + object_, (event != NULL) ? &tmp : NULL), __ENQUEUE_MARKER_ERR); @@ -6523,7 +6523,7 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *PFN_clEnqueueReleaseD3D10ObjectsKHR)( #if defined(CL_VERSION_1_1) __INIT_CL_EXT_FCN_PTR(clEnqueueAcquireD3D10ObjectsKHR); #endif - + cl_event tmp; cl_int err = detail::errHandler( pfn_clEnqueueAcquireD3D10ObjectsKHR( @@ -6578,7 +6578,7 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *PFN_clEnqueueReleaseD3D10ObjectsKHR)( /** * Deprecated APIs for 1.2 */ -#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) || (defined(CL_VERSION_1_1) && !defined(CL_VERSION_1_2)) +#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) || (defined(CL_VERSION_1_1) && !defined(CL_VERSION_1_2)) CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int enqueueBarrier() const CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED { @@ -6639,7 +6639,7 @@ Buffer::Buffer( if( useHostPtr ) { flags |= CL_MEM_USE_HOST_PTR; } - + ::size_t size = sizeof(DataType)*(endIterator - startIterator); if( useHostPtr ) { @@ -6874,11 +6874,11 @@ inline cl_int copy( const CommandQueue &queue, IteratorType startIterator, Itera { typedef typename std::iterator_traits::value_type DataType; cl_int error; - + ::size_t length = endIterator-startIterator; ::size_t byteLength = length*sizeof(DataType); - DataType *pointer = + DataType *pointer = 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 ) { @@ -6886,8 +6886,8 @@ inline cl_int copy( const CommandQueue &queue, IteratorType startIterator, Itera } #if defined(_MSC_VER) std::copy( - startIterator, - endIterator, + startIterator, + endIterator, stdext::checked_array_iterator( pointer, length)); #else @@ -6896,7 +6896,7 @@ inline cl_int copy( const CommandQueue &queue, IteratorType startIterator, Itera Event endEvent; error = queue.enqueueUnmapMemObject(buffer, pointer, 0, &endEvent); // if exceptions enabled, enqueueUnmapMemObject will throw - if( error != CL_SUCCESS ) { + if( error != CL_SUCCESS ) { return error; } endEvent.wait(); @@ -6913,11 +6913,11 @@ inline cl_int copy( const CommandQueue &queue, const cl::Buffer &buffer, Iterato { typedef typename std::iterator_traits::value_type DataType; cl_int error; - + ::size_t length = endIterator-startIterator; ::size_t byteLength = length*sizeof(DataType); - DataType *pointer = + DataType *pointer = 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 ) { @@ -6927,7 +6927,7 @@ inline cl_int copy( const CommandQueue &queue, const cl::Buffer &buffer, Iterato Event endEvent; error = queue.enqueueUnmapMemObject(buffer, pointer, 0, &endEvent); // if exceptions enabled, enqueueUnmapMemObject will throw - if( error != CL_SUCCESS ) { + if( error != CL_SUCCESS ) { return error; } endEvent.wait(); @@ -6957,17 +6957,17 @@ inline cl_int enqueueReadBufferRect( } return queue.enqueueReadBufferRect( - buffer, - blocking, - buffer_offset, + buffer, + blocking, + buffer_offset, host_offset, region, buffer_row_pitch, buffer_slice_pitch, host_row_pitch, host_slice_pitch, - ptr, - events, + ptr, + events, event); } @@ -6993,17 +6993,17 @@ inline cl_int enqueueWriteBufferRect( } return queue.enqueueWriteBufferRect( - buffer, - blocking, - buffer_offset, + buffer, + blocking, + buffer_offset, host_offset, region, buffer_row_pitch, buffer_slice_pitch, host_row_pitch, host_slice_pitch, - ptr, - events, + ptr, + events, event); } @@ -7037,7 +7037,7 @@ inline cl_int enqueueCopyBufferRect( src_slice_pitch, dst_row_pitch, dst_slice_pitch, - events, + events, event); } #endif @@ -7051,7 +7051,7 @@ inline cl_int enqueueReadImage( ::size_t slice_pitch, void* ptr, const VECTOR_CLASS* events = NULL, - Event* event = NULL) + Event* event = NULL) { cl_int error; CommandQueue queue = CommandQueue::getDefault(&error); @@ -7068,7 +7068,7 @@ inline cl_int enqueueReadImage( row_pitch, slice_pitch, ptr, - events, + events, event); } @@ -7098,7 +7098,7 @@ inline cl_int enqueueWriteImage( row_pitch, slice_pitch, ptr, - events, + events, event); } @@ -7200,7 +7200,7 @@ inline cl_int finish(void) if (error != CL_SUCCESS) { return error; - } + } return queue.finish(); @@ -7219,63 +7219,63 @@ struct EnqueueArgs const NDRange local_; VECTOR_CLASS events_; - EnqueueArgs(NDRange global) : + EnqueueArgs(NDRange global) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange) { } - EnqueueArgs(NDRange global, NDRange local) : + EnqueueArgs(NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local) { } - EnqueueArgs(NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(NDRange offset, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(offset), + offset_(offset), global_(global), local_(local) { } - EnqueueArgs(Event e, NDRange global) : + EnqueueArgs(Event e, NDRange global) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange) { events_.push_back(e); } - EnqueueArgs(Event e, NDRange global, NDRange local) : + EnqueueArgs(Event e, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local) { events_.push_back(e); } - EnqueueArgs(Event e, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(Event e, NDRange offset, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(offset), + offset_(offset), global_(global), local_(local) { events_.push_back(e); } - EnqueueArgs(const VECTOR_CLASS &events, NDRange global) : + EnqueueArgs(const VECTOR_CLASS &events, NDRange global) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange), events_(events) @@ -7283,9 +7283,9 @@ struct EnqueueArgs } - EnqueueArgs(const VECTOR_CLASS &events, NDRange global, NDRange local) : + EnqueueArgs(const VECTOR_CLASS &events, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local), events_(events) @@ -7293,9 +7293,9 @@ struct EnqueueArgs } - EnqueueArgs(const VECTOR_CLASS &events, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(const VECTOR_CLASS &events, NDRange offset, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(offset), + offset_(offset), global_(global), local_(local), events_(events) @@ -7303,63 +7303,63 @@ struct EnqueueArgs } - EnqueueArgs(CommandQueue &queue, NDRange global) : + EnqueueArgs(CommandQueue &queue, NDRange global) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange) { } - EnqueueArgs(CommandQueue &queue, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, NDRange global, NDRange local) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local) { } - EnqueueArgs(CommandQueue &queue, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, NDRange offset, NDRange global, NDRange local) : queue_(queue), - offset_(offset), + offset_(offset), global_(global), local_(local) { } - EnqueueArgs(CommandQueue &queue, Event e, NDRange global) : + EnqueueArgs(CommandQueue &queue, Event e, NDRange global) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange) { events_.push_back(e); } - EnqueueArgs(CommandQueue &queue, Event e, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, Event e, NDRange global, NDRange local) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local) { events_.push_back(e); } - EnqueueArgs(CommandQueue &queue, Event e, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, Event e, NDRange offset, NDRange global, NDRange local) : queue_(queue), - offset_(offset), + offset_(offset), global_(global), local_(local) { events_.push_back(e); } - EnqueueArgs(CommandQueue &queue, const VECTOR_CLASS &events, NDRange global) : + EnqueueArgs(CommandQueue &queue, const VECTOR_CLASS &events, NDRange global) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange), events_(events) @@ -7367,9 +7367,9 @@ struct EnqueueArgs } - EnqueueArgs(CommandQueue &queue, const VECTOR_CLASS &events, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, const VECTOR_CLASS &events, NDRange global, NDRange local) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local), events_(events) @@ -7377,9 +7377,9 @@ struct EnqueueArgs } - EnqueueArgs(CommandQueue &queue, const VECTOR_CLASS &events, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, const VECTOR_CLASS &events, NDRange offset, NDRange global, NDRange local) : queue_(queue), - offset_(offset), + offset_(offset), global_(global), local_(local), events_(events) @@ -7399,13 +7399,13 @@ struct SetArg { kernel.setArg(index, arg); } -}; +}; template struct SetArg { static void set (Kernel, NullType) - { + { } }; @@ -7509,7 +7509,7 @@ public: SetArg<30, T30>::set(kernel_, t30); SetArg<31, T31>::set(kernel_, t31); - + args.queue_.enqueueNDRangeKernel( kernel_, args.offset_, @@ -7517,7 +7517,7 @@ public: args.local_, &args.events_, &event); - + return event; } @@ -7600,12 +7600,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 32)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -7826,12 +7826,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 31)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -8048,12 +8048,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 30)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -8266,12 +8266,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 29)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -8480,12 +8480,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 28)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -8690,12 +8690,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 27)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -8896,12 +8896,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 26)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -9098,12 +9098,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 25)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -9296,12 +9296,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 24)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -9490,12 +9490,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 23)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -9680,12 +9680,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 22)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -9866,12 +9866,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 21)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -10048,12 +10048,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 20)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -10226,12 +10226,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 19)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -10400,12 +10400,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 18)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -10570,12 +10570,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 17)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -10736,12 +10736,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 16)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -10898,12 +10898,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 15)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -11056,12 +11056,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 14)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -11210,12 +11210,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 13)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -11360,12 +11360,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 12)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -11506,12 +11506,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 11)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -11648,12 +11648,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 10)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -11786,12 +11786,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 9)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -11920,12 +11920,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 8)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -12050,12 +12050,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 7)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -12176,12 +12176,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 6)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -12298,12 +12298,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 5)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -12416,12 +12416,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 4)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -12530,12 +12530,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 3)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -12640,12 +12640,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 2)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -12746,12 +12746,12 @@ struct functionImplementation_ functionImplementation_(const FunctorType &functor) : functor_(functor) { - + #if (defined(_WIN32) && defined(_VARIADIC_MAX) && (_VARIADIC_MAX < 1)) // Fail variadic expansion for dev11 static_assert(0, "Visual Studio has a hard limit of argument count for a std::function expansion. Please define _VARIADIC_MAX to be 10. If you need more arguments than that VC12 and below cannot support it."); #endif - + } //! \brief Return type of the functor @@ -12815,7 +12815,7 @@ struct make_kernel : > { public: - typedef detail::KernelFunctorGlobal< + typedef detail::KernelFunctorGlobal< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, @@ -12842,7 +12842,7 @@ public: T28, T29, T30, T31 >( - FunctorType(program, name, err)) + FunctorType(program, name, err)) {} make_kernel( @@ -12858,8 +12858,8 @@ public: T28, T29, T30, T31 >( - FunctorType(kernel)) - {} + FunctorType(kernel)) + {} }; @@ -12949,8 +12949,8 @@ public: #undef __PARAM_NAME_DEVICE_FISSION #endif // USE_CL_DEVICE_FISSION -#undef __DEFAULT_NOT_INITIALIZED -#undef __DEFAULT_BEING_INITIALIZED +#undef __DEFAULT_NOT_INITIALIZED +#undef __DEFAULT_BEING_INITIALIZED #undef __DEFAULT_INITIALIZED #undef CL_HPP_RVALUE_REFERENCES_SUPPORTED diff --git a/projects/clr/opencl/khronos/headers/opencl2.2/CL/cl2.hpp b/projects/clr/opencl/khronos/headers/opencl2.2/CL/cl2.hpp index 77653dad50..4210dc739e 100644 --- a/projects/clr/opencl/khronos/headers/opencl2.2/CL/cl2.hpp +++ b/projects/clr/opencl/khronos/headers/opencl2.2/CL/cl2.hpp @@ -86,17 +86,17 @@ * fixes in the new header as well as additional OpenCL 2.0 features. * As a result the header is not directly backward compatible and for this * reason we release it as cl2.hpp rather than a new version of cl.hpp. - * + * * * \section compatibility Compatibility * Due to the evolution of the underlying OpenCL API the 2.0 C++ bindings * include an updated approach to defining supported feature versions * and the range of valid underlying OpenCL runtime versions supported. * - * The combination of preprocessor macros CL_HPP_TARGET_OPENCL_VERSION and + * The combination of preprocessor macros CL_HPP_TARGET_OPENCL_VERSION and * CL_HPP_MINIMUM_OPENCL_VERSION control this range. These are three digit - * decimal values representing OpenCL runime versions. The default for - * the target is 200, representing OpenCL 2.0 and the minimum is also + * decimal values representing OpenCL runime versions. The default for + * the target is 200, representing OpenCL 2.0 and the minimum is also * defined as 200. These settings would use 2.0 API calls only. * If backward compatibility with a 1.2 runtime is required, the minimum * version may be set to 120. @@ -104,21 +104,21 @@ * Note that this is a compile-time setting, and so affects linking against * a particular SDK version rather than the versioning of the loaded runtime. * - * The earlier versions of the header included basic vector and string - * classes based loosely on STL versions. These were difficult to + * The earlier versions of the header included basic vector and string + * classes based loosely on STL versions. These were difficult to * maintain and very rarely used. For the 2.0 header we now assume * the presence of the standard library unless requested otherwise. - * We use std::array, std::vector, std::shared_ptr and std::string - * throughout to safely manage memory and reduce the chance of a + * We use std::array, std::vector, std::shared_ptr and std::string + * throughout to safely manage memory and reduce the chance of a * recurrance of earlier memory management bugs. * - * These classes are used through typedefs in the cl namespace: + * These classes are used through typedefs in the cl namespace: * cl::array, cl::vector, cl::pointer and cl::string. * In addition cl::allocate_pointer forwards to std::allocate_shared * by default. - * In all cases these standard library classes can be replaced with - * custom interface-compatible versions using the CL_HPP_NO_STD_ARRAY, - * CL_HPP_NO_STD_VECTOR, CL_HPP_NO_STD_UNIQUE_PTR and + * In all cases these standard library classes can be replaced with + * custom interface-compatible versions using the CL_HPP_NO_STD_ARRAY, + * CL_HPP_NO_STD_VECTOR, CL_HPP_NO_STD_UNIQUE_PTR and * CL_HPP_NO_STD_STRING macros. * * The OpenCL 1.x versions of the C++ bindings included a size_t wrapper @@ -129,12 +129,12 @@ * using the CL_HPP_ENABLE_SIZE_T_COMPATIBILITY macro. * * Finally, the program construction interface used a clumsy vector-of-pairs - * design in the earlier versions. We have replaced that with a cleaner - * vector-of-vectors and vector-of-strings design. However, for backward + * design in the earlier versions. We have replaced that with a cleaner + * vector-of-vectors and vector-of-strings design. However, for backward * compatibility old behaviour can be regained with the * CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY macro. - * - * In OpenCL 2.0 OpenCL C is not entirely backward compatibility with + * + * In OpenCL 2.0 OpenCL C is not entirely backward compatibility with * earlier versions. As a result a flag must be passed to the OpenCL C * compiled to request OpenCL 2.0 compilation of kernels with 1.2 as * the default in the absence of the flag. @@ -485,17 +485,17 @@ #if defined(_MSC_VER) #include -#endif // _MSC_VER - +#endif // _MSC_VER + // Check for a valid C++ version -// Need to do both tests here because for some reason __cplusplus is not +// Need to do both tests here because for some reason __cplusplus is not // updated in visual studio #if (!defined(_MSC_VER) && __cplusplus < 201103L) || (defined(_MSC_VER) && _MSC_VER < 1700) #error Visual studio 2013 or another C++11-supporting compiler required #endif -// +// #if defined(CL_HPP_USE_CL_DEVICE_FISSION) || defined(CL_HPP_USE_CL_SUB_GROUPS_KHR) #include #endif @@ -521,14 +521,14 @@ // Define deprecated prefixes and suffixes to ensure compilation // in case they are not pre-defined #if !defined(CL_EXT_PREFIX__VERSION_1_1_DEPRECATED) -#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED +#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED #endif // #if !defined(CL_EXT_PREFIX__VERSION_1_1_DEPRECATED) #if !defined(CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED) #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED #endif // #if !defined(CL_EXT_PREFIX__VERSION_1_1_DEPRECATED) #if !defined(CL_EXT_PREFIX__VERSION_1_2_DEPRECATED) -#define CL_EXT_PREFIX__VERSION_1_2_DEPRECATED +#define CL_EXT_PREFIX__VERSION_1_2_DEPRECATED #endif // #if !defined(CL_EXT_PREFIX__VERSION_1_2_DEPRECATED) #if !defined(CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED) #define CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED @@ -587,7 +587,7 @@ namespace cl { template using pointer = std::unique_ptr; } // namespace cl -#endif +#endif #endif // #if CL_HPP_TARGET_OPENCL_VERSION >= 200 #if !defined(CL_HPP_NO_STD_ARRAY) #include @@ -703,8 +703,8 @@ namespace cl { class Pipe; #if defined(CL_HPP_ENABLE_EXCEPTIONS) - /*! \brief Exception class - * + /*! \brief Exception class + * * This may be thrown by API functions when CL_HPP_ENABLE_EXCEPTIONS is defined. */ class Error : public std::exception @@ -715,7 +715,7 @@ namespace cl { public: /*! \brief Create a new CL error exception for a given error code * and corresponding message. - * + * * \param err error code value. * * \param errStr a descriptive string that must remain in scope until @@ -1064,7 +1064,7 @@ inline cl_int getInfoHelper(Func f, cl_uint name, array* param, lo if (err != CL_SUCCESS) { return err; } - + // Bound the copy with N to prevent overruns // if passed N > than the amount copied if (elements > N) { @@ -1472,7 +1472,7 @@ struct ReferenceHandler /** * Retain the device. * \param device A valid device created using createSubDevices - * \return + * \return * CL_SUCCESS if the function executed successfully. * CL_INVALID_DEVICE if device was not a valid subdevice * CL_OUT_OF_RESOURCES @@ -1483,7 +1483,7 @@ struct ReferenceHandler /** * Retain the device. * \param device A valid device created using createSubDevices - * \return + * \return * CL_SUCCESS if the function executed successfully. * CL_INVALID_DEVICE if device was not a valid subdevice * CL_OUT_OF_RESOURCES @@ -1646,11 +1646,11 @@ protected: public: Wrapper() : object_(NULL) { } - - Wrapper(const cl_type &obj, bool retainObject) : object_(obj) + + Wrapper(const cl_type &obj, bool retainObject) : object_(obj) { - if (retainObject) { - detail::errHandler(retain(), __RETAIN_ERR); + if (retainObject) { + detail::errHandler(retain(), __RETAIN_ERR); } } @@ -1761,15 +1761,15 @@ protected: } public: - Wrapper() : object_(NULL), referenceCountable_(false) - { - } - - Wrapper(const cl_type &obj, bool retainObject) : - object_(obj), - referenceCountable_(false) + Wrapper() : object_(NULL), referenceCountable_(false) { - referenceCountable_ = isReferenceCountable(obj); + } + + Wrapper(const cl_type &obj, bool retainObject) : + object_(obj), + referenceCountable_(false) + { + referenceCountable_ = isReferenceCountable(obj); if (retainObject) { detail::errHandler(retain(), __RETAIN_ERR); @@ -1780,11 +1780,11 @@ public: { release(); } - + Wrapper(const Wrapper& rhs) { object_ = rhs.object_; - referenceCountable_ = isReferenceCountable(object_); + referenceCountable_ = isReferenceCountable(object_); detail::errHandler(retain(), __RETAIN_ERR); } @@ -1823,7 +1823,7 @@ public: { detail::errHandler(release(), __RELEASE_ERR); object_ = rhs; - referenceCountable_ = isReferenceCountable(object_); + referenceCountable_ = isReferenceCountable(object_); return *this; } @@ -2001,10 +2001,10 @@ public: Device() : detail::Wrapper() { } /*! \brief Constructor from cl_device_id. - * + * * This simply copies the device ID value, which is an inexpensive operation. */ - explicit Device(const cl_device_id &device, bool retainObject = false) : + explicit Device(const cl_device_id &device, bool retainObject = false) : detail::Wrapper(device, retainObject) { } /*! \brief Returns the first device on the default context. @@ -2037,7 +2037,7 @@ public: } /*! \brief Assignment operator from cl_device_id. - * + * * This simply copies the device ID value, which is an inexpensive operation. */ Device& operator = (const cl_device_id& rhs) @@ -2118,7 +2118,7 @@ public: return detail::errHandler(err, __CREATE_SUB_DEVICES_ERR); } - // Cannot trivially assign because we need to capture intermediates + // Cannot trivially assign because we need to capture intermediates // with safe construction if (devices) { devices->resize(ids.size()); @@ -2126,7 +2126,7 @@ public: // Assign to param, constructing with retain behaviour // to correctly capture each underlying CL object for (size_type i = 0; i < ids.size(); i++) { - // We do not need to retain because this device is being created + // We do not need to retain because this device is being created // by the runtime (*devices)[i] = Device(ids[i], false); } @@ -2143,7 +2143,7 @@ public: const cl_device_partition_property_ext * properties, vector* devices) { - typedef CL_API_ENTRY cl_int + typedef CL_API_ENTRY cl_int ( CL_API_CALL * PFN_clCreateSubDevicesEXT)( cl_device_id /*in_device*/, const cl_device_partition_property_ext * /* properties */, @@ -2165,7 +2165,7 @@ public: if (err != CL_SUCCESS) { return detail::errHandler(err, __CREATE_SUB_DEVICES_ERR); } - // Cannot trivially assign because we need to capture intermediates + // Cannot trivially assign because we need to capture intermediates // with safe construction if (devices) { devices->resize(ids.size()); @@ -2173,7 +2173,7 @@ public: // Assign to param, constructing with retain behaviour // to correctly capture each underlying CL object for (size_type i = 0; i < ids.size(); i++) { - // We do not need to retain because this device is being created + // We do not need to retain because this device is being created // by the runtime (*devices)[i] = Device(ids[i], false); } @@ -2252,7 +2252,7 @@ private: static void makeDefaultProvided(const Platform &p) { default_ = p; } - + public: #ifdef CL_HPP_UNIT_TEST_ENABLE /*! \brief Reset the default. @@ -2270,17 +2270,17 @@ public: Platform() : detail::Wrapper() { } /*! \brief Constructor from cl_platform_id. - * + * * \param retainObject will cause the constructor to retain its cl object. * Defaults to false to maintain compatibility with * earlier versions. * This simply copies the platform ID value, which is an inexpensive operation. */ - explicit Platform(const cl_platform_id &platform, bool retainObject = false) : + explicit Platform(const cl_platform_id &platform, bool retainObject = false) : detail::Wrapper(platform, retainObject) { } /*! \brief Assignment operator from cl_platform_id. - * + * * This simply copies the platform ID value, which is an inexpensive operation. */ Platform& operator = (const cl_platform_id& rhs) @@ -2301,10 +2301,10 @@ public: } /** - * Modify the default platform to be used by + * Modify the default platform to be used by * subsequent operations. * Will only set the default if no default was previously created. - * @return updated default platform. + * @return updated default platform. * Should be compared to the passed value to ensure that it was updated. */ static Platform setDefault(const Platform &default_platform) @@ -2337,7 +2337,7 @@ public: } /*! \brief Gets a list of devices for this platform. - * + * * Wraps clGetDeviceIDs(). */ cl_int getDevices( @@ -2361,7 +2361,7 @@ public: } } - // Cannot trivially assign because we need to capture intermediates + // Cannot trivially assign because we need to capture intermediates // with safe construction // We must retain things we obtain from the API to avoid releasing // API-owned objects. @@ -2408,8 +2408,8 @@ public: vector* devices) const { typedef CL_API_ENTRY cl_int (CL_API_CALL *PFN_clGetDeviceIDsFromD3D10KHR)( - cl_platform_id platform, - cl_d3d10_device_source_khr d3d_device_source, + cl_platform_id platform, + cl_d3d10_device_source_khr d3d_device_source, void * d3d_object, cl_d3d10_device_set_khr d3d_device_set, cl_uint num_entries, @@ -2425,12 +2425,12 @@ public: cl_uint n = 0; cl_int err = pfn_clGetDeviceIDsFromD3D10KHR( - object_, - d3d_device_source, + object_, + d3d_device_source, d3d_object, - d3d_device_set, - 0, - NULL, + d3d_device_set, + 0, + NULL, &n); if (err != CL_SUCCESS) { return detail::errHandler(err, __GET_DEVICE_IDS_ERR); @@ -2438,18 +2438,18 @@ public: vector ids(n); err = pfn_clGetDeviceIDsFromD3D10KHR( - object_, - d3d_device_source, + object_, + d3d_device_source, d3d_object, d3d_device_set, - n, - ids.data(), + n, + ids.data(), NULL); if (err != CL_SUCCESS) { return detail::errHandler(err, __GET_DEVICE_IDS_ERR); } - // Cannot trivially assign because we need to capture intermediates + // Cannot trivially assign because we need to capture intermediates // with safe construction // We must retain things we obtain from the API to avoid releasing // API-owned objects. @@ -2467,7 +2467,7 @@ public: #endif /*! \brief Gets a list of available platforms. - * + * * Wraps clGetPlatformIDs(). */ static cl_int get( @@ -2502,7 +2502,7 @@ public: } /*! \brief Gets the first available platform. - * + * * Wraps clGetPlatformIDs(), returning the first result. */ static cl_int get( @@ -2533,8 +2533,8 @@ public: *errResult = err; } return default_platform; - } - + } + #if CL_HPP_TARGET_OPENCL_VERSION >= 120 //! \brief Wrapper for clUnloadCompiler(). cl_int @@ -2575,7 +2575,7 @@ UnloadCompiler() * * \see cl_context */ -class Context +class Context : public detail::Wrapper { private: @@ -2629,7 +2629,7 @@ private: static void makeDefaultProvided(const Context &c) { default_ = c; } - + public: #ifdef CL_HPP_UNIT_TEST_ENABLE /*! \brief Reset the default. @@ -2703,7 +2703,7 @@ public: *err = error; } } - + /*! \brief Constructs a context including all or a subset of devices of a specified type. * * Wraps clCreateContextFromType(). @@ -2822,7 +2822,7 @@ public: * * \note All calls to this function return the same cl_context as the first. */ - static Context getDefault(cl_int * err = NULL) + static Context getDefault(cl_int * err = NULL) { std::call_once(default_initialized_, makeDefault); detail::errHandler(default_error_); @@ -2850,15 +2850,15 @@ public: Context() : detail::Wrapper() { } /*! \brief Constructor from cl_context - takes ownership. - * + * * This effectively transfers ownership of a refcount on the cl_context * into the new Context object. */ - explicit Context(const cl_context& context, bool retainObject = false) : + explicit Context(const cl_context& context, bool retainObject = false) : detail::Wrapper(context, retainObject) { } /*! \brief Assignment operator from cl_context - takes ownership. - * + * * This effectively transfers ownership of a refcount on the rhs and calls * clReleaseContext() on the value previously held by this instance. */ @@ -2892,7 +2892,7 @@ public: } /*! \brief Gets a list of supported image formats. - * + * * Wraps clGetSupportedImageFormats(). */ cl_int getSupportedImageFormats( @@ -2901,17 +2901,17 @@ public: vector* formats) const { cl_uint numEntries; - + if (!formats) { return CL_SUCCESS; } cl_int err = ::clGetSupportedImageFormats( - object_, + object_, flags, - type, - 0, - NULL, + type, + 0, + NULL, &numEntries); if (err != CL_SUCCESS) { return detail::errHandler(err, __GET_SUPPORTED_IMAGE_FORMATS_ERR); @@ -2989,14 +2989,14 @@ public: Event() : detail::Wrapper() { } /*! \brief Constructor from cl_event - takes ownership. - * + * * \param retainObject will cause the constructor to retain its cl object. * Defaults to false to maintain compatibility with * earlier versions. * This effectively transfers ownership of a refcount on the cl_event * into the new Event object. */ - explicit Event(const cl_event& event, bool retainObject = false) : + explicit Event(const cl_event& event, bool retainObject = false) : detail::Wrapper(event, retainObject) { } /*! \brief Assignment operator from cl_event - takes ownership. @@ -3057,7 +3057,7 @@ public: } /*! \brief Blocks the calling thread until this event completes. - * + * * Wraps clWaitForEvents(). */ cl_int wait() const @@ -3074,7 +3074,7 @@ public: */ cl_int setCallback( cl_int type, - void (CL_CALLBACK * pfn_notify)(cl_event, cl_int, void *), + void (CL_CALLBACK * pfn_notify)(cl_event, cl_int, void *), void * user_data = NULL) { return detail::errHandler( @@ -3082,13 +3082,13 @@ public: object_, type, pfn_notify, - user_data), + user_data), __SET_EVENT_CALLBACK_ERR); } #endif // CL_HPP_TARGET_OPENCL_VERSION >= 110 /*! \brief Blocks the calling thread until every event specified is complete. - * + * * Wraps clWaitForEvents(). */ static cl_int @@ -3103,7 +3103,7 @@ public: #if CL_HPP_TARGET_OPENCL_VERSION >= 110 /*! \brief Class interface for user events (a subset of cl_event's). - * + * * See Event for details about copy semantics, etc. */ class UserEvent : public Event @@ -3138,14 +3138,14 @@ public: cl_int setStatus(cl_int status) { return detail::errHandler( - ::clSetUserEventStatus(object_,status), + ::clSetUserEventStatus(object_,status), __SET_USER_EVENT_STATUS_ERR); } }; #endif // CL_HPP_TARGET_OPENCL_VERSION >= 110 /*! \brief Blocks the calling thread until every event specified is complete. - * + * * Wraps clWaitForEvents(). */ inline static cl_int @@ -3263,14 +3263,14 @@ public: * value - not the Memory class instance. */ cl_int setDestructorCallback( - void (CL_CALLBACK * pfn_notify)(cl_mem, void *), + void (CL_CALLBACK * pfn_notify)(cl_mem, void *), void * user_data = NULL) { return detail::errHandler( ::clSetMemObjectDestructorCallback( object_, pfn_notify, - user_data), + user_data), __SET_MEM_OBJECT_DESTRUCTOR_CALLBACK_ERR); } #endif // CL_HPP_TARGET_OPENCL_VERSION >= 110 @@ -3453,7 +3453,7 @@ public: * Allocate an SVM pointer. * * If the allocator is coarse-grained, this will take ownership to allow - * containers to correctly construct data in place. + * containers to correctly construct data in place. */ pointer allocate( size_type size, @@ -3503,7 +3503,7 @@ public: for (const Device &d : context_.getInfo()) { maxSize = std::min( - maxSize, + maxSize, static_cast(d.getInfo())); } @@ -3629,7 +3629,7 @@ cl::pointer>> allocate_svm(const cl #endif // #if !defined(CL_HPP_NO_STD_UNIQUE_PTR) /*! \brief Vector alias to simplify contruction of coarse-grained SVM containers. - * + * */ template < class T > using coarse_svm_vector = vector>>; @@ -3650,7 +3650,7 @@ using atomic_svm_vector = vector>> /*! \brief Class interface for Buffer Memory Objects. - * + * * See Memory for details about copy semantics, etc. * * \see Memory @@ -3735,7 +3735,7 @@ public: if( useHostPtr ) { flags |= CL_MEM_USE_HOST_PTR; } - + size_type size = sizeof(DataType)*(endIterator - startIterator); Context context = Context::getDefault(err); @@ -3768,7 +3768,7 @@ public: 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 be random access. @@ -3842,10 +3842,10 @@ public: Buffer result; cl_int error; result.object_ = ::clCreateSubBuffer( - object_, - flags, - buffer_create_type, - buffer_create_info, + object_, + flags, + buffer_create_type, + buffer_create_info, &error); detail::errHandler(error, __CREATE_SUBBUFFER_ERR); @@ -3854,7 +3854,7 @@ public: } return result; - } + } #endif // CL_HPP_TARGET_OPENCL_VERSION >= 110 }; @@ -3862,7 +3862,7 @@ public: /*! \brief Class interface for creating OpenCL buffers from ID3D10Buffer's. * * This is provided to facilitate interoperability with Direct3D. - * + * * See Memory for details about copy semantics, etc. * * \see Memory @@ -3870,7 +3870,7 @@ public: class BufferD3D10 : public Buffer { public: - + /*! \brief Constructs a BufferD3D10, in a specified context, from a * given ID3D10Buffer. @@ -3919,11 +3919,11 @@ public: /*! \brief Constructor from cl_mem - takes ownership. * * \param retainObject will cause the constructor to retain its cl object. - * Defaults to false to maintain compatibility with + * Defaults to false to maintain compatibility with * earlier versions. * See Memory for further details. */ - explicit BufferD3D10(const cl_mem& buffer, bool retainObject = false) : + explicit BufferD3D10(const cl_mem& buffer, bool retainObject = false) : Buffer(buffer, retainObject) { } /*! \brief Assignment from cl_mem - performs shallow copy. @@ -3939,7 +3939,7 @@ public: /*! \brief Copy constructor to forward copy to the superclass correctly. * Required for MSVC. */ - BufferD3D10(const BufferD3D10& buf) : + BufferD3D10(const BufferD3D10& buf) : Buffer(buf) {} /*! \brief Copy assignment to forward copy to the superclass correctly. @@ -3970,9 +3970,9 @@ public: /*! \brief Class interface for GL Buffer Memory Objects. * * This is provided to facilitate interoperability with OpenGL. - * + * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class BufferGL : public Buffer @@ -4067,9 +4067,9 @@ public: /*! \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 @@ -4105,7 +4105,7 @@ public: /*! \brief Constructor from cl_mem - takes ownership. * * \param retainObject will cause the constructor to retain its cl object. - * Defaults to false to maintain compatibility with + * Defaults to false to maintain compatibility with * earlier versions. * See Memory for further details. */ @@ -4164,7 +4164,7 @@ public: /*! \brief C++ base class for Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image : public Memory @@ -4231,7 +4231,7 @@ public: detail::getInfo(&::clGetImageInfo, object_, name, param), __GET_IMAGE_INFO_ERR); } - + //! \brief Wrapper for clGetImageInfo() that returns by value. template typename detail::param_traits::param_type @@ -4251,7 +4251,7 @@ public: /*! \brief Class interface for 1D Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image1D : public Image @@ -4277,11 +4277,11 @@ public: 0, 0, 0, 0, 0, 0, 0, 0 }; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - host_ptr, + context(), + flags, + &format, + &desc, + host_ptr, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -4366,11 +4366,11 @@ public: buffer() }; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - NULL, + context(), + flags, + &format, + &desc, + NULL, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -4454,11 +4454,11 @@ public: 0, 0, 0, 0 }; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - host_ptr, + context(), + flags, + &format, + &desc, + host_ptr, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -4468,7 +4468,7 @@ public: } Image1DArray() { } - + /*! \brief Constructor from cl_mem - takes ownership. * * \param retainObject will cause the constructor to retain its cl object. @@ -4521,7 +4521,7 @@ public: /*! \brief Class interface for 2D Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image2D : public Image @@ -4644,10 +4644,10 @@ public: * \note This will share storage with the underlying image but may * reinterpret the channel order and type. * - * The image will be created matching with a descriptor matching the source. + * The image will be created matching with a descriptor matching the source. * * \param order is the channel order to reinterpret the image data as. - * The channel order may differ as described in the OpenCL + * The channel order may differ as described in the OpenCL * 2.0 API specification. * * Wraps clCreateImage(). @@ -4661,9 +4661,9 @@ public: cl_int error; // Descriptor fields have to match source image - size_type sourceWidth = + size_type sourceWidth = sourceImage.getImageInfo(); - size_type sourceHeight = + size_type sourceHeight = sourceImage.getImageInfo(); size_type sourceRowPitch = sourceImage.getImageInfo(); @@ -4674,7 +4674,7 @@ public: cl_image_format sourceFormat = sourceImage.getImageInfo(); - // Update only the channel order. + // Update only the channel order. // Channel format inherited from source. sourceFormat.image_channel_order = order; cl_image_desc desc = @@ -4763,13 +4763,13 @@ public: /*! \brief Class interface for GL 2D Image Memory objects. * * This is provided to facilitate interoperability with OpenGL. - * + * * See Memory for details about copy semantics, etc. - * + * * \see Memory * \note Deprecated for OpenCL 1.2. Please use ImageGL instead. */ -class CL_EXT_PREFIX__VERSION_1_1_DEPRECATED Image2DGL : public Image2D +class CL_EXT_PREFIX__VERSION_1_1_DEPRECATED Image2DGL : public Image2D { public: /*! \brief Constructs an Image2DGL in a specified context, from a given @@ -4800,7 +4800,7 @@ public: } } - + //! \brief Default constructor - initializes to NULL. Image2DGL() : Image2D() { } @@ -4811,7 +4811,7 @@ public: * earlier versions. * See Memory for further details. */ - explicit Image2DGL(const cl_mem& image, bool retainObject = false) : + explicit Image2DGL(const cl_mem& image, bool retainObject = false) : Image2D(image, retainObject) { } /*! \brief Assignment from cl_mem - performs shallow copy. @@ -4887,11 +4887,11 @@ public: 0, 0, 0 }; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - host_ptr, + context(), + flags, + &format, + &desc, + host_ptr, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -4901,7 +4901,7 @@ public: } Image2DArray() { } - + /*! \brief Constructor from cl_mem - takes ownership. * * \param retainObject will cause the constructor to retain its cl object. @@ -4950,7 +4950,7 @@ public: /*! \brief Class interface for 3D Image Memory objects. * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image3D : public Image @@ -5002,11 +5002,11 @@ public: 0, 0, 0 }; object_ = ::clCreateImage( - context(), - flags, - &format, - &desc, - host_ptr, + context(), + flags, + &format, + &desc, + host_ptr, &error); detail::errHandler(error, __CREATE_IMAGE_ERR); @@ -5040,7 +5040,7 @@ public: * earlier versions. * See Memory for further details. */ - explicit Image3D(const cl_mem& image3D, bool retainObject = false) : + explicit Image3D(const cl_mem& image3D, bool retainObject = false) : Image(image3D, retainObject) { } /*! \brief Assignment from cl_mem - performs shallow copy. @@ -5086,9 +5086,9 @@ public: /*! \brief Class interface for GL 3D Image Memory objects. * * This is provided to facilitate interoperability with OpenGL. - * + * * See Memory for details about copy semantics, etc. - * + * * \see Memory */ class Image3DGL : public Image3D @@ -5132,7 +5132,7 @@ public: * earlier versions. * See Memory for further details. */ - explicit Image3DGL(const cl_mem& image, bool retainObject = false) : + explicit Image3DGL(const cl_mem& image, bool retainObject = false) : Image3D(image, retainObject) { } /*! \brief Assignment from cl_mem - performs shallow copy. @@ -5195,8 +5195,8 @@ public: { cl_int error; object_ = ::clCreateFromGLTexture( - context(), - flags, + context(), + flags, target, miplevel, texobj, @@ -5209,7 +5209,7 @@ public: } ImageGL() : Image() { } - + /*! \brief Constructor from cl_mem - takes ownership. * * \param retainObject will cause the constructor to retain its cl object. @@ -5217,7 +5217,7 @@ public: * earlier versions. * See Memory for further details. */ - explicit ImageGL(const cl_mem& image, bool retainObject = false) : + explicit ImageGL(const cl_mem& image, bool retainObject = false) : Image(image, retainObject) { } ImageGL& operator = (const cl_mem& rhs) @@ -5404,7 +5404,7 @@ public: * to the same underlying cl_sampler as the original. For details, see * clRetainSampler() and clReleaseSampler(). * - * \see cl_sampler + * \see cl_sampler */ class Sampler : public detail::Wrapper { @@ -5452,18 +5452,18 @@ public: if (err != NULL) { *err = error; } -#endif +#endif } /*! \brief Constructor from cl_sampler - takes ownership. - * + * * \param retainObject will cause the constructor to retain its cl object. * Defaults to false to maintain compatibility with * earlier versions. * This effectively transfers ownership of a refcount on the cl_sampler * into the new Sampler object. */ - explicit Sampler(const cl_sampler& sampler, bool retainObject = false) : + explicit Sampler(const cl_sampler& sampler, bool retainObject = false) : detail::Wrapper(sampler, retainObject) { } /*! \brief Assignment operator from cl_sampler - takes ownership. @@ -5579,17 +5579,17 @@ public: } /*! \brief Conversion operator to const size_type *. - * + * * \returns a pointer to the size of the first dimension. */ - operator const size_type*() const { - return sizes_; + operator const size_type*() const { + return sizes_; } //! \brief Queries the number of dimensions in the range. - size_type dimensions() const - { - return dimensions_; + size_type dimensions() const + { + return dimensions_; } //! \brief Returns the size of the object in bytes based on the @@ -5603,7 +5603,7 @@ public: { return sizes_; } - + const size_type* get() const { return sizes_; @@ -5651,7 +5651,7 @@ struct KernelArgumentHandler static const void* ptr(const LocalSpaceArg&) { return NULL; } }; -} +} //! \endcond /*! Local @@ -5681,14 +5681,14 @@ public: Kernel() { } /*! \brief Constructor from cl_kernel - takes ownership. - * + * * \param retainObject will cause the constructor to retain its cl object. * Defaults to false to maintain compatibility with * earlier versions. * This effectively transfers ownership of a refcount on the cl_kernel * into the new Kernel object. */ - explicit Kernel(const cl_kernel& kernel, bool retainObject = false) : + explicit Kernel(const cl_kernel& kernel, bool retainObject = false) : detail::Wrapper(kernel, retainObject) { } /*! \brief Assignment operator from cl_kernel - takes ownership. @@ -5796,7 +5796,7 @@ public: } return param; } - + #if CL_HPP_TARGET_OPENCL_VERSION >= 200 #if defined(CL_HPP_USE_CL_SUB_GROUPS_KHR) cl_int getSubGroupInfo(const cl::Device &dev, cl_kernel_sub_group_info name, const cl::NDRange &range, size_type* param) const @@ -5880,7 +5880,7 @@ public: #if CL_HPP_TARGET_OPENCL_VERSION >= 200 /*! - * Specify a vector of SVM pointers that the kernel may access in + * Specify a vector of SVM pointers that the kernel may access in * addition to its arguments. */ cl_int setSVMPointers(const vector &pointerList) @@ -5912,7 +5912,7 @@ public: * * \note It is only possible to enable fine-grained system SVM if all devices * in the context associated with kernel support it. - * + * * \param svmEnabled True if fine-grained system SVM is requested. False otherwise. * \return CL_SUCCESS if the function was executed succesfully. CL_INVALID_OPERATION * if no devices in the context support fine-grained system SVM. @@ -5931,7 +5931,7 @@ public: ) ); } - + template void setSVMPointersHelper(std::array &pointerList, const pointer &t0, Ts... ts) { @@ -5946,7 +5946,7 @@ public: pointerList[index] = static_cast(t0); setSVMPointersHelper(ts...); } - + template void setSVMPointersHelper(std::array &pointerList, const pointer &t0) { @@ -5989,7 +5989,7 @@ public: typedef vector > Binaries; typedef vector > Sources; #endif // #if !defined(CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY) - + Program( const string& source, bool build = false, @@ -6057,7 +6057,7 @@ public: #endif // #if !defined(CL_HPP_CL_1_2_DEFAULT_BUILD) NULL, NULL); - + detail::buildErrHandler(error, __BUILD_PROGRAM_ERR, getBuildInfo()); } @@ -6149,7 +6149,7 @@ public: * Set to CL_INVALID_BINARY if the binary provided is not valid for the matching device. * \param err if non-NULL will be set to CL_SUCCESS on successful operation or one of the following errors: * CL_INVALID_CONTEXT if context is not a valid context. - * CL_INVALID_VALUE if the length of devices is zero; or if the length of binaries does not match the length of devices; + * CL_INVALID_VALUE if the length of devices is zero; or if the length of binaries does not match the length of devices; * or if any entry in binaries is NULL or has length 0. * CL_INVALID_DEVICE if OpenCL devices listed in devices are not in the list of devices associated with context. * CL_INVALID_BINARY if an invalid program binary was encountered for any device. binaryStatus will return specific status for each device. @@ -6163,9 +6163,9 @@ public: cl_int* err = NULL) { cl_int error; - + const size_type numDevices = devices.size(); - + // Catch size mismatch early and return if(binaries.size() != numDevices) { error = CL_INVALID_VALUE; @@ -6190,7 +6190,7 @@ public: lengths[i] = binaries[(int)i].second; } #endif // #if !defined(CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY) - + vector deviceIDs(numDevices); for( size_type deviceIndex = 0; deviceIndex < numDevices; ++deviceIndex ) { deviceIDs[deviceIndex] = (devices[deviceIndex])(); @@ -6199,7 +6199,7 @@ public: if(binaryStatus) { binaryStatus->resize(numDevices); } - + object_ = ::clCreateProgramWithBinary( context(), (cl_uint) devices.size(), deviceIDs.data(), @@ -6213,7 +6213,7 @@ public: } } - + #if CL_HPP_TARGET_OPENCL_VERSION >= 120 /** * Create program using builtin kernels. @@ -6233,12 +6233,12 @@ public: for( size_type deviceIndex = 0; deviceIndex < numDevices; ++deviceIndex ) { deviceIDs[deviceIndex] = (devices[deviceIndex])(); } - + object_ = ::clCreateProgramWithBuiltInKernels( - context(), + context(), (cl_uint) devices.size(), deviceIDs.data(), - kernelNames.c_str(), + kernelNames.c_str(), &error); detail::errHandler(error, __CREATE_PROGRAM_WITH_BUILT_IN_KERNELS_ERR); @@ -6249,7 +6249,7 @@ public: #endif // CL_HPP_TARGET_OPENCL_VERSION >= 120 Program() { } - + /*! \brief Constructor from cl_mem - takes ownership. * @@ -6257,7 +6257,7 @@ public: * Defaults to false to maintain compatibility with * earlier versions. */ - explicit Program(const cl_program& program, bool retainObject = false) : + explicit Program(const cl_program& program, bool retainObject = false) : detail::Wrapper(program, retainObject) { } Program& operator = (const cl_program& rhs) @@ -6302,7 +6302,7 @@ public: { size_type numDevices = devices.size(); vector deviceIDs(numDevices); - + for( size_type deviceIndex = 0; deviceIndex < numDevices; ++deviceIndex ) { deviceIDs[deviceIndex] = (devices[deviceIndex])(); } @@ -6399,9 +6399,9 @@ public: } return param; } - + /** - * Build info function that returns a vector of device/info pairs for the specified + * Build info function that returns a vector of device/info pairs for the specified * info type and for all devices in the program. * On an error reading the info for any device, an empty vector of info will be returned. */ @@ -6453,7 +6453,7 @@ public: } vector value(numKernels); - + err = ::clCreateKernelsInProgram( object_, numKernels, value.data(), NULL); if (err != CL_SUCCESS) { @@ -6466,7 +6466,7 @@ public: // Assign to param, constructing with retain behaviour // to correctly capture each underlying CL object for (size_type i = 0; i < value.size(); i++) { - // We do not need to retain because this kernel is being created + // We do not need to retain because this kernel is being created // by the runtime (*kernels)[i] = Kernel(value[i], false); } @@ -6482,7 +6482,7 @@ inline Program linkProgram( const char* options = NULL, void (CL_CALLBACK * notifyFptr)(cl_program, void *) = NULL, void* data = NULL, - cl_int* err = NULL) + cl_int* err = NULL) { cl_int error_local = CL_SUCCESS; @@ -6517,7 +6517,7 @@ inline Program linkProgram( const char* options = NULL, void (CL_CALLBACK * notifyFptr)(cl_program, void *) = NULL, void* data = NULL, - cl_int* err = NULL) + cl_int* err = NULL) { cl_int error_local = CL_SUCCESS; @@ -6526,7 +6526,7 @@ inline Program linkProgram( for (unsigned int i = 0; i < inputPrograms.size(); i++) { programs[i] = inputPrograms[i](); } - + Context ctx; if(inputPrograms.size() > 0) { ctx = inputPrograms[0].getInfo(&error_local); @@ -6682,7 +6682,7 @@ public: default_ = CommandQueue(); } #endif // #ifdef CL_HPP_UNIT_TEST_ENABLE - + /*! * \brief Constructs a CommandQueue based on passed properties. @@ -6855,7 +6855,7 @@ public: CL_QUEUE_PROPERTIES, static_cast(properties), 0 }; object_ = ::clCreateCommandQueueWithProperties( context(), devices[0](), queue_properties, &error); - + detail::errHandler(error, __CREATE_COMMAND_QUEUE_WITH_PROPERTIES_ERR); if (err != NULL) { *err = error; @@ -6889,7 +6889,7 @@ public: CL_QUEUE_PROPERTIES, properties, 0 }; object_ = ::clCreateCommandQueueWithProperties( context(), device(), queue_properties, &error); - + detail::errHandler(error, __CREATE_COMMAND_QUEUE_WITH_PROPERTIES_ERR); if (err != NULL) { *err = error; @@ -6922,7 +6922,7 @@ public: CL_QUEUE_PROPERTIES, static_cast(properties), 0 }; object_ = ::clCreateCommandQueueWithProperties( context(), device(), queue_properties, &error); - + detail::errHandler(error, __CREATE_COMMAND_QUEUE_WITH_PROPERTIES_ERR); if (err != NULL) { *err = error; @@ -6938,7 +6938,7 @@ public: #endif } - static CommandQueue getDefault(cl_int * err = NULL) + static CommandQueue getDefault(cl_int * err = NULL) { std::call_once(default_initialized_, makeDefault); #if CL_HPP_TARGET_OPENCL_VERSION >= 200 @@ -6975,7 +6975,7 @@ public: * Defaults to false to maintain compatibility with * earlier versions. */ - explicit CommandQueue(const cl_command_queue& commandQueue, bool retainObject = false) : + explicit CommandQueue(const cl_command_queue& commandQueue, bool retainObject = false) : detail::Wrapper(commandQueue, retainObject) { } CommandQueue& operator = (const cl_command_queue& rhs) @@ -7125,8 +7125,8 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueReadBufferRect( - object_, - buffer(), + object_, + buffer(), blocking, buffer_offset.data(), host_offset.data(), @@ -7164,8 +7164,8 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueWriteBufferRect( - object_, - buffer(), + object_, + buffer(), blocking, buffer_offset.data(), host_offset.data(), @@ -7202,9 +7202,9 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueCopyBufferRect( - object_, - src(), - dst(), + object_, + src(), + dst(), src_origin.data(), dst_origin.data(), region.data(), @@ -7227,10 +7227,10 @@ public: /** * Enqueue a command to fill a buffer object with a pattern * of a given size. The pattern is specified as a vector type. - * \tparam PatternType The datatype of the pattern field. + * \tparam PatternType The datatype of the pattern field. * The pattern type must be an accepted OpenCL data type. - * \tparam offset Is the offset in bytes into the buffer at - * which to start filling. This must be a multiple of + * \tparam offset Is the offset in bytes into the buffer at + * which to start filling. This must be a multiple of * the pattern size. * \tparam size Is the size in bytes of the region to fill. * This must be a multiple of the pattern size. @@ -7247,11 +7247,11 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueFillBuffer( - object_, + object_, buffer(), static_cast(&pattern), - sizeof(PatternType), - offset, + sizeof(PatternType), + offset, size, (events != NULL) ? (cl_uint) events->size() : 0, (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL, @@ -7279,13 +7279,13 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueReadImage( - object_, - image(), - blocking, + object_, + image(), + blocking, origin.data(), - region.data(), - row_pitch, - slice_pitch, + region.data(), + row_pitch, + slice_pitch, ptr, (events != NULL) ? (cl_uint) events->size() : 0, (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL, @@ -7312,13 +7312,13 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueWriteImage( - object_, - image(), - blocking, + object_, + image(), + blocking, origin.data(), - region.data(), - row_pitch, - slice_pitch, + region.data(), + row_pitch, + slice_pitch, ptr, (events != NULL) ? (cl_uint) events->size() : 0, (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL, @@ -7343,11 +7343,11 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueCopyImage( - object_, - src(), - dst(), + object_, + src(), + dst(), src_origin.data(), - dst_origin.data(), + dst_origin.data(), region.data(), (events != NULL) ? (cl_uint) events->size() : 0, (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL, @@ -7379,9 +7379,9 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueFillImage( - object_, + object_, image(), - static_cast(&fillColor), + static_cast(&fillColor), origin.data(), region.data(), (events != NULL) ? (cl_uint) events->size() : 0, @@ -7413,9 +7413,9 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueFillImage( - object_, + object_, image(), - static_cast(&fillColor), + static_cast(&fillColor), origin.data(), region.data(), (events != NULL) ? (cl_uint) events->size() : 0, @@ -7447,9 +7447,9 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueFillImage( - object_, + object_, image(), - static_cast(&fillColor), + static_cast(&fillColor), origin.data(), region.data(), (events != NULL) ? (cl_uint) events->size() : 0, @@ -7476,11 +7476,11 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueCopyImageToBuffer( - object_, - src(), - dst(), + object_, + src(), + dst(), src_origin.data(), - region.data(), + region.data(), dst_offset, (events != NULL) ? (cl_uint) events->size() : 0, (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL, @@ -7505,11 +7505,11 @@ public: cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueCopyBufferToImage( - object_, - src(), - dst(), + object_, + src(), + dst(), src_offset, - dst_origin.data(), + dst_origin.data(), region.data(), (events != NULL) ? (cl_uint) events->size() : 0, (events != NULL && events->size() > 0) ? (cl_event*) &events->front() : NULL, @@ -7567,7 +7567,7 @@ public: cl_int error; void * result = ::clEnqueueMapImage( object_, buffer(), blocking, flags, - origin.data(), + origin.data(), region.data(), row_pitch, slice_pitch, (events != NULL) ? (cl_uint) events->size() : 0, @@ -7768,14 +7768,14 @@ public: #if CL_HPP_TARGET_OPENCL_VERSION >= 120 /** - * Enqueues a marker command which waits for either a list of events to complete, + * Enqueues a marker command which waits for either a list of events to complete, * or all previously enqueued commands to complete. * - * Enqueues a marker command which waits for either a list of events to complete, - * or if the list is empty it waits for all commands previously enqueued in command_queue - * to complete before it completes. This command returns an event which can be waited on, - * i.e. this event can be waited on to insure that all events either in the event_wait_list - * or all previously enqueued commands, queued before this command to command_queue, + * Enqueues a marker command which waits for either a list of events to complete, + * or if the list is empty it waits for all commands previously enqueued in command_queue + * to complete before it completes. This command returns an event which can be waited on, + * i.e. this event can be waited on to insure that all events either in the event_wait_list + * or all previously enqueued commands, queued before this command to command_queue, * have completed. */ cl_int enqueueMarkerWithWaitList( @@ -7800,12 +7800,12 @@ public: /** * A synchronization point that enqueues a barrier operation. * - * Enqueues a barrier command which waits for either a list of events to complete, - * or if the list is empty it waits for all commands previously enqueued in command_queue - * to complete before it completes. This command blocks command execution, that is, any - * following commands enqueued after it do not execute until it completes. This command - * returns an event which can be waited on, i.e. this event can be waited on to insure that - * all events either in the event_wait_list or all previously enqueued commands, queued + * Enqueues a barrier command which waits for either a list of events to complete, + * or if the list is empty it waits for all commands previously enqueued in command_queue + * to complete before it completes. This command blocks command execution, that is, any + * following commands enqueued after it do not execute until it completes. This command + * returns an event which can be waited on, i.e. this event can be waited on to insure that + * all events either in the event_wait_list or all previously enqueued commands, queued * before this command to command_queue, have completed. */ cl_int enqueueBarrierWithWaitList( @@ -7826,7 +7826,7 @@ public: return err; } - + /** * Enqueues a command to indicate with which device a set of memory objects * should be associated. @@ -7839,7 +7839,7 @@ public: ) const { cl_event tmp; - + vector localMemObjects(memObjects.size()); for( int i = 0; i < (int)memObjects.size(); ++i ) { @@ -7849,8 +7849,8 @@ public: cl_int err = detail::errHandler( ::clEnqueueMigrateMemObjects( - object_, - (cl_uint)memObjects.size(), + object_, + (cl_uint)memObjects.size(), localMemObjects.data(), flags, (events != NULL) ? (cl_uint) events->size() : 0, @@ -7929,7 +7929,7 @@ public: for (unsigned int i = 0; i < elements; i++) { mems[i] = ((*mem_objects)[i])(); } - + cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueNativeKernel( @@ -7952,13 +7952,13 @@ public: * Deprecated APIs for 1.2 */ #if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) - CL_EXT_PREFIX__VERSION_1_1_DEPRECATED + CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int enqueueMarker(Event* event = NULL) const CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED { cl_event tmp; cl_int err = detail::errHandler( ::clEnqueueMarker( - object_, + object_, (event != NULL) ? &tmp : NULL), __ENQUEUE_MARKER_ERR); @@ -8049,7 +8049,7 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *PFN_clEnqueueReleaseD3D10ObjectsKHR)( #if CL_HPP_TARGET_OPENCL_VERSION >= 110 CL_HPP_INIT_CL_EXT_FCN_PTR_(clEnqueueAcquireD3D10ObjectsKHR); #endif - + cl_event tmp; cl_int err = detail::errHandler( pfn_clEnqueueAcquireD3D10ObjectsKHR( @@ -8217,7 +8217,7 @@ public: CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_ON_DEVICE | static_cast(properties); cl_queue_properties queue_properties[] = { CL_QUEUE_PROPERTIES, mergedProperties, - CL_QUEUE_SIZE, queueSize, + CL_QUEUE_SIZE, queueSize, 0 }; object_ = ::clCreateCommandQueueWithProperties( context(), device(), queue_properties, &error); @@ -8352,7 +8352,7 @@ public: } /*! - * Create a new default device command queue for the specified device + * Create a new default device command queue for the specified device * and of the requested size in bytes. * If there is already a default queue for the specified device this * function will return the pre-existing queue. @@ -8417,7 +8417,7 @@ Buffer::Buffer( if( useHostPtr ) { flags |= CL_MEM_USE_HOST_PTR; } - + size_type size = sizeof(DataType)*(endIterator - startIterator); if( useHostPtr ) { @@ -8590,7 +8590,7 @@ inline cl_int enqueueMapSVM( } /** - * Enqueues to the default queue a command that will allow the host to + * Enqueues to the default queue a command that will allow the host to * update a region of a coarse-grained SVM buffer. * This variant takes a cl::pointer instance. */ @@ -8668,7 +8668,7 @@ inline cl_int enqueueUnmapMemObject( #if CL_HPP_TARGET_OPENCL_VERSION >= 200 /** - * Enqueues to the default queue a command that will release a coarse-grained + * Enqueues to the default queue a command that will release a coarse-grained * SVM buffer back to the OpenCL runtime. * This variant takes a raw SVM pointer. */ @@ -8684,13 +8684,13 @@ inline cl_int enqueueUnmapSVM( return detail::errHandler(error, __ENQUEUE_UNMAP_MEM_OBJECT_ERR); } - return detail::errHandler(queue.enqueueUnmapSVM(ptr, events, event), + return detail::errHandler(queue.enqueueUnmapSVM(ptr, events, event), __ENQUEUE_UNMAP_MEM_OBJECT_ERR); } /** - * Enqueues to the default queue a command that will release a coarse-grained + * Enqueues to the default queue a command that will release a coarse-grained * SVM buffer back to the OpenCL runtime. * This variant takes a cl::pointer instance. */ @@ -8711,7 +8711,7 @@ inline cl_int enqueueUnmapSVM( } /** - * Enqueues to the default queue a command that will release a coarse-grained + * Enqueues to the default queue a command that will release a coarse-grained * SVM buffer back to the OpenCL runtime. * This variant takes a cl::vector instance. */ @@ -8794,11 +8794,11 @@ inline cl_int copy( const CommandQueue &queue, IteratorType startIterator, Itera { typedef typename std::iterator_traits::value_type DataType; cl_int error; - + size_type length = endIterator-startIterator; size_type byteLength = length*sizeof(DataType); - DataType *pointer = + DataType *pointer = 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 ) { @@ -8806,8 +8806,8 @@ inline cl_int copy( const CommandQueue &queue, IteratorType startIterator, Itera } #if defined(_MSC_VER) std::copy( - startIterator, - endIterator, + startIterator, + endIterator, stdext::checked_array_iterator( pointer, length)); #else @@ -8816,7 +8816,7 @@ inline cl_int copy( const CommandQueue &queue, IteratorType startIterator, Itera Event endEvent; error = queue.enqueueUnmapMemObject(buffer, pointer, 0, &endEvent); // if exceptions enabled, enqueueUnmapMemObject will throw - if( error != CL_SUCCESS ) { + if( error != CL_SUCCESS ) { return error; } endEvent.wait(); @@ -8833,11 +8833,11 @@ inline cl_int copy( const CommandQueue &queue, const cl::Buffer &buffer, Iterato { typedef typename std::iterator_traits::value_type DataType; cl_int error; - + size_type length = endIterator-startIterator; size_type byteLength = length*sizeof(DataType); - DataType *pointer = + DataType *pointer = 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 ) { @@ -8847,7 +8847,7 @@ inline cl_int copy( const CommandQueue &queue, const cl::Buffer &buffer, Iterato Event endEvent; error = queue.enqueueUnmapMemObject(buffer, pointer, 0, &endEvent); // if exceptions enabled, enqueueUnmapMemObject will throw - if( error != CL_SUCCESS ) { + if( error != CL_SUCCESS ) { return error; } endEvent.wait(); @@ -8899,17 +8899,17 @@ inline cl_int enqueueReadBufferRect( } return queue.enqueueReadBufferRect( - buffer, - blocking, - buffer_offset, + buffer, + blocking, + buffer_offset, host_offset, region, buffer_row_pitch, buffer_slice_pitch, host_row_pitch, host_slice_pitch, - ptr, - events, + ptr, + events, event); } @@ -8935,17 +8935,17 @@ inline cl_int enqueueWriteBufferRect( } return queue.enqueueWriteBufferRect( - buffer, - blocking, - buffer_offset, + buffer, + blocking, + buffer_offset, host_offset, region, buffer_row_pitch, buffer_slice_pitch, host_row_pitch, host_slice_pitch, - ptr, - events, + ptr, + events, event); } @@ -8979,7 +8979,7 @@ inline cl_int enqueueCopyBufferRect( src_slice_pitch, dst_row_pitch, dst_slice_pitch, - events, + events, event); } #endif // CL_HPP_TARGET_OPENCL_VERSION >= 110 @@ -8993,7 +8993,7 @@ inline cl_int enqueueReadImage( size_type slice_pitch, void* ptr, const vector* events = NULL, - Event* event = NULL) + Event* event = NULL) { cl_int error; CommandQueue queue = CommandQueue::getDefault(&error); @@ -9010,7 +9010,7 @@ inline cl_int enqueueReadImage( row_pitch, slice_pitch, ptr, - events, + events, event); } @@ -9040,7 +9040,7 @@ inline cl_int enqueueWriteImage( row_pitch, slice_pitch, ptr, - events, + events, event); } @@ -9142,7 +9142,7 @@ inline cl_int finish(void) if (error != CL_SUCCESS) { return error; - } + } return queue.finish(); @@ -9161,63 +9161,63 @@ private: friend class KernelFunctor; public: - EnqueueArgs(NDRange global) : + EnqueueArgs(NDRange global) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange) { } - EnqueueArgs(NDRange global, NDRange local) : + EnqueueArgs(NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local) { } - EnqueueArgs(NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(NDRange offset, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(offset), + offset_(offset), global_(global), local_(local) { } - EnqueueArgs(Event e, NDRange global) : + EnqueueArgs(Event e, NDRange global) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange) { events_.push_back(e); } - EnqueueArgs(Event e, NDRange global, NDRange local) : + EnqueueArgs(Event e, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local) { events_.push_back(e); } - EnqueueArgs(Event e, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(Event e, NDRange offset, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(offset), + offset_(offset), global_(global), local_(local) { events_.push_back(e); } - EnqueueArgs(const vector &events, NDRange global) : + EnqueueArgs(const vector &events, NDRange global) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange), events_(events) @@ -9225,9 +9225,9 @@ public: } - EnqueueArgs(const vector &events, NDRange global, NDRange local) : + EnqueueArgs(const vector &events, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local), events_(events) @@ -9235,9 +9235,9 @@ public: } - EnqueueArgs(const vector &events, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(const vector &events, NDRange offset, NDRange global, NDRange local) : queue_(CommandQueue::getDefault()), - offset_(offset), + offset_(offset), global_(global), local_(local), events_(events) @@ -9245,63 +9245,63 @@ public: } - EnqueueArgs(CommandQueue &queue, NDRange global) : + EnqueueArgs(CommandQueue &queue, NDRange global) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange) { } - EnqueueArgs(CommandQueue &queue, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, NDRange global, NDRange local) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local) { } - EnqueueArgs(CommandQueue &queue, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, NDRange offset, NDRange global, NDRange local) : queue_(queue), - offset_(offset), + offset_(offset), global_(global), local_(local) { } - EnqueueArgs(CommandQueue &queue, Event e, NDRange global) : + EnqueueArgs(CommandQueue &queue, Event e, NDRange global) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange) { events_.push_back(e); } - EnqueueArgs(CommandQueue &queue, Event e, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, Event e, NDRange global, NDRange local) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local) { events_.push_back(e); } - EnqueueArgs(CommandQueue &queue, Event e, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, Event e, NDRange offset, NDRange global, NDRange local) : queue_(queue), - offset_(offset), + offset_(offset), global_(global), local_(local) { events_.push_back(e); } - EnqueueArgs(CommandQueue &queue, const vector &events, NDRange global) : + EnqueueArgs(CommandQueue &queue, const vector &events, NDRange global) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(NullRange), events_(events) @@ -9309,9 +9309,9 @@ public: } - EnqueueArgs(CommandQueue &queue, const vector &events, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, const vector &events, NDRange global, NDRange local) : queue_(queue), - offset_(NullRange), + offset_(NullRange), global_(global), local_(local), events_(events) @@ -9319,9 +9319,9 @@ public: } - EnqueueArgs(CommandQueue &queue, const vector &events, NDRange offset, NDRange global, NDRange local) : + EnqueueArgs(CommandQueue &queue, const vector &events, NDRange offset, NDRange global, NDRange local) : queue_(queue), - offset_(offset), + offset_(offset), global_(global), local_(local), events_(events) @@ -9336,7 +9336,7 @@ public: /** * Type safe kernel functor. - * + * */ template class KernelFunctor @@ -9388,7 +9388,7 @@ public: { Event event; setArgs<0>(std::forward(ts)...); - + args.queue_.enqueueNDRangeKernel( kernel_, args.offset_, @@ -9421,7 +9421,7 @@ public: args.local_, &args.events_, &event); - + return event; } diff --git a/projects/clr/opencl/khronos/icd/README.md b/projects/clr/opencl/khronos/icd/README.md index 099f3a6cd4..852591c11d 100644 --- a/projects/clr/opencl/khronos/icd/README.md +++ b/projects/clr/opencl/khronos/icd/README.md @@ -97,7 +97,7 @@ On Windows, add the "stub" ICD by adding a `REG_DWORD` value to the registry key // For 32-bit operating systems, or 64-bit tests on a 64-bit operating system: HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\OpenCL\Vendors - + // For 32-bit tests on a 64-bit operating system: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Khronos\OpenCL\Vendors diff --git a/projects/clr/opencl/khronos/icd/loader/icd.c b/projects/clr/opencl/khronos/icd/loader/icd.c index ea8306ab1a..385e61c6c1 100644 --- a/projects/clr/opencl/khronos/icd/loader/icd.c +++ b/projects/clr/opencl/khronos/icd/loader/icd.c @@ -43,7 +43,7 @@ void khrIcdVendorAdd(const char *libraryName) KHRicdVendor *vendorIterator = NULL; // require that the library name be valid - if (!libraryName) + if (!libraryName) { goto Done; } @@ -136,7 +136,7 @@ void khrIcdVendorAdd(const char *libraryName) CL_PLATFORM_ICD_SUFFIX_KHR, suffixSize, suffix, - NULL); + NULL); if (CL_SUCCESS != result) { free(suffix); @@ -145,7 +145,7 @@ void khrIcdVendorAdd(const char *libraryName) // allocate a structure for the vendor vendor = (KHRicdVendor*)malloc(sizeof(*vendor) ); - if (!vendor) + if (!vendor) { free(suffix); KHR_ICD_TRACE("failed to allocate memory\n"); @@ -155,7 +155,7 @@ void khrIcdVendorAdd(const char *libraryName) // populate vendor data vendor->library = khrIcdOsLibraryLoad(libraryName); - if (!vendor->library) + if (!vendor->library) { free(suffix); free(vendor); diff --git a/projects/clr/opencl/khronos/icd/loader/icd_dispatch.c b/projects/clr/opencl/khronos/icd/loader/icd_dispatch.c index df967cb902..d37a1738bd 100644 --- a/projects/clr/opencl/khronos/icd/loader/icd_dispatch.c +++ b/projects/clr/opencl/khronos/icd/loader/icd_dispatch.c @@ -42,11 +42,11 @@ clGetPlatformIDs(cl_uint num_entries, return CL_INVALID_VALUE; } // set num_platforms to 0 and set all platform pointers to NULL - if (num_platforms) + if (num_platforms) { *num_platforms = 0; } - for (i = 0; i < num_entries && platforms; ++i) + for (i = 0; i < num_entries && platforms; ++i) { platforms[i] = NULL; } @@ -71,56 +71,56 @@ clGetPlatformIDs(cl_uint num_entries, return CL_SUCCESS; } -CL_API_ENTRY cl_int CL_API_CALL -clGetPlatformInfo(cl_platform_id platform, +CL_API_ENTRY cl_int CL_API_CALL +clGetPlatformInfo(cl_platform_id platform, cl_platform_info param_name, - size_t param_value_size, + size_t param_value_size, void * param_value, size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0 { // initialize the platforms (in case they have not been already) khrIcdInitialize(); - KHR_ICD_VALIDATE_HANDLE_RETURN_ERROR(platform, CL_INVALID_PLATFORM); + KHR_ICD_VALIDATE_HANDLE_RETURN_ERROR(platform, CL_INVALID_PLATFORM); return platform->dispatch->clGetPlatformInfo( platform, - param_name, - param_value_size, - param_value, + param_name, + param_value_size, + param_value, param_value_size_ret); } // Device APIs CL_API_ENTRY cl_int CL_API_CALL clGetDeviceIDs(cl_platform_id platform, - cl_device_type device_type, - cl_uint num_entries, - cl_device_id * devices, + cl_device_type device_type, + cl_uint num_entries, + cl_device_id * devices, cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_0 { // initialize the platforms (in case they have not been already) khrIcdInitialize(); - KHR_ICD_VALIDATE_HANDLE_RETURN_ERROR(platform, CL_INVALID_PLATFORM); + KHR_ICD_VALIDATE_HANDLE_RETURN_ERROR(platform, CL_INVALID_PLATFORM); return platform->dispatch->clGetDeviceIDs( platform, - device_type, - num_entries, - devices, + device_type, + num_entries, + devices, num_devices); } CL_API_ENTRY cl_int CL_API_CALL clGetDeviceInfo( cl_device_id device, - cl_device_info param_name, - size_t param_value_size, + cl_device_info param_name, + size_t param_value_size, void * param_value, size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0 { KHR_ICD_VALIDATE_HANDLE_RETURN_ERROR(device, CL_INVALID_DEVICE); return device->dispatch->clGetDeviceInfo( device, - param_name, - param_value_size, + param_name, + param_value_size, param_value, param_value_size_ret); } @@ -147,7 +147,7 @@ clRetainDevice(cl_device_id device) CL_API_SUFFIX__VERSION_1_2 KHR_ICD_VALIDATE_HANDLE_RETURN_ERROR(device, CL_INVALID_DEVICE); return device->dispatch->clRetainDevice(device); } - + CL_API_ENTRY cl_int CL_API_CALL clReleaseDevice(cl_device_id device) CL_API_SUFFIX__VERSION_1_2 { @@ -155,7 +155,7 @@ clReleaseDevice(cl_device_id device) CL_API_SUFFIX__VERSION_1_2 return device->dispatch->clReleaseDevice(device); } -// Context APIs +// Context APIs CL_API_ENTRY cl_context CL_API_CALL clCreateContext(const cl_context_properties * properties, cl_uint num_devices, @@ -166,9 +166,9 @@ clCreateContext(const cl_context_properties * properties, { // initialize the platforms (in case they have not been already) khrIcdInitialize(); - if (!num_devices || !devices) + if (!num_devices || !devices) { - if (errcode_ret) + if (errcode_ret) { *errcode_ret = CL_INVALID_VALUE; } @@ -224,32 +224,32 @@ clReleaseContext(cl_context context) CL_API_SUFFIX__VERSION_1_0 } CL_API_ENTRY cl_int CL_API_CALL -clGetContextInfo(cl_context context, - cl_context_info param_name, - size_t param_value_size, - void * param_value, +clGetContextInfo(cl_context context, + cl_context_info param_name, + size_t param_value_size, + void * param_value, size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0 { KHR_ICD_VALIDATE_HANDLE_RETURN_ERROR(context, CL_INVALID_CONTEXT); return context->dispatch->clGetContextInfo( - context, - param_name, - param_value_size, - param_value, + context, + param_name, + param_value_size, + param_value, param_value_size_ret); } // Command Queue APIs CL_API_ENTRY cl_command_queue CL_API_CALL -clCreateCommandQueue(cl_context context, - cl_device_id device, +clCreateCommandQueue(cl_context context, + cl_device_id device, cl_command_queue_properties properties, cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0 { KHR_ICD_VALIDATE_HANDLE_RETURN_HANDLE(context, CL_INVALID_CONTEXT); return context->dispatch->clCreateCommandQueue( - context, - device, + context, + device, properties, errcode_ret); } @@ -351,10 +351,10 @@ clGetSupportedImageFormats(cl_context context, image_formats, num_image_formats); } - + CL_API_ENTRY cl_int CL_API_CALL clGetMemObjectInfo(cl_mem memobj, - cl_mem_info param_name, + cl_mem_info param_name, size_t param_value_size, void * param_value, size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0 @@ -362,7 +362,7 @@ clGetMemObjectInfo(cl_mem memobj, KHR_ICD_VALIDATE_HANDLE_RETURN_ERROR(memobj, CL_INVALID_MEM_OBJECT); return memobj->dispatch->clGetMemObjectInfo( memobj, - param_name, + param_name, param_value_size, param_value, param_value_size_ret); @@ -370,7 +370,7 @@ clGetMemObjectInfo(cl_mem memobj, CL_API_ENTRY cl_int CL_API_CALL clGetImageInfo(cl_mem image, - cl_image_info param_name, + cl_image_info param_name, size_t param_value_size, void * param_value, size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0 @@ -378,7 +378,7 @@ clGetImageInfo(cl_mem image, KHR_ICD_VALIDATE_HANDLE_RETURN_ERROR(image, CL_INVALID_MEM_OBJECT); return image->dispatch->clGetImageInfo( image, - param_name, + param_name, param_value_size, param_value, param_value_size_ret); @@ -387,16 +387,16 @@ clGetImageInfo(cl_mem image, // Sampler APIs CL_API_ENTRY cl_sampler CL_API_CALL clCreateSampler(cl_context context, - cl_bool normalized_coords, - cl_addressing_mode addressing_mode, + cl_bool normalized_coords, + cl_addressing_mode addressing_mode, cl_filter_mode filter_mode, cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0 { KHR_ICD_VALIDATE_HANDLE_RETURN_HANDLE(context, CL_INVALID_CONTEXT); return context->dispatch->clCreateSampler( context, - normalized_coords, - addressing_mode, + normalized_coords, + addressing_mode, filter_mode, errcode_ret); } @@ -430,7 +430,7 @@ clGetSamplerInfo(cl_sampler sampler, param_value, param_value_size_ret); } - + // Program Object APIs CL_API_ENTRY cl_program CL_API_CALL clCreateProgramWithSource(cl_context context, @@ -502,7 +502,7 @@ CL_API_ENTRY cl_int CL_API_CALL clBuildProgram(cl_program program, cl_uint num_devices, const cl_device_id * device_list, - const char * options, + const char * options, void (CL_CALLBACK *pfn_notify)(cl_program program, void * user_data), void * user_data) CL_API_SUFFIX__VERSION_1_0 { @@ -511,16 +511,16 @@ clBuildProgram(cl_program program, program, num_devices, device_list, - options, + options, pfn_notify, - user_data); + user_data); } CL_API_ENTRY cl_int CL_API_CALL clCompileProgram(cl_program program, cl_uint num_devices, const cl_device_id * device_list, - const char * options, + const char * options, cl_uint num_input_headers, const cl_program * input_headers, const char ** header_include_names, @@ -532,12 +532,12 @@ clCompileProgram(cl_program program, program, num_devices, device_list, - options, + options, num_input_headers, input_headers, header_include_names, pfn_notify, - user_data); + user_data); } CL_API_ENTRY cl_program CL_API_CALL @@ -556,12 +556,12 @@ clLinkProgram(cl_context context, context, num_devices, device_list, - options, + options, num_input_programs, input_programs, pfn_notify, user_data, - errcode_ret); + errcode_ret); } CL_API_ENTRY cl_int CL_API_CALL @@ -575,7 +575,7 @@ clSetProgramSpecializationConstant(cl_program program, program, spec_id, spec_size, - spec_value); + spec_value); } CL_API_ENTRY cl_int CL_API_CALL @@ -587,7 +587,7 @@ clSetProgramReleaseCallback(cl_program program, return program->dispatch->clSetProgramReleaseCallback( program, pfn_notify, - user_data); + user_data); } CL_API_ENTRY cl_int CL_API_CALL @@ -595,7 +595,7 @@ clUnloadPlatformCompiler(cl_platform_id platform) CL_API_SUFFIX__VERSION_1_2 { // initialize the platforms (in case they have not been already) khrIcdInitialize(); - KHR_ICD_VALIDATE_HANDLE_RETURN_ERROR(platform, CL_INVALID_PLATFORM); + KHR_ICD_VALIDATE_HANDLE_RETURN_ERROR(platform, CL_INVALID_PLATFORM); return platform->dispatch->clUnloadPlatformCompiler(platform); } @@ -632,7 +632,7 @@ clGetProgramBuildInfo(cl_program program, param_value, param_value_size_ret); } - + // Kernel Object APIs CL_API_ENTRY cl_kernel CL_API_CALL clCreateKernel(cl_program program, @@ -745,9 +745,9 @@ CL_API_ENTRY cl_int CL_API_CALL clWaitForEvents(cl_uint num_events, const cl_event * event_list) CL_API_SUFFIX__VERSION_1_0 { - if (!num_events || !event_list) + if (!num_events || !event_list) { - return CL_INVALID_VALUE; + return CL_INVALID_VALUE; } KHR_ICD_VALIDATE_HANDLE_RETURN_ERROR(event_list[0], CL_INVALID_EVENT); return event_list[0]->dispatch->clWaitForEvents( @@ -770,7 +770,7 @@ clGetEventInfo(cl_event event, param_value, param_value_size_ret); } - + CL_API_ENTRY cl_int CL_API_CALL clRetainEvent(cl_event event) CL_API_SUFFIX__VERSION_1_0 { @@ -801,7 +801,7 @@ clGetEventProfilingInfo(cl_event event, param_value, param_value_size_ret); } - + // Flush and Finish APIs CL_API_ENTRY cl_int CL_API_CALL clFlush(cl_command_queue command_queue) CL_API_SUFFIX__VERSION_1_0 @@ -823,7 +823,7 @@ clEnqueueReadBuffer(cl_command_queue command_queue, cl_mem buffer, cl_bool blocking_read, size_t offset, - size_t cb, + size_t cb, void * ptr, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, @@ -835,25 +835,25 @@ clEnqueueReadBuffer(cl_command_queue command_queue, buffer, blocking_read, offset, - cb, + cb, ptr, num_events_in_wait_list, event_wait_list, event); } - + CL_API_ENTRY cl_int CL_API_CALL clEnqueueReadBufferRect( cl_command_queue command_queue, cl_mem buffer, cl_bool blocking_read, const size_t * buffer_origin, - const size_t * host_origin, + const size_t * host_origin, const size_t * region, size_t buffer_row_pitch, size_t buffer_slice_pitch, size_t host_row_pitch, - size_t host_slice_pitch, + size_t host_slice_pitch, void * ptr, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, @@ -865,12 +865,12 @@ clEnqueueReadBufferRect( buffer, blocking_read, buffer_origin, - host_origin, + host_origin, region, buffer_row_pitch, buffer_slice_pitch, host_row_pitch, - host_slice_pitch, + host_slice_pitch, ptr, num_events_in_wait_list, event_wait_list, @@ -878,41 +878,41 @@ clEnqueueReadBufferRect( } CL_API_ENTRY cl_int CL_API_CALL -clEnqueueWriteBuffer(cl_command_queue command_queue, - cl_mem buffer, - cl_bool blocking_write, - size_t offset, - size_t cb, - const void * ptr, - cl_uint num_events_in_wait_list, - const cl_event * event_wait_list, +clEnqueueWriteBuffer(cl_command_queue command_queue, + cl_mem buffer, + cl_bool blocking_write, + size_t offset, + size_t cb, + const void * ptr, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, cl_event * event) CL_API_SUFFIX__VERSION_1_0 { KHR_ICD_VALIDATE_HANDLE_RETURN_ERROR(command_queue, CL_INVALID_COMMAND_QUEUE); return command_queue->dispatch->clEnqueueWriteBuffer( - command_queue, - buffer, - blocking_write, - offset, - cb, - ptr, - num_events_in_wait_list, - event_wait_list, + command_queue, + buffer, + blocking_write, + offset, + cb, + ptr, + num_events_in_wait_list, + event_wait_list, event); } - + CL_API_ENTRY cl_int CL_API_CALL clEnqueueWriteBufferRect( cl_command_queue command_queue, cl_mem buffer, cl_bool blocking_read, const size_t * buffer_origin, - const size_t * host_origin, + const size_t * host_origin, const size_t * region, size_t buffer_row_pitch, size_t buffer_slice_pitch, size_t host_row_pitch, - size_t host_slice_pitch, + size_t host_slice_pitch, const void * ptr, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, @@ -924,12 +924,12 @@ clEnqueueWriteBufferRect( buffer, blocking_read, buffer_origin, - host_origin, + host_origin, region, buffer_row_pitch, buffer_slice_pitch, host_row_pitch, - host_slice_pitch, + host_slice_pitch, ptr, num_events_in_wait_list, event_wait_list, @@ -938,47 +938,47 @@ clEnqueueWriteBufferRect( CL_API_ENTRY cl_int CL_API_CALL clEnqueueFillBuffer(cl_command_queue command_queue, - cl_mem buffer, - const void * pattern, - size_t pattern_size, - size_t offset, - size_t cb, - cl_uint num_events_in_wait_list, - const cl_event * event_wait_list, + cl_mem buffer, + const void * pattern, + size_t pattern_size, + size_t offset, + size_t cb, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, cl_event * event) CL_API_SUFFIX__VERSION_1_2 { KHR_ICD_VALIDATE_HANDLE_RETURN_ERROR(command_queue, CL_INVALID_COMMAND_QUEUE); return command_queue->dispatch->clEnqueueFillBuffer( - command_queue, + command_queue, buffer, - pattern, + pattern, pattern_size, offset, - cb, + cb, num_events_in_wait_list, event_wait_list, event); } CL_API_ENTRY cl_int CL_API_CALL -clEnqueueCopyBuffer(cl_command_queue command_queue, +clEnqueueCopyBuffer(cl_command_queue command_queue, cl_mem src_buffer, - cl_mem dst_buffer, + cl_mem dst_buffer, size_t src_offset, size_t dst_offset, - size_t cb, + size_t cb, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event) CL_API_SUFFIX__VERSION_1_0 { KHR_ICD_VALIDATE_HANDLE_RETURN_ERROR(command_queue, CL_INVALID_COMMAND_QUEUE); return command_queue->dispatch->clEnqueueCopyBuffer( - command_queue, + command_queue, src_buffer, - dst_buffer, + dst_buffer, src_offset, dst_offset, - cb, + cb, num_events_in_wait_list, event_wait_list, event); @@ -986,12 +986,12 @@ clEnqueueCopyBuffer(cl_command_queue command_queue, CL_API_ENTRY cl_int CL_API_CALL clEnqueueCopyBufferRect( - cl_command_queue command_queue, + cl_command_queue command_queue, cl_mem src_buffer, - cl_mem dst_buffer, + cl_mem dst_buffer, const size_t * src_origin, const size_t * dst_origin, - const size_t * region, + const size_t * region, size_t src_row_pitch, size_t src_slice_pitch, size_t dst_row_pitch, @@ -1002,12 +1002,12 @@ clEnqueueCopyBufferRect( { KHR_ICD_VALIDATE_HANDLE_RETURN_ERROR(command_queue, CL_INVALID_COMMAND_QUEUE); return command_queue->dispatch->clEnqueueCopyBufferRect( - command_queue, + command_queue, src_buffer, - dst_buffer, + dst_buffer, src_origin, dst_origin, - region, + region, src_row_pitch, src_slice_pitch, dst_row_pitch, @@ -1020,11 +1020,11 @@ clEnqueueCopyBufferRect( CL_API_ENTRY cl_int CL_API_CALL clEnqueueReadImage(cl_command_queue command_queue, cl_mem image, - cl_bool blocking_read, + cl_bool blocking_read, const size_t * origin, const size_t * region, size_t row_pitch, - size_t slice_pitch, + size_t slice_pitch, void * ptr, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, @@ -1034,11 +1034,11 @@ clEnqueueReadImage(cl_command_queue command_queue, return command_queue->dispatch->clEnqueueReadImage( command_queue, image, - blocking_read, + blocking_read, origin, region, row_pitch, - slice_pitch, + slice_pitch, ptr, num_events_in_wait_list, event_wait_list, @@ -1048,11 +1048,11 @@ clEnqueueReadImage(cl_command_queue command_queue, CL_API_ENTRY cl_int CL_API_CALL clEnqueueWriteImage(cl_command_queue command_queue, cl_mem image, - cl_bool blocking_write, + cl_bool blocking_write, const size_t * origin, const size_t * region, size_t input_row_pitch, - size_t input_slice_pitch, + size_t input_slice_pitch, const void * ptr, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, @@ -1062,11 +1062,11 @@ clEnqueueWriteImage(cl_command_queue command_queue, return command_queue->dispatch->clEnqueueWriteImage( command_queue, image, - blocking_write, + blocking_write, origin, region, input_row_pitch, - input_slice_pitch, + input_slice_pitch, ptr, num_events_in_wait_list, event_wait_list, @@ -1077,19 +1077,19 @@ CL_API_ENTRY cl_int CL_API_CALL clEnqueueFillImage(cl_command_queue command_queue, cl_mem image, const void * fill_color, - const size_t origin[3], + const size_t origin[3], const size_t region[3], cl_uint num_events_in_wait_list, - const cl_event * event_wait_list, + const cl_event * event_wait_list, cl_event * event) CL_API_SUFFIX__VERSION_1_2 { KHR_ICD_VALIDATE_HANDLE_RETURN_ERROR(command_queue, CL_INVALID_COMMAND_QUEUE); return command_queue->dispatch->clEnqueueFillImage( command_queue, image, - fill_color, + fill_color, origin, - region, + region, num_events_in_wait_list, event_wait_list, event); @@ -1098,10 +1098,10 @@ clEnqueueFillImage(cl_command_queue command_queue, CL_API_ENTRY cl_int CL_API_CALL clEnqueueCopyImage(cl_command_queue command_queue, cl_mem src_image, - cl_mem dst_image, + cl_mem dst_image, const size_t * src_origin, const size_t * dst_origin, - const size_t * region, + const size_t * region, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event) CL_API_SUFFIX__VERSION_1_0 @@ -1110,10 +1110,10 @@ clEnqueueCopyImage(cl_command_queue command_queue, return command_queue->dispatch->clEnqueueCopyImage( command_queue, src_image, - dst_image, + dst_image, src_origin, dst_origin, - region, + region, num_events_in_wait_list, event_wait_list, event); @@ -1122,9 +1122,9 @@ clEnqueueCopyImage(cl_command_queue command_queue, CL_API_ENTRY cl_int CL_API_CALL clEnqueueCopyImageToBuffer(cl_command_queue command_queue, cl_mem src_image, - cl_mem dst_buffer, + cl_mem dst_buffer, const size_t * src_origin, - const size_t * region, + const size_t * region, size_t dst_offset, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, @@ -1134,9 +1134,9 @@ clEnqueueCopyImageToBuffer(cl_command_queue command_queue, return command_queue->dispatch->clEnqueueCopyImageToBuffer( command_queue, src_image, - dst_buffer, + dst_buffer, src_origin, - region, + region, dst_offset, num_events_in_wait_list, event_wait_list, @@ -1146,10 +1146,10 @@ clEnqueueCopyImageToBuffer(cl_command_queue command_queue, CL_API_ENTRY cl_int CL_API_CALL clEnqueueCopyBufferToImage(cl_command_queue command_queue, cl_mem src_buffer, - cl_mem dst_image, + cl_mem dst_image, size_t src_offset, const size_t * dst_origin, - const size_t * region, + const size_t * region, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event) CL_API_SUFFIX__VERSION_1_0 @@ -1158,10 +1158,10 @@ clEnqueueCopyBufferToImage(cl_command_queue command_queue, return command_queue->dispatch->clEnqueueCopyBufferToImage( command_queue, src_buffer, - dst_image, + dst_image, src_offset, dst_origin, - region, + region, num_events_in_wait_list, event_wait_list, event); @@ -1170,7 +1170,7 @@ clEnqueueCopyBufferToImage(cl_command_queue command_queue, CL_API_ENTRY void * CL_API_CALL clEnqueueMapBuffer(cl_command_queue command_queue, cl_mem buffer, - cl_bool blocking_map, + cl_bool blocking_map, cl_map_flags map_flags, size_t offset, size_t cb, @@ -1183,7 +1183,7 @@ clEnqueueMapBuffer(cl_command_queue command_queue, return command_queue->dispatch->clEnqueueMapBuffer( command_queue, buffer, - blocking_map, + blocking_map, map_flags, offset, cb, @@ -1195,9 +1195,9 @@ clEnqueueMapBuffer(cl_command_queue command_queue, CL_API_ENTRY void * CL_API_CALL clEnqueueMapImage(cl_command_queue command_queue, - cl_mem image, - cl_bool blocking_map, - cl_map_flags map_flags, + cl_mem image, + cl_bool blocking_map, + cl_map_flags map_flags, const size_t * origin, const size_t * region, size_t * image_row_pitch, @@ -1210,9 +1210,9 @@ clEnqueueMapImage(cl_command_queue command_queue, KHR_ICD_VALIDATE_HANDLE_RETURN_HANDLE(command_queue, CL_INVALID_COMMAND_QUEUE); return command_queue->dispatch->clEnqueueMapImage( command_queue, - image, - blocking_map, - map_flags, + image, + blocking_map, + map_flags, origin, region, image_row_pitch, @@ -1303,9 +1303,9 @@ clEnqueueTask(cl_command_queue command_queue, CL_API_ENTRY cl_int CL_API_CALL clEnqueueNativeKernel(cl_command_queue command_queue, - void (CL_CALLBACK * user_func)(void *), + void (CL_CALLBACK * user_func)(void *), void * args, - size_t cb_args, + size_t cb_args, cl_uint num_mem_objects, const cl_mem * mem_list, const void ** args_mem_loc, @@ -1316,9 +1316,9 @@ clEnqueueNativeKernel(cl_command_queue command_queue, KHR_ICD_VALIDATE_HANDLE_RETURN_ERROR(command_queue, CL_INVALID_COMMAND_QUEUE); return command_queue->dispatch->clEnqueueNativeKernel( command_queue, - user_func, + user_func, args, - cb_args, + cb_args, num_mem_objects, mem_list, args_mem_loc, @@ -1362,7 +1362,7 @@ clGetExtensionFunctionAddressForPlatform(cl_platform_id platform, KHR_ICD_VALIDATE_HANDLE_RETURN_ERROR(function_name, NULL); // make sure the ICD is initialized - khrIcdInitialize(); + khrIcdInitialize(); // return any ICD-aware extensions @@ -1442,18 +1442,18 @@ clGetExtensionFunctionAddressForPlatform(cl_platform_id platform, // Deprecated APIs CL_API_ENTRY cl_int CL_API_CALL clSetCommandQueueProperty(cl_command_queue command_queue, - cl_command_queue_properties properties, + cl_command_queue_properties properties, cl_bool enable, cl_command_queue_properties * old_properties) CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED { KHR_ICD_VALIDATE_HANDLE_RETURN_ERROR(command_queue, CL_INVALID_COMMAND_QUEUE); return command_queue->dispatch->clSetCommandQueueProperty( command_queue, - properties, + properties, enable, old_properties); } - + CL_API_ENTRY cl_int CL_API_CALL clCreateSubDevicesEXT( cl_device_id in_device, @@ -1491,7 +1491,7 @@ clCreateImage2D(cl_context context, const cl_image_format * image_format, size_t image_width, size_t image_height, - size_t image_row_pitch, + size_t image_row_pitch, void * host_ptr, cl_int * errcode_ret) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED { @@ -1502,7 +1502,7 @@ clCreateImage2D(cl_context context, image_format, image_width, image_height, - image_row_pitch, + image_row_pitch, host_ptr, errcode_ret); } @@ -1511,11 +1511,11 @@ CL_API_ENTRY cl_mem CL_API_CALL clCreateImage3D(cl_context context, cl_mem_flags flags, const cl_image_format * image_format, - size_t image_width, + size_t image_width, size_t image_height, - size_t image_depth, - size_t image_row_pitch, - size_t image_slice_pitch, + size_t image_depth, + size_t image_row_pitch, + size_t image_slice_pitch, void * host_ptr, cl_int * errcode_ret) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED { @@ -1524,11 +1524,11 @@ clCreateImage3D(cl_context context, context, flags, image_format, - image_width, + image_width, image_height, - image_depth, - image_row_pitch, - image_slice_pitch, + image_depth, + image_row_pitch, + image_slice_pitch, host_ptr, errcode_ret); } @@ -1577,7 +1577,7 @@ clGetExtensionFunctionAddress(const char *function_name) CL_EXT_SUFFIX__VERSION_ KHR_ICD_VALIDATE_HANDLE_RETURN_ERROR(function_name, NULL); // make sure the ICD is initialized - khrIcdInitialize(); + khrIcdInitialize(); function_name_length = strlen(function_name); // return any ICD-aware extensions @@ -1651,7 +1651,7 @@ clGetExtensionFunctionAddress(const char *function_name) CL_EXT_SUFFIX__VERSION_ { size_t vendor_suffix_length = strlen(vendor->suffix); if (vendor_suffix_length <= function_name_length && vendor_suffix_length > 0) - { + { const char *function_suffix = function_name+function_name_length-vendor_suffix_length; if (!strcmp(function_suffix, vendor->suffix) ) { @@ -1756,7 +1756,7 @@ CL_API_ENTRY cl_int CL_API_CALL clGetGLObjectInfo( gl_object_type, gl_object_name); } - + CL_API_ENTRY cl_int CL_API_CALL clGetGLTextureInfo( cl_mem memobj, cl_gl_texture_info param_name, @@ -1824,7 +1824,7 @@ CL_API_ENTRY cl_int CL_API_CALL clGetGLContextInfoKHR( // determine the platform to use from the properties specified khrIcdContextPropertiesGetPlatform(properties, &platform); - KHR_ICD_VALIDATE_HANDLE_RETURN_ERROR(platform, CL_INVALID_PLATFORM); + KHR_ICD_VALIDATE_HANDLE_RETURN_ERROR(platform, CL_INVALID_PLATFORM); return platform->dispatch->clGetGLContextInfoKHR( properties, param_name, @@ -1858,8 +1858,8 @@ clGetDeviceIDsFromD3D10KHR( cl_d3d10_device_source_khr d3d_device_source, void *d3d_object, cl_d3d10_device_set_khr d3d_device_set, - cl_uint num_entries, - cl_device_id *devices, + cl_uint num_entries, + cl_device_id *devices, cl_uint *num_devices) { KHR_ICD_VALIDATE_HANDLE_RETURN_ERROR(platform, CL_INVALID_PLATFORM); @@ -1868,17 +1868,17 @@ clGetDeviceIDsFromD3D10KHR( d3d_device_source, d3d_object, d3d_device_set, - num_entries, - devices, + num_entries, + devices, num_devices); } - -CL_API_ENTRY cl_mem CL_API_CALL + +CL_API_ENTRY cl_mem CL_API_CALL clCreateFromD3D10BufferKHR( cl_context context, cl_mem_flags flags, ID3D10Buffer *resource, - cl_int *errcode_ret) + cl_int *errcode_ret) { KHR_ICD_VALIDATE_HANDLE_RETURN_HANDLE(context, CL_INVALID_CONTEXT); return context->dispatch->clCreateFromD3D10BufferKHR( @@ -1905,7 +1905,7 @@ clCreateFromD3D10Texture2DKHR( errcode_ret); } -CL_API_ENTRY cl_mem CL_API_CALL +CL_API_ENTRY cl_mem CL_API_CALL clCreateFromD3D10Texture3DKHR( cl_context context, cl_mem_flags flags, @@ -1919,17 +1919,17 @@ clCreateFromD3D10Texture3DKHR( flags, resource, subresource, - errcode_ret); + errcode_ret); } -CL_API_ENTRY cl_int CL_API_CALL +CL_API_ENTRY cl_int CL_API_CALL clEnqueueAcquireD3D10ObjectsKHR( 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_event *event) { KHR_ICD_VALIDATE_HANDLE_RETURN_ERROR(command_queue, CL_INVALID_COMMAND_QUEUE); return command_queue->dispatch->clEnqueueAcquireD3D10ObjectsKHR( @@ -1941,14 +1941,14 @@ clEnqueueAcquireD3D10ObjectsKHR( event); } -CL_API_ENTRY cl_int CL_API_CALL +CL_API_ENTRY cl_int CL_API_CALL clEnqueueReleaseD3D10ObjectsKHR( 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_event *event) { KHR_ICD_VALIDATE_HANDLE_RETURN_ERROR(command_queue, CL_INVALID_COMMAND_QUEUE); return command_queue->dispatch->clEnqueueReleaseD3D10ObjectsKHR( @@ -1957,7 +1957,7 @@ clEnqueueReleaseD3D10ObjectsKHR( mem_objects, num_events_in_wait_list, event_wait_list, - event); + event); } /* @@ -2109,7 +2109,7 @@ clCreateFromDX9MediaSurfaceKHR( cl_mem_flags flags, cl_dx9_media_adapter_type_khr adapter_type, void * surface_info, - cl_uint plane, + cl_uint plane, cl_int * errcode_ret) { KHR_ICD_VALIDATE_HANDLE_RETURN_HANDLE(context, CL_INVALID_CONTEXT); @@ -2118,7 +2118,7 @@ clCreateFromDX9MediaSurfaceKHR( flags, adapter_type, surface_info, - plane, + plane, errcode_ret); } @@ -2162,7 +2162,7 @@ clEnqueueReleaseDX9MediaSurfacesKHR( #endif -CL_API_ENTRY cl_int CL_API_CALL +CL_API_ENTRY cl_int CL_API_CALL clSetEventCallback( cl_event event, cl_int command_exec_callback_type, @@ -2196,13 +2196,13 @@ clCreateSubBuffer( CL_API_ENTRY cl_int CL_API_CALL clSetMemObjectDestructorCallback( - cl_mem memobj, - void (CL_CALLBACK * pfn_notify)( cl_mem, void*), + cl_mem memobj, + void (CL_CALLBACK * pfn_notify)( cl_mem, void*), void * user_data ) CL_API_SUFFIX__VERSION_1_1 { KHR_ICD_VALIDATE_HANDLE_RETURN_ERROR(memobj, CL_INVALID_MEM_OBJECT); return memobj->dispatch->clSetMemObjectDestructorCallback( - memobj, + memobj, pfn_notify, user_data); } diff --git a/projects/clr/opencl/khronos/icd/loader/linux/icd_linux.c b/projects/clr/opencl/khronos/icd/loader/linux/icd_linux.c index efd6d57999..e4798063f7 100644 --- a/projects/clr/opencl/khronos/icd/loader/linux/icd_linux.c +++ b/projects/clr/opencl/khronos/icd/loader/linux/icd_linux.c @@ -30,7 +30,7 @@ static pthread_once_t initialized = PTHREAD_ONCE_INIT; /* - * + * * Vendor enumeration functions * */ @@ -52,7 +52,7 @@ void khrIcdOsVendorsEnumerate(void) } dir = opendir(vendorPath); - if (NULL == dir) + if (NULL == dir) { KHR_ICD_TRACE("Failed to open path %s, continuing\n", vendorPath); } @@ -150,7 +150,7 @@ void khrIcdOsVendorsEnumerateOnce(void) } /* - * + * * Dynamic library loading functions * */ diff --git a/projects/clr/opencl/khronos/icd/loader/windows/icd_windows.c b/projects/clr/opencl/khronos/icd/loader/windows/icd_windows.c index 1350f118cc..9b2ce0296b 100644 --- a/projects/clr/opencl/khronos/icd/loader/windows/icd_windows.c +++ b/projects/clr/opencl/khronos/icd/loader/windows/icd_windows.c @@ -96,12 +96,12 @@ void adapterFree(WinAdapter *pWinAdapter) } /* - * + * * Vendor enumeration functions * */ -// go through the list of vendors in the registry and call khrIcdVendorAdd +// go through the list of vendors in the registry and call khrIcdVendorAdd // for each vendor encountered BOOL CALLBACK khrIcdOsVendorsEnumerate(PINIT_ONCE InitOnce, PVOID Parameter, PVOID *lpContext) { @@ -164,7 +164,7 @@ BOOL CALLBACK khrIcdOsVendorsEnumerate(PINIT_ONCE InitOnce, PVOID Parameter, PVO break; } KHR_ICD_TRACE("Value %s found...\n", cszLibraryName); - + // Require that the value be a DWORD and equal zero if (REG_DWORD != dwLibraryNameType) { @@ -243,9 +243,9 @@ void khrIcdOsVendorsEnumerateOnce() { InitOnceExecuteOnce(&initialized, khrIcdOsVendorsEnumerate, NULL, NULL); } - + /* - * + * * Dynamic library loading functions * */ diff --git a/projects/clr/opencl/khronos/icd/test/driver_stub/cl.c b/projects/clr/opencl/khronos/icd/test/driver_stub/cl.c index 802192348b..5e6ee92d5e 100644 --- a/projects/clr/opencl/khronos/icd/test/driver_stub/cl.c +++ b/projects/clr/opencl/khronos/icd/test/driver_stub/cl.c @@ -88,7 +88,7 @@ clGetPlatformIDs(cl_uint num_entries , platforms, num_platforms); return_value = clIcdGetPlatformIDsKHR(num_entries, platforms, num_platforms); - test_icd_stub_log("Value returned: %d\n", return_value); + test_icd_stub_log("Value returned: %d\n", return_value); return return_value; } @@ -102,11 +102,11 @@ clGetPlatformInfo(cl_platform_id platform, cl_int ret = CL_SUCCESS; const char *returnString = NULL; size_t returnStringLength = 0; - /*test_icd_stub_log("clGetPlatformInfo(%p, %u, %u, %p, %p)\n", - platform, - param_name, - param_value_size, - param_value, + /*test_icd_stub_log("clGetPlatformInfo(%p, %u, %u, %p, %p)\n", + platform, + param_name, + param_value_size, + param_value, param_value_size_ret);*/ // validate the arguments @@ -306,13 +306,13 @@ clCreateContextFromType(const cl_context_properties * properties, errcode_ret); pfn_notify(NULL, NULL, 0, NULL); - test_icd_stub_log ("createcontext_callback(%p, %p, %u, %p)\n", - NULL, - NULL, - 0, + test_icd_stub_log ("createcontext_callback(%p, %p, %u, %p)\n", + NULL, + NULL, + 0, NULL); - - test_icd_stub_log("Value returned: %p\n", + + test_icd_stub_log("Value returned: %p\n", obj); return obj; } diff --git a/projects/clr/opencl/khronos/icd/test/driver_stub/cl_ext.c b/projects/clr/opencl/khronos/icd/test/driver_stub/cl_ext.c index ece0c591b2..a979b37a3b 100644 --- a/projects/clr/opencl/khronos/icd/test/driver_stub/cl_ext.c +++ b/projects/clr/opencl/khronos/icd/test/driver_stub/cl_ext.c @@ -4,7 +4,7 @@ #include "CL/cl.h" #include "CL/cl_ext.h" -struct driverStubextFunc_st +struct driverStubextFunc_st { const char *name; void *func; @@ -12,7 +12,7 @@ struct driverStubextFunc_st #define EXT_FUNC(name) { #name, (void*)(name) } -static struct driverStubextFunc_st clExtensions[] = +static struct driverStubextFunc_st clExtensions[] = { EXT_FUNC(clIcdGetPlatformIDsKHR), }; @@ -23,7 +23,7 @@ CL_API_ENTRY void * CL_API_CALL clGetExtensionFunctionAddress(const char *name) { int ii; - + for (ii = 0; ii < clExtensionCount; ii++) { if (!strcmp(name, clExtensions[ii].name)) { return clExtensions[ii].func; diff --git a/projects/clr/opencl/khronos/icd/test/driver_stub/cl_gl.c b/projects/clr/opencl/khronos/icd/test/driver_stub/cl_gl.c index 3cc5cbb80a..aa8fd5ad35 100644 --- a/projects/clr/opencl/khronos/icd/test/driver_stub/cl_gl.c +++ b/projects/clr/opencl/khronos/icd/test/driver_stub/cl_gl.c @@ -13,14 +13,14 @@ clCreateFromGLBuffer(cl_context context , cl_mem_flags flags , cl_GLuint bufret_mem , int * errcode_ret ) CL_API_SUFFIX__VERSION_1_0 -{ - cl_mem ret_mem = (cl_mem)(SIZE_T_MAX); +{ + cl_mem ret_mem = (cl_mem)(SIZE_T_MAX); test_icd_stub_log("clCreateFromGLBuffer(%p, %x, %u, %p)\n", context, flags, - bufret_mem, + bufret_mem, errcode_ret); - test_icd_stub_log("Value returned: %p\n", + test_icd_stub_log("Value returned: %p\n", ret_mem); return ret_mem; } @@ -33,7 +33,7 @@ clCreateFromGLTexture(cl_context context , cl_GLuint texture , cl_int * errcode_ret ) CL_API_SUFFIX__VERSION_1_2 { - cl_mem ret_mem = (cl_mem)(SIZE_T_MAX); + cl_mem ret_mem = (cl_mem)(SIZE_T_MAX); test_icd_stub_log("clCreateFromGLTexture(%p, %x, %d, %d, %u, %p)\n", context , flags , @@ -41,7 +41,7 @@ clCreateFromGLTexture(cl_context context , miplevel , texture , errcode_ret ); - test_icd_stub_log("Value returned: %p\n", + test_icd_stub_log("Value returned: %p\n", ret_mem); return ret_mem; } @@ -54,7 +54,7 @@ clCreateFromGLTexture2D(cl_context context, cl_GLuint texture, cl_int * errcode_ret ) CL_API_SUFFIX__VERSION_1_0 { - cl_mem ret_mem = (cl_mem)(SIZE_T_MAX); + cl_mem ret_mem = (cl_mem)(SIZE_T_MAX); test_icd_stub_log("clCreateFromGLTexture2D(%p, %x, %d, %d, %u, %p)\n", context, flags, @@ -62,7 +62,7 @@ clCreateFromGLTexture2D(cl_context context, miplevel, texture, errcode_ret ); - test_icd_stub_log("Value returned: %p\n", + test_icd_stub_log("Value returned: %p\n", ret_mem); return ret_mem; } @@ -76,7 +76,7 @@ clCreateFromGLTexture3D(cl_context context, cl_int * errcode_ret ) CL_API_SUFFIX__VERSION_1_0 { - cl_mem ret_mem = (cl_mem)(SIZE_T_MAX); + cl_mem ret_mem = (cl_mem)(SIZE_T_MAX); test_icd_stub_log("clCreateFromGLTexture3D(%p, %x, %d, %d, %u, %p)\n", context, flags, @@ -84,7 +84,7 @@ clCreateFromGLTexture3D(cl_context context, miplevel, texture, errcode_ret ); - test_icd_stub_log("Value returned: %p\n", + test_icd_stub_log("Value returned: %p\n", ret_mem); return ret_mem; } @@ -95,13 +95,13 @@ clCreateFromGLRenderbuffer(cl_context context, cl_GLuint renderbuffer, cl_int * errcode_ret ) CL_API_SUFFIX__VERSION_1_0 { - cl_mem ret_mem = (cl_mem)(SIZE_T_MAX); + cl_mem ret_mem = (cl_mem)(SIZE_T_MAX); test_icd_stub_log("clCreateFromGLRenderbuffer(%p, %x, %d, %p)\n", context, flags, renderbuffer, errcode_ret); - test_icd_stub_log("Value returned: %p\n", + test_icd_stub_log("Value returned: %p\n", ret_mem); return ret_mem; } @@ -110,13 +110,13 @@ CL_API_ENTRY cl_int CL_API_CALL clGetGLObjectInfo(cl_mem memobj, cl_gl_object_type * gl_object_type, cl_GLuint * gl_object_name ) CL_API_SUFFIX__VERSION_1_0 -{ +{ cl_int ret_val = -5; test_icd_stub_log("clGetGLObjectInfo(%p, %p, %p)\n", memobj, gl_object_type, gl_object_name); - test_icd_stub_log("Value returned: %p\n", + test_icd_stub_log("Value returned: %p\n", ret_val); return ret_val; } @@ -135,7 +135,7 @@ clGetGLTextureInfo(cl_mem memobj, param_value_size, param_value, param_value_size_ret ); - test_icd_stub_log("Value returned: %p\n", + test_icd_stub_log("Value returned: %p\n", ret_val); return ret_val; } @@ -157,7 +157,7 @@ clEnqueueAcquireGLObjects(cl_command_queue command_queue, event_wait_list, event); - test_icd_stub_log("Value returned: %p\n", + test_icd_stub_log("Value returned: %p\n", ret_val); return ret_val; } @@ -178,8 +178,8 @@ clEnqueueReleaseGLObjects(cl_command_queue command_queue, mem_objects, num_events_in_wait_list, event_wait_list, - event); - test_icd_stub_log("Value returned: %p\n", + event); + test_icd_stub_log("Value returned: %p\n", ret_val); return ret_val; } @@ -199,7 +199,7 @@ clGetGLContextInfoKHR(const cl_context_properties * properties, param_value, param_value_size_ret); - test_icd_stub_log("Value returned: %p\n", + test_icd_stub_log("Value returned: %p\n", ret_val); return ret_val; } @@ -215,7 +215,7 @@ clCreateEventFromGLsyncKHR(cl_context context , context, cl_GLsync, errcode_ret); - test_icd_stub_log("Value returned: %p\n", + test_icd_stub_log("Value returned: %p\n", ret_event); return ret_event; } diff --git a/projects/clr/opencl/khronos/icd/test/driver_stub/icd.c b/projects/clr/opencl/khronos/icd/test/driver_stub/icd.c index d2b1b2bd09..760a88790b 100644 --- a/projects/clr/opencl/khronos/icd/test/driver_stub/icd.c +++ b/projects/clr/opencl/khronos/icd/test/driver_stub/icd.c @@ -21,7 +21,7 @@ */ extern CL_API_ENTRY cl_int CL_API_CALL clSetCommandQueueProperty(cl_command_queue /* command_queue */, - cl_command_queue_properties /* properties */, + cl_command_queue_properties /* properties */, cl_bool /* enable */, cl_command_queue_properties * /* old_properties */); @@ -152,7 +152,7 @@ cl_int cliIcdDispatchTableCreate(CLIicdDispatchTable **outDispatchTable) ICD_DISPATCH_TABLE_ENTRY ( /*clRetainDeviceEXT*/ NULL); ICD_DISPATCH_TABLE_ENTRY ( /*clReleaseDevice*/NULL); - ICD_DISPATCH_TABLE_ENTRY ( clCreateEventFromGLsyncKHR); + ICD_DISPATCH_TABLE_ENTRY ( clCreateEventFromGLsyncKHR); ICD_DISPATCH_TABLE_ENTRY ( clCreateSubDevices); ICD_DISPATCH_TABLE_ENTRY ( clRetainDevice); diff --git a/projects/clr/opencl/khronos/icd/test/loader_test/callbacks.c b/projects/clr/opencl/khronos/icd/test/loader_test/callbacks.c index 8e0b4934bc..edbedf4d42 100644 --- a/projects/clr/opencl/khronos/icd/test/loader_test/callbacks.c +++ b/projects/clr/opencl/khronos/icd/test/loader_test/callbacks.c @@ -4,40 +4,40 @@ void CL_CALLBACK createcontext_callback(const char* _a, const void* _b, size_t _c, void* _d) { - test_icd_app_log("createcontext_callback(%p, %p, %u, %p)\n", - _a, - _b, - _c, + test_icd_app_log("createcontext_callback(%p, %p, %u, %p)\n", + _a, + _b, + _c, _d); } void CL_CALLBACK setmemobjectdestructor_callback(cl_mem _a, void* _b) { - test_icd_app_log("setmemobjectdestructor_callback(%p, %p)\n", - _a, + test_icd_app_log("setmemobjectdestructor_callback(%p, %p)\n", + _a, _b); } void CL_CALLBACK program_callback(cl_program _a, void* _b) { - test_icd_app_log("program_callback(%p, %p)\n", - _a, + test_icd_app_log("program_callback(%p, %p)\n", + _a, _b); } void CL_CALLBACK setevent_callback(cl_event _a, cl_int _b, void* _c) { - test_icd_app_log("setevent_callback(%p, %d, %p)\n", - _a, - _b, + test_icd_app_log("setevent_callback(%p, %d, %p)\n", + _a, + _b, _c); } void CL_CALLBACK setprintf_callback(cl_context _a, cl_uint _b, char* _c, void* _d ) { - test_icd_app_log("setprintf_callback(%p, %u, %p, %p)\n", - _a, - _b, - _c, + test_icd_app_log("setprintf_callback(%p, %u, %p, %p)\n", + _a, + _b, + _c, _d); } diff --git a/projects/clr/opencl/khronos/icd/test/loader_test/main.c b/projects/clr/opencl/khronos/icd/test/loader_test/main.c index 1d783d16bf..373e745fb3 100644 --- a/projects/clr/opencl/khronos/icd/test/loader_test/main.c +++ b/projects/clr/opencl/khronos/icd/test/loader_test/main.c @@ -34,7 +34,7 @@ int main(int argc, char **argv) test_icd_close_app_log(); test_icd_close_stub_log(); - + if (test_icd_match()) { printf("ICD Loader Test FAILED\n"); return 1; diff --git a/projects/clr/opencl/khronos/icd/test/loader_test/test_cl_runtime.c b/projects/clr/opencl/khronos/icd/test/loader_test/test_cl_runtime.c index c6b3522303..c2bec977e7 100644 --- a/projects/clr/opencl/khronos/icd/test/loader_test/test_cl_runtime.c +++ b/projects/clr/opencl/khronos/icd/test/loader_test/test_cl_runtime.c @@ -40,7 +40,7 @@ int test_clGetCommandQueueInfo(const struct clGetCommandQueueInfo_st *data) data->param_value_size, data->param_value, data->param_value_size_ret); - + test_icd_app_log("Value returned: %d\n", ret_val); return 0; @@ -54,7 +54,7 @@ int test_cl_runtime() for (i=0; iflags, - data->bufobj, + data->bufobj, data->errcode_ret); ret_mem = clCreateFromGLBuffer(context, data->flags, - data->bufobj, - data->errcode_ret); + data->bufobj, + data->errcode_ret); test_icd_app_log("Value returned: %p\n", ret_mem); - + return 0; } @@ -46,21 +46,21 @@ int test_clCreateFromGLTexture(const struct clCreateFromGLTexture_st* data) { test_icd_app_log("clCreateFromGLTexture(%p, %x, %d, %d, %u, %p)\n", context, - data->flags, + data->flags, data->texture_target, - data->miplevel, - data->texture, + data->miplevel, + data->texture, data->errcode_ret); ret_mem = clCreateFromGLTexture(context, - data->flags, + data->flags, data->texture_target, - data->miplevel, - data->texture, + data->miplevel, + data->texture, data->errcode_ret); test_icd_app_log("Value returned: %p\n", ret_mem); - + return 0; } @@ -72,21 +72,21 @@ int test_clCreateFromGLTexture2D(const struct clCreateFromGLTexture2D_st* data) { test_icd_app_log("clCreateFromGLTexture2D(%p, %x, %d, %d, %u, %p)\n", context, - data->flags, + data->flags, data->texture_target, - data->miplevel, - data->texture, + data->miplevel, + data->texture, data->errcode_ret); ret_mem = clCreateFromGLTexture2D(context, - data->flags, + data->flags, data->texture_target, - data->miplevel, - data->texture, + data->miplevel, + data->texture, data->errcode_ret); test_icd_app_log("Value returned: %p\n", ret_mem); - + return 0; } @@ -95,21 +95,21 @@ struct clCreateFromGLTexture3D_st clCreateFromGLTexture3DData[NUM_ITEMS_clCreate }; int test_clCreateFromGLTexture3D(const struct clCreateFromGLTexture3D_st* data) -{ +{ test_icd_app_log("clCreateFromGLTexture3D(%p, %x, %d, %d, %u, %p)\n", context, data->flags, data->texture_target, - data->miplevel, - data->texture, + data->miplevel, + data->texture, data->errcode_ret); ret_mem = clCreateFromGLTexture3D(context, - data->flags, + data->flags, data->texture_target, - data->miplevel, - data->texture, - data->errcode_ret); + data->miplevel, + data->texture, + data->errcode_ret); test_icd_app_log("Value returned: %p\n", ret_mem); @@ -123,14 +123,14 @@ struct clCreateFromGLRenderbuffer_st clCreateFromGLRenderbufferData[NUM_ITEMS_cl int test_clCreateFromGLRenderbuffer(const struct clCreateFromGLRenderbuffer_st* data) { test_icd_app_log("clCreateFromGLRenderbuffer(%p, %x, %d, %p)\n", - context, + context, data->flags, - data->renderbuffer, + data->renderbuffer, data->errcode_ret); - ret_mem = clCreateFromGLRenderbuffer(context, + ret_mem = clCreateFromGLRenderbuffer(context, data->flags, - data->renderbuffer, + data->renderbuffer, data->errcode_ret); test_icd_app_log("Value returned: %p\n", ret_mem); @@ -146,15 +146,15 @@ int test_clGetGLObjectInfo(const struct clGetGLObjectInfo_st* data) { test_icd_app_log("clGetGLObjectInfo(%p, %p, %p)\n", buffer, - data->gl_object_type, + data->gl_object_type, data->gl_object_name); ret_val = clGetGLObjectInfo(buffer, - data->gl_object_type, + data->gl_object_type, data->gl_object_name); test_icd_app_log("Value returned: %p\n", ret_val); - + return ret_val; } @@ -168,13 +168,13 @@ int test_clGetGLTextureInfo(const struct clGetGLTextureInfo_st* data) test_icd_app_log("clGetGLTextureInfo(%p, %u, %u, %p, %p)\n", buffer, data->param_name, - data->param_value_size, + data->param_value_size, data->param_value, data->param_value_size_ret); ret_val = clGetGLTextureInfo (buffer, data->param_name, - data->param_value_size, + data->param_value_size, data->param_value, data->param_value_size_ret); @@ -191,17 +191,17 @@ int test_clEnqueueAcquireGLObjects(const struct clEnqueueAcquireGLObjects_st* da { test_icd_app_log("clEnqueueAcquireGLObjects(%p, %u, %p, %u, %p, %p)\n", command_queue, - data->num_objects, + data->num_objects, data->mem_objects, data->num_events_in_wait_list, &event, &event); ret_val = clEnqueueAcquireGLObjects (command_queue, - data->num_objects, + data->num_objects, data->mem_objects, data->num_events_in_wait_list, - &event, + &event, &event); test_icd_app_log("Value returned: %p\n", ret_val); @@ -217,17 +217,17 @@ int test_clEnqueueReleaseGLObjects(const struct clEnqueueReleaseGLObjects_st* da { test_icd_app_log("clEnqueueReleaseGLObjects(%p, %u, %p, %u, %p, %p)\n", command_queue, - data->num_objects, + data->num_objects, data->mem_objects, data->num_events_in_wait_list, - &event, + &event, &event); ret_val = clEnqueueReleaseGLObjects (command_queue, - data->num_objects, + data->num_objects, data->mem_objects, data->num_events_in_wait_list, - &event, + &event, &event); @@ -250,8 +250,8 @@ int test_clCreateEventFromGLsyncKHR(const struct clCreateEventFromGLsyncKHR_st* PFN_clCreateEventFromGLsyncKHR pfn_clCreateEventFromGLsyncKHR = NULL; test_icd_app_log("clCreateEventFromGLsyncKHR(%p, %p, %p)\n", - context, - data->sync, + context, + data->sync, data->errcode_ret); pfn_clCreateEventFromGLsyncKHR = clGetExtensionFunctionAddress("clCreateEventFromGLsyncKHR"); @@ -260,8 +260,8 @@ int test_clCreateEventFromGLsyncKHR(const struct clCreateEventFromGLsyncKHR_st* return 1; } - ret_event = pfn_clCreateEventFromGLsyncKHR (context, - data->sync, + ret_event = pfn_clCreateEventFromGLsyncKHR (context, + data->sync, data->errcode_ret); test_icd_app_log("Value returned: %p\n", ret_event); @@ -278,14 +278,14 @@ typedef CL_API_ENTRY cl_int size_t /* param_value_size */, void * /* param_value */, size_t * /* param_value_size_ret */); - + int test_clGetGLContextInfoKHR(const struct clGetGLContextInfoKHR_st* data) { PFN_clGetGLContextInfoKHR pfn_clGetGLContextInfoKHR = NULL; test_icd_app_log("clGetGLContextInfoKHR(%p, %u, %u, %p, %p)\n", context_properties, data->param_name, - data->param_value_size, + data->param_value_size, data->param_value, data->param_value_size_ret); @@ -297,7 +297,7 @@ int test_clGetGLContextInfoKHR(const struct clGetGLContextInfoKHR_st* data) ret_val = pfn_clGetGLContextInfoKHR(context_properties, data->param_name, - data->param_value_size, + data->param_value_size, data->param_value, data->param_value_size_ret); @@ -309,7 +309,7 @@ int test_clGetGLContextInfoKHR(const struct clGetGLContextInfoKHR_st* data) int test_OpenGL_share() { int i; - + for(i=0;inum_entries, - &platforms, + &platforms, &num_platforms); #endif ret_val = clGetPlatformIDs(0, NULL, &num_platforms); - + if (ret_val != CL_SUCCESS){ return -1; } - + all_platforms = (cl_platform_id *) malloc (num_platforms * sizeof(cl_platform_id)); ret_val = clGetPlatformIDs(num_platforms, - all_platforms, - NULL); - + all_platforms, + NULL); + if (ret_val != CL_SUCCESS){ return -1; } - + for (i = 0; i < num_platforms; i++) { ret_val = clGetPlatformInfo(all_platforms[i], CL_PLATFORM_NAME, PLATFORM_NAME_SIZE, (void*)platform_name, - ¶m_val_ret_size ); + ¶m_val_ret_size ); if (ret_val == CL_SUCCESS ){ if(!strcmp(platform_name, "ICD_LOADER_TEST_OPENCL_STUB")) { - platform = all_platforms[i]; + platform = all_platforms[i]; } } } @@ -195,15 +195,15 @@ int test_clGetDeviceIDs(const struct clGetDeviceIDs_st* data) test_icd_app_log("clGetDeviceIDs(%p, %x, %u, %p, %p)\n", platform, - data->device_type, + data->device_type, data->num_entries, - &devices, - data->num_devices); - + &devices, + data->num_devices); + ret_val = clGetDeviceIDs(platform, - data->device_type, + data->device_type, data->num_entries, - &devices, + &devices, data->num_devices); test_icd_app_log("Value returned: %d\n", ret_val); @@ -215,14 +215,14 @@ int test_clGetDeviceIDs(const struct clGetDeviceIDs_st* data) int test_clCreateContext(const struct clCreateContext_st* data) { test_icd_app_log("clCreateContext(%p, %u, %p, %p, %p, %p)\n", - data->properties, + data->properties, data->num_devices, - &devices, + &devices, &createcontext_callback, data->user_data, data->errcode_ret); - context = clCreateContext(data->properties, + context = clCreateContext(data->properties, data->num_devices, &devices, &createcontext_callback, @@ -238,15 +238,15 @@ int test_clCreateContext(const struct clCreateContext_st* data) int test_clCreateContextFromType(const struct clCreateContextFromType_st* data) { test_icd_app_log("clCreateContextFromType(%p, %x, %p, %p, %p)\n", - context_properties, - data->device_type, + context_properties, + data->device_type, data->pfn_notify, data->user_data, data->errcode_ret); - - context = clCreateContextFromType(context_properties, - data->device_type, + + context = clCreateContextFromType(context_properties, + data->device_type, data->pfn_notify, data->user_data, data->errcode_ret); @@ -281,16 +281,16 @@ int test_clCreateBuffer(const struct clCreateBuffer_st *data) test_icd_app_log("clCreateBuffer(%p, %x, %u, %p, %p)\n", context, data->flags, - data->size, + data->size, data->host_ptr, data->errcode_ret); buffer = clCreateBuffer(context, data->flags, - data->size, + data->size, data->host_ptr, data->errcode_ret); - + clReleaseMemObjectData->memobj = buffer; test_icd_app_log("Value returned: %p\n", buffer); @@ -327,18 +327,18 @@ int test_clCreateImage(const struct clCreateImage_st *data) test_icd_app_log("clCreateImage(%p, %x, %p, %p, %p, %p)\n", context, data->flags, - data->image_format, + data->image_format, data->image_desc, data->host_ptr, data->errcode_ret); image = clCreateImage(context, data->flags, - data->image_format, + data->image_format, data->image_desc, data->host_ptr, data->errcode_ret); - + clReleaseMemObjectDataImage[0].memobj = image; test_icd_app_log("Value returned: %p\n", image); @@ -351,7 +351,7 @@ int test_clCreateImage2D(const struct clCreateImage2D_st *data) test_icd_app_log("clCreateImage2D(%p, %x, %p, %u, %u, %u, %p, %p)\n", context, data->flags, - data->image_format, + data->image_format, data->image_width, data->image_height, data->image_row_pitch, @@ -360,16 +360,16 @@ int test_clCreateImage2D(const struct clCreateImage2D_st *data) image = clCreateImage2D(context, data->flags, - data->image_format, + data->image_format, data->image_width, data->image_height, data->image_row_pitch, data->host_ptr, data->errcode_ret); - + clReleaseMemObjectDataImage[0].memobj = image; test_icd_app_log("Value returned: %p\n", image); - + return 0; } @@ -379,7 +379,7 @@ int test_clCreateImage3D(const struct clCreateImage3D_st *data) test_icd_app_log("clCreateImage3D(%p, %x, %p, %u, %u, %u, %u, %u, %p, %p)\n", context, data->flags, - data->image_format, + data->image_format, data->image_width, data->image_height, data->image_depth, @@ -390,7 +390,7 @@ int test_clCreateImage3D(const struct clCreateImage3D_st *data) image = clCreateImage3D(context, data->flags, - data->image_format, + data->image_format, data->image_width, data->image_height, data->image_depth, @@ -398,7 +398,7 @@ int test_clCreateImage3D(const struct clCreateImage3D_st *data) data->image_slice_pitch, data->host_ptr, data->errcode_ret); - + clReleaseMemObjectDataImage[0].memobj = image; test_icd_app_log("Value returned: %p\n", image); @@ -458,7 +458,7 @@ int test_clCreateProgramWithBinary(const struct clCreateProgramWithBinary_st *da data->binaries, data->binary_status, data->errcode_ret); - + program = clCreateProgramWithBinary(context, data->num_devices, &devices, @@ -560,7 +560,7 @@ int test_clReleaseSampler(const struct clReleaseSampler_st *data) ret_val = clReleaseSampler(sampler); test_icd_app_log("Value returned: %d\n", ret_val); - + return 0; } @@ -604,7 +604,7 @@ const struct clReleaseKernel_st clReleaseKernelData[NUM_ITEMS_clReleaseKernel] = int test_clReleaseKernel(const struct clReleaseKernel_st* data) { - int ret_val = CL_OUT_OF_RESOURCES; + int ret_val = CL_OUT_OF_RESOURCES; test_icd_app_log("clReleaseKernel(%p)\n", kernel); @@ -661,10 +661,10 @@ const struct clReleaseContext_st clReleaseContextData[NUM_ITEMS_clReleaseContext int test_clReleaseContext(const struct clReleaseContext_st* data) { - int ret_val = CL_OUT_OF_RESOURCES; + int ret_val = CL_OUT_OF_RESOURCES; test_icd_app_log("clReleaseContext(%p)\n", context); - + ret_val = clReleaseContext(context); test_icd_app_log("Value returned: %d\n", ret_val); @@ -682,9 +682,9 @@ int test_clReleaseDevice(const struct clReleaseDevice_st* data) { int ret_val = CL_OUT_OF_RESOURCES; - test_icd_app_log("clReleaseDevice(%p)\n", devices); - - ret_val = clReleaseDevice(devices); + test_icd_app_log("clReleaseDevice(%p)\n", devices); + + ret_val = clReleaseDevice(devices); test_icd_app_log("Value returned: %d\n", ret_val); @@ -700,7 +700,7 @@ int test_create_calls() test_clGetDeviceIDs(clGetDeviceIDsData); - test_clCreateContext(clCreateContextData); + test_clCreateContext(clCreateContextData); test_clReleaseContext(clReleaseContextData); diff --git a/projects/clr/opencl/khronos/icd/test/loader_test/test_image_objects.c b/projects/clr/opencl/khronos/icd/test/loader_test/test_image_objects.c index fda0ff6f9b..4c8b278701 100644 --- a/projects/clr/opencl/khronos/icd/test/loader_test/test_image_objects.c +++ b/projects/clr/opencl/khronos/icd/test/loader_test/test_image_objects.c @@ -66,7 +66,7 @@ int test_clGetSupportedImageFormats(const struct clGetSupportedImageFormats_st * data->num_entries, data->image_formats, data->num_image_formats); - + ret_val = clGetSupportedImageFormats(context, data->flags, data->image_type, @@ -182,7 +182,7 @@ int test_clEnqueueReadImage(const struct clEnqueueReadImage_st *data) command_queue, image, data->blocking_read, - data->origin, + data->origin, data->region, data->row_pitch, data->slice_pitch, @@ -195,11 +195,11 @@ int test_clEnqueueReadImage(const struct clEnqueueReadImage_st *data) image, data->blocking_read, data->origin, - data->region, - data->row_pitch, - data->slice_pitch, - data->ptr, - data->num_events_in_wait_list, + data->region, + data->row_pitch, + data->slice_pitch, + data->ptr, + data->num_events_in_wait_list, data->event_wait_list, &event); @@ -251,16 +251,16 @@ int test_clEnqueueFillImage(const struct clEnqueueFillImage_st *data) data->origin, data->region, data->num_events_in_wait_list, - data->event_wait_list, + data->event_wait_list, &event); ret_val = clEnqueueFillImage(command_queue, - image, + image, data->fill_color, data->origin, data->region, data->num_events_in_wait_list, - data->event_wait_list, + data->event_wait_list, &event); test_icd_app_log("Value returned: %d\n", ret_val); @@ -278,7 +278,7 @@ int test_clEnqueueCopyImage(const struct clEnqueueCopyImage_st *data) data->dst_origin, data->region, data->num_events_in_wait_list, - data->event_wait_list, + data->event_wait_list, &event); ret_val = clEnqueueCopyImage(command_queue, @@ -288,7 +288,7 @@ int test_clEnqueueCopyImage(const struct clEnqueueCopyImage_st *data) data->dst_origin, data->region, data->num_events_in_wait_list, - data->event_wait_list, + data->event_wait_list, &event); test_icd_app_log("Value returned: %d\n", ret_val); diff --git a/projects/clr/opencl/khronos/icd/test/loader_test/test_kernel.c b/projects/clr/opencl/khronos/icd/test/loader_test/test_kernel.c index be116edb31..1453e3f878 100644 --- a/projects/clr/opencl/khronos/icd/test/loader_test/test_kernel.c +++ b/projects/clr/opencl/khronos/icd/test/loader_test/test_kernel.c @@ -27,11 +27,11 @@ struct clRetainKernel_st clRetainKernelData[NUM_ITEMS_clRetainKernel] = int test_clRetainKernel(const struct clRetainKernel_st* data) { test_icd_app_log("clRetainKernel(%p)\n", kernel); - + ret_val=clRetainKernel(kernel); - + test_icd_app_log("Value returned: %d\n", ret_val); - + return 0; } @@ -43,18 +43,18 @@ struct clSetKernelArg_st clSetKernelArgData[NUM_ITEMS_clSetKernelArg] = int test_clSetKernelArg(const struct clSetKernelArg_st* data) { test_icd_app_log("clSetKernelArg(%p, %u, %u, %p)\n", - kernel, - data->arg_index, + kernel, + data->arg_index, data->arg_size, data->arg_value); - - ret_val=clSetKernelArg(kernel, - data->arg_index, + + ret_val=clSetKernelArg(kernel, + data->arg_index, data->arg_size, data->arg_value); - + test_icd_app_log("Value returned: %d\n", ret_val); - + return 0; } @@ -67,19 +67,19 @@ int test_clGetKernelInfo(const struct clGetKernelInfo_st* data) { test_icd_app_log("clGetKernelInfo(%p, %u, %u, %p, %p)\n", kernel, - data->param_name, + data->param_name, data->param_value_size, - data->param_value, + data->param_value, data->param_value_size_ret); ret_val=clGetKernelInfo(kernel, - data->param_name, + data->param_name, data->param_value_size, - data->param_value, + data->param_value, data->param_value_size_ret); - + test_icd_app_log("Value returned: %d\n", ret_val); - + return 0; } @@ -91,14 +91,14 @@ struct clGetKernelArgInfo_st clGetKernelArgInfoData[NUM_ITEMS_clGetKernelArgInfo int test_clGetKernelArgInfo(const struct clGetKernelArgInfo_st* data) { test_icd_app_log("clGetKernelArgInfo(%p, %u, %u, %u, %p, %p)\n", - kernel, + kernel, data->arg_indx, data->param_name, data->param_value_size, data->param_value, data->param_value_size_ret); - ret_val=clGetKernelArgInfo(kernel, + ret_val=clGetKernelArgInfo(kernel, data->arg_indx, data->param_name, data->param_value_size, @@ -118,14 +118,14 @@ struct clGetKernelWorkGroupInfo_st clGetKernelWorkGroupInfoData[NUM_ITEMS_clGetK int test_clGetKernelWorkGroupInfo(const struct clGetKernelWorkGroupInfo_st* data) { test_icd_app_log("clGetKernelWorkGroupInfo(%p, %p, %u, %u, %p, %p)\n", - kernel, + kernel, devices, data->param_name, data->param_value_size, data->param_value, data->param_value_size_ret); - ret_val=clGetKernelWorkGroupInfo(kernel, + ret_val=clGetKernelWorkGroupInfo(kernel, devices, data->param_name, data->param_value_size, @@ -146,7 +146,7 @@ int test_clEnqueueMigrateMemObjects(const struct clEnqueueMigrateMemObjects_st* { test_icd_app_log("clEnqueueMigrateMemObjects(%p, %u, %p, %x, %u, %p, %p)\n", command_queue, - data->num_mem_objects, + data->num_mem_objects, data->mem_objects, data->flags, data->num_events_in_wait_list, @@ -154,7 +154,7 @@ int test_clEnqueueMigrateMemObjects(const struct clEnqueueMigrateMemObjects_st* &event); ret_val=clEnqueueMigrateMemObjects(command_queue, - data->num_mem_objects, + data->num_mem_objects, data->mem_objects, data->flags, data->num_events_in_wait_list, @@ -175,7 +175,7 @@ int test_clEnqueueNDRangeKernel(const struct clEnqueueNDRangeKernel_st* data) { test_icd_app_log("clEnqueueNDRangeKernel(%p, %p, %u, %p, %p, %p, %u, %p, %p)\n", command_queue, - kernel, + kernel, data->work_dim, data->global_work_offset, data->global_work_size, @@ -185,7 +185,7 @@ int test_clEnqueueNDRangeKernel(const struct clEnqueueNDRangeKernel_st* data) &event); ret_val=clEnqueueNDRangeKernel(command_queue, - kernel, + kernel, data->work_dim, data->global_work_offset, data->global_work_size, @@ -194,7 +194,7 @@ int test_clEnqueueNDRangeKernel(const struct clEnqueueNDRangeKernel_st* data) data->event_wait_list, &event); - test_icd_app_log("Value returned: %d\n", ret_val); + test_icd_app_log("Value returned: %d\n", ret_val); return 0; } @@ -207,16 +207,16 @@ struct clEnqueueTask_st clEnqueueTaskData[NUM_ITEMS_clEnqueueTask] = int test_clEnqueueTask(const struct clEnqueueTask_st* data) { test_icd_app_log("clEnqueueTask(%p, %p, %u, %p, %p)\n", - command_queue, - kernel, + command_queue, + kernel, data->num_events_in_wait_list, - data->event_wait_list, + data->event_wait_list, &event); - ret_val=clEnqueueTask(command_queue, - kernel, + ret_val=clEnqueueTask(command_queue, + kernel, data->num_events_in_wait_list, - data->event_wait_list, + data->event_wait_list, &event); test_icd_app_log("Value returned: %d\n", ret_val); @@ -230,29 +230,29 @@ struct clEnqueueNativeKernel_st clEnqueueNativeKernelData[NUM_ITEMS_clEnqueueNat int test_clEnqueueNativeKernel(const struct clEnqueueNativeKernel_st* data) { test_icd_app_log("clEnqueueNativeKernel(%p, %p, %p, %u, %u, %p, %p, %u, %p, %p)\n", - command_queue, + command_queue, data->user_func, - data->args, - data->cb_args, + data->args, + data->cb_args, data->num_mem_objects, - data->mem_list, + data->mem_list, data->args_mem_loc, data->num_events_in_wait_list, - data->event_wait_list, + data->event_wait_list, &event); - ret_val=clEnqueueNativeKernel(command_queue, + ret_val=clEnqueueNativeKernel(command_queue, data->user_func, - data->args, - data->cb_args, + data->args, + data->cb_args, data->num_mem_objects, - data->mem_list, + data->mem_list, data->args_mem_loc, data->num_events_in_wait_list, - data->event_wait_list, + data->event_wait_list, &event); - test_icd_app_log("Value returned: %d\n", ret_val); + test_icd_app_log("Value returned: %d\n", ret_val); return 0; } @@ -300,15 +300,15 @@ struct clGetEventInfo_st clGetEventInfoData[NUM_ITEMS_clGetEventInfo] = int test_clGetEventInfo(const struct clGetEventInfo_st* data){ test_icd_app_log("clGetEventInfo(%p, %u, %u, %p, %p)\n", event, - data->param_name, + data->param_name, data->param_value_size, - data->param_value, + data->param_value, data->param_value_size_ret); ret_val=clGetEventInfo(event, - data->param_name, + data->param_name, data->param_value_size, - data->param_value, + data->param_value, data->param_value_size_ret); test_icd_app_log("Value returned: %d\n", ret_val); @@ -424,11 +424,11 @@ int test_clEnqueueWaitForEvents(const struct clEnqueueWaitForEvents_st* data) { test_icd_app_log("clEnqueueWaitForEvents(%p, %u, %p)\n", command_queue, - data->num_events, + data->num_events, data->event_list); ret_val = clEnqueueWaitForEvents(command_queue, - data->num_events, + data->num_events, data->event_list); test_icd_app_log("Value returned: %d\n", ret_val); @@ -461,13 +461,13 @@ int test_clGetEventProfilingInfo(const struct clGetEventProfilingInfo_st* data) test_icd_app_log("clGetEventProfilingInfo(%p, %u, %u, %p, %p)\n", event, data->param_name, - data->param_value_size, + data->param_value_size, data->param_value, data->param_value_size_ret); ret_val=clGetEventProfilingInfo(event, data->param_name, - data->param_value_size, + data->param_value_size, data->param_value, data->param_value_size_ret); @@ -512,88 +512,88 @@ int test_kernel() { int i; - for (i=0; iparam_name, + data->param_name, data->param_value_size, - data->param_value, - data->param_value_size_ret); + data->param_value, + data->param_value_size_ret); ret_val = clGetContextInfo(context, - data->param_name, + data->param_name, data->param_value_size, - data->param_value, + data->param_value, data->param_value_size_ret); test_icd_app_log("Value returned: %d\n", ret_val); @@ -83,14 +83,14 @@ int test_clGetPlatformInfo(const struct clGetPlatformInfo_st* data) platform, data->param_name, data->param_value_size, - data->param_value, - data->param_value_size_ret); + data->param_value, + data->param_value_size_ret); ret_val = clGetPlatformInfo(platform, data->param_name, data->param_value_size, data->param_value, - data->param_value_size_ret); + data->param_value_size_ret); test_icd_app_log("Value returned: %d\n", ret_val); @@ -99,19 +99,19 @@ int test_clGetPlatformInfo(const struct clGetPlatformInfo_st* data) } int test_clGetDeviceInfo(const struct clGetDeviceInfo_st* data) -{ +{ test_icd_app_log("clGetDeviceInfo(%p, %u, %u, %p, %p)\n", devices, - data->param_name, - data->param_value_size, - data->param_value, - data->param_value_size_ret); + data->param_name, + data->param_value_size, + data->param_value, + data->param_value_size_ret); ret_val = clGetDeviceInfo(devices, - data->param_name, - data->param_value_size, - data->param_value, - data->param_value_size_ret); + data->param_name, + data->param_value_size, + data->param_value, + data->param_value_size_ret); test_icd_app_log("Value returned: %d\n", ret_val); @@ -122,16 +122,16 @@ int test_clCreateSubDevices(const struct clCreateSubDevices_st* data) { test_icd_app_log("clCreateSubDevices(%p, %p, %u, %p, %p)\n", devices, - data->properties, - data->num_entries, - &devices, - data->num_devices); + data->properties, + data->num_entries, + &devices, + data->num_devices); ret_val = clCreateSubDevices(devices, - data->properties, + data->properties, data->num_entries, - &devices, - data->num_devices); + &devices, + data->num_devices); test_icd_app_log("Value returned: %d\n", ret_val); @@ -140,9 +140,9 @@ int test_clCreateSubDevices(const struct clCreateSubDevices_st* data) int test_clRetainDevice(const struct clRetainDevice_st* data) { - test_icd_app_log("clRetainDevice(%p)\n", devices); + test_icd_app_log("clRetainDevice(%p)\n", devices); - ret_val = clRetainDevice(devices); + ret_val = clRetainDevice(devices); test_icd_app_log("Value returned: %d\n", ret_val); @@ -153,31 +153,31 @@ int test_platforms() { int i; - for (i = 0;ifunc_name); return_value=clGetExtensionFunctionAddressForPlatform(platform, @@ -224,7 +224,7 @@ int test_program_objects() for (i=0;iname) { case CL_QUEUE_PROPERTIES: property = static_cast(p->value.raw); - + if (property & CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE) { ss << "CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE"; property &= ~CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE; @@ -3392,7 +3392,7 @@ EnqueueReleaseGLObjects( return ret; } -static cl_int CL_API_CALL +static cl_int CL_API_CALL RetainDevice( cl_device_id device) { @@ -3412,7 +3412,7 @@ RetainDevice( return ret; } -static cl_int CL_API_CALL +static cl_int CL_API_CALL ReleaseDevice( cl_device_id device) { @@ -3432,7 +3432,7 @@ ReleaseDevice( return ret; } -static cl_mem CL_API_CALL +static cl_mem CL_API_CALL CreateImage( cl_context context, cl_mem_flags flags, @@ -3463,7 +3463,7 @@ CreateImage( return ret; } -static cl_program CL_API_CALL +static cl_program CL_API_CALL CreateProgramWithBuiltInKernels( cl_context context, cl_uint num_devices, @@ -3491,7 +3491,7 @@ CreateProgramWithBuiltInKernels( return ret; } -static cl_int CL_API_CALL +static cl_int CL_API_CALL CompileProgram( cl_program program, cl_uint num_devices, @@ -3526,7 +3526,7 @@ CompileProgram( return ret; } -static cl_program CL_API_CALL +static cl_program CL_API_CALL LinkProgram( cl_context context, cl_uint num_devices, @@ -3560,7 +3560,7 @@ LinkProgram( return ret; } -static cl_int CL_API_CALL +static cl_int CL_API_CALL UnloadPlatformCompiler( cl_platform_id platform) { @@ -3581,7 +3581,7 @@ UnloadPlatformCompiler( return ret; } -static cl_int CL_API_CALL +static cl_int CL_API_CALL GetKernelArgInfo( cl_kernel kernel, cl_uint arg_indx, @@ -3613,7 +3613,7 @@ GetKernelArgInfo( return ret; } -static cl_int CL_API_CALL +static cl_int CL_API_CALL EnqueueFillBuffer( cl_command_queue command_queue, cl_mem buffer, @@ -3647,7 +3647,7 @@ EnqueueFillBuffer( return ret; } -static cl_int CL_API_CALL +static cl_int CL_API_CALL EnqueueFillImage( cl_command_queue command_queue, cl_mem image, @@ -3682,7 +3682,7 @@ EnqueueFillImage( return ret; } -static cl_int CL_API_CALL +static cl_int CL_API_CALL EnqueueMigrateMemObjects( cl_command_queue command_queue, cl_uint num_mem_objects, @@ -3715,7 +3715,7 @@ EnqueueMigrateMemObjects( return ret; } -static cl_int CL_API_CALL +static cl_int CL_API_CALL EnqueueMarkerWithWaitList( cl_command_queue command_queue, cl_uint num_events_in_wait_list, @@ -3742,7 +3742,7 @@ EnqueueMarkerWithWaitList( return ret; } -static cl_int CL_API_CALL +static cl_int CL_API_CALL EnqueueBarrierWithWaitList( cl_command_queue command_queue, cl_uint num_events_in_wait_list, @@ -3769,7 +3769,7 @@ EnqueueBarrierWithWaitList( return ret; } -static void * CL_API_CALL +static void * CL_API_CALL GetExtensionFunctionAddressForPlatform( cl_platform_id platform, const char * function_name) @@ -4365,13 +4365,13 @@ int32_t CL_CALLBACK vdiAgent_OnLoad(vdi_agent * agent) { char *clTraceLogEnv; - + int32_t err = agent->GetICDDispatchTable( agent, &original_dispatch, sizeof(original_dispatch)); if (err != CL_SUCCESS) { return err; } - + clTraceLogEnv = getenv("CL_TRACE_OUTPUT"); if(clTraceLogEnv!=NULL) { std::string clTraceLogStr = clTraceLogEnv; @@ -4402,7 +4402,7 @@ vdiAgent_OnLoad(vdi_agent * agent) return err; } - std::cerr << "!!!" << std::endl << "!!! API trace for \"" + std::cerr << "!!!" << std::endl << "!!! API trace for \"" << version << "\"" << std::endl << "!!!" << std::endl; SET_ORIGINAL_EXTENSION(D3D10KHR);