diff --git a/include/CL/opencl.hpp b/include/CL/opencl.hpp index 5ec68e28..aada50d7 100644 --- a/include/CL/opencl.hpp +++ b/include/CL/opencl.hpp @@ -1855,7 +1855,14 @@ CL_HPP_DECLARE_PARAM_TRAITS_(cl_command_buffer_info_khr, CL_COMMAND_BUFFER_PROPE CL_HPP_DECLARE_PARAM_TRAITS_(cl_mutable_command_info_khr, CL_MUTABLE_COMMAND_COMMAND_QUEUE_KHR, CommandQueue) CL_HPP_DECLARE_PARAM_TRAITS_(cl_mutable_command_info_khr, CL_MUTABLE_COMMAND_COMMAND_BUFFER_KHR, CommandBufferKhr) CL_HPP_DECLARE_PARAM_TRAITS_(cl_mutable_command_info_khr, CL_MUTABLE_COMMAND_COMMAND_TYPE_KHR, cl_command_type) -CL_HPP_DECLARE_PARAM_TRAITS_(cl_mutable_command_info_khr, CL_MUTABLE_DISPATCH_PROPERTIES_ARRAY_KHR, cl::vector) +CL_HPP_DECLARE_PARAM_TRAITS_(cl_mutable_command_info_khr, + CL_MUTABLE_DISPATCH_PROPERTIES_ARRAY_KHR, +#if CL_KHR_COMMAND_BUFFER_EXTENSION_VERSION > CL_MAKE_VERSION(0, 9, 4) + cl::vector) +#else + cl::vector< + cl_ndrange_kernel_command_properties_khr>) +#endif CL_HPP_DECLARE_PARAM_TRAITS_(cl_mutable_command_info_khr, CL_MUTABLE_DISPATCH_KERNEL_KHR, cl_kernel) CL_HPP_DECLARE_PARAM_TRAITS_(cl_mutable_command_info_khr, CL_MUTABLE_DISPATCH_DIMENSIONS_KHR, cl_uint) CL_HPP_DECLARE_PARAM_TRAITS_(cl_mutable_command_info_khr, CL_MUTABLE_DISPATCH_GLOBAL_WORK_OFFSET_KHR, cl::vector) @@ -11505,11 +11512,14 @@ class CommandBufferKhr : public detail::Wrapper __ENQUEUE_COMMAND_BUFFER_KHR_ERR); } - cl_int commandBarrierWithWaitList(const vector* sync_points_vec = nullptr, - cl_sync_point_khr* sync_point = nullptr, - MutableCommandKhr* mutable_handle = nullptr, - const CommandQueue* command_queue = nullptr) - { + cl_int commandBarrierWithWaitList( +#if CL_KHR_COMMAND_BUFFER_EXTENSION_VERSION > CL_MAKE_VERSION(0, 9, 4) + const cl::vector &properties, +#endif + const vector *sync_points_vec = nullptr, + cl_sync_point_khr *sync_point = nullptr, + MutableCommandKhr *mutable_handle = nullptr, + const CommandQueue *command_queue = nullptr) { if (pfn_clCommandBarrierWithWaitListKHR == nullptr) { return detail::errHandler(CL_INVALID_OPERATION, __COMMAND_BARRIER_WITH_WAIT_LIST_KHR_ERR); @@ -11517,12 +11527,19 @@ class CommandBufferKhr : public detail::Wrapper cl_sync_point_khr tmp_sync_point; cl_int error = detail::errHandler( - pfn_clCommandBarrierWithWaitListKHR(object_, + pfn_clCommandBarrierWithWaitListKHR( + object_, (command_queue != nullptr) ? (*command_queue)() : nullptr, - (sync_points_vec != nullptr) ? (cl_uint) sync_points_vec->size() : 0, - (sync_points_vec != nullptr && sync_points_vec->size() > 0) ? &sync_points_vec->front() : nullptr, +#if CL_KHR_COMMAND_BUFFER_EXTENSION_VERSION > CL_MAKE_VERSION(0, 9, 4) + &properties[0], +#endif + (sync_points_vec != nullptr) ? (cl_uint)sync_points_vec->size() + : 0, + (sync_points_vec != nullptr && sync_points_vec->size() > 0) + ? &sync_points_vec->front() + : nullptr, (sync_point != nullptr) ? &tmp_sync_point : nullptr, - (cl_mutable_command_khr*) mutable_handle), + (cl_mutable_command_khr *)mutable_handle), __COMMAND_BARRIER_WITH_WAIT_LIST_KHR_ERR); if (sync_point != nullptr && error == CL_SUCCESS) @@ -11531,16 +11548,16 @@ class CommandBufferKhr : public detail::Wrapper return error; } - cl_int commandCopyBuffer(const Buffer& src, - const Buffer& dst, - size_type src_offset, - size_type dst_offset, - size_type size, - const vector* sync_points_vec = nullptr, - cl_sync_point_khr* sync_point = nullptr, - MutableCommandKhr* mutable_handle = nullptr, - const CommandQueue* command_queue = nullptr) - { + cl_int commandCopyBuffer( +#if CL_KHR_COMMAND_BUFFER_EXTENSION_VERSION > CL_MAKE_VERSION(0, 9, 4) + const cl::vector &properties, +#endif + const Buffer &src, const Buffer &dst, size_type src_offset, + size_type dst_offset, size_type size, + const vector *sync_points_vec = nullptr, + cl_sync_point_khr *sync_point = nullptr, + MutableCommandKhr *mutable_handle = nullptr, + const CommandQueue *command_queue = nullptr) { if (pfn_clCommandCopyBufferKHR == nullptr) { return detail::errHandler(CL_INVALID_OPERATION, __COMMAND_COPY_BUFFER_KHR_ERR); @@ -11548,17 +11565,20 @@ class CommandBufferKhr : public detail::Wrapper cl_sync_point_khr tmp_sync_point; cl_int error = detail::errHandler( - pfn_clCommandCopyBufferKHR(object_, + pfn_clCommandCopyBufferKHR( + object_, (command_queue != nullptr) ? (*command_queue)() : nullptr, - src(), - dst(), - src_offset, - dst_offset, - size, - (sync_points_vec != nullptr) ? (cl_uint) sync_points_vec->size() : 0, - (sync_points_vec != nullptr && sync_points_vec->size() > 0) ? &sync_points_vec->front() : nullptr, +#if CL_KHR_COMMAND_BUFFER_EXTENSION_VERSION > CL_MAKE_VERSION(0, 9, 4) + &properties[0], +#endif + src(), dst(), src_offset, dst_offset, size, + (sync_points_vec != nullptr) ? (cl_uint)sync_points_vec->size() + : 0, + (sync_points_vec != nullptr && sync_points_vec->size() > 0) + ? &sync_points_vec->front() + : nullptr, (sync_point != nullptr) ? &tmp_sync_point : nullptr, - (cl_mutable_command_khr*) mutable_handle), + (cl_mutable_command_khr *)mutable_handle), __COMMAND_COPY_BUFFER_KHR_ERR); if (sync_point != nullptr && error == CL_SUCCESS) @@ -11567,20 +11587,20 @@ class CommandBufferKhr : public detail::Wrapper return error; } - cl_int commandCopyBufferRect(const Buffer& src, - const Buffer& dst, - const array& src_origin, - const array& dst_origin, - const array& region, - size_type src_row_pitch, - size_type src_slice_pitch, - size_type dst_row_pitch, + cl_int commandCopyBufferRect( +#if CL_KHR_COMMAND_BUFFER_EXTENSION_VERSION > CL_MAKE_VERSION(0, 9, 4) + const cl::vector &properties, +#endif + const Buffer &src, const Buffer &dst, + const array &src_origin, + const array &dst_origin, + const array ®ion, size_type src_row_pitch, + size_type src_slice_pitch, size_type dst_row_pitch, size_type dst_slice_pitch, - const vector* sync_points_vec = nullptr, - cl_sync_point_khr* sync_point = nullptr, - MutableCommandKhr* mutable_handle = nullptr, - const CommandQueue* command_queue = nullptr) - { + const vector *sync_points_vec = nullptr, + cl_sync_point_khr *sync_point = nullptr, + MutableCommandKhr *mutable_handle = nullptr, + const CommandQueue *command_queue = nullptr) { if (pfn_clCommandCopyBufferRectKHR == nullptr) { return detail::errHandler(CL_INVALID_OPERATION, __COMMAND_COPY_BUFFER_RECT_KHR_ERR); @@ -11588,21 +11608,22 @@ class CommandBufferKhr : public detail::Wrapper cl_sync_point_khr tmp_sync_point; cl_int error = detail::errHandler( - pfn_clCommandCopyBufferRectKHR(object_, + pfn_clCommandCopyBufferRectKHR( + object_, (command_queue != nullptr) ? (*command_queue)() : nullptr, - src(), - dst(), - src_origin.data(), - dst_origin.data(), - region.data(), - src_row_pitch, - src_slice_pitch, - dst_row_pitch, +#if CL_KHR_COMMAND_BUFFER_EXTENSION_VERSION > CL_MAKE_VERSION(0, 9, 4) + &properties[0], +#endif + src(), dst(), src_origin.data(), dst_origin.data(), + region.data(), src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch, - (sync_points_vec != nullptr) ? (cl_uint) sync_points_vec->size() : 0, - (sync_points_vec != nullptr && sync_points_vec->size() > 0) ? &sync_points_vec->front() : nullptr, + (sync_points_vec != nullptr) ? (cl_uint)sync_points_vec->size() + : 0, + (sync_points_vec != nullptr && sync_points_vec->size() > 0) + ? &sync_points_vec->front() + : nullptr, (sync_point != nullptr) ? &tmp_sync_point : nullptr, - (cl_mutable_command_khr*) mutable_handle), + (cl_mutable_command_khr *)mutable_handle), __COMMAND_COPY_BUFFER_RECT_KHR_ERR); if (sync_point != nullptr && error == CL_SUCCESS) @@ -11611,16 +11632,17 @@ class CommandBufferKhr : public detail::Wrapper return error; } - cl_int commandCopyBufferToImage(const Buffer& src, - const Image& dst, - size_type src_offset, - const array& dst_origin, - const array& region, - const vector* sync_points_vec = nullptr, - cl_sync_point_khr* sync_point = nullptr, - MutableCommandKhr* mutable_handle = nullptr, - const CommandQueue* command_queue = nullptr) - { + cl_int commandCopyBufferToImage( +#if CL_KHR_COMMAND_BUFFER_EXTENSION_VERSION > CL_MAKE_VERSION(0, 9, 4) + const cl::vector &properties, +#endif + const Buffer &src, const Image &dst, size_type src_offset, + const array &dst_origin, + const array ®ion, + const vector *sync_points_vec = nullptr, + cl_sync_point_khr *sync_point = nullptr, + MutableCommandKhr *mutable_handle = nullptr, + const CommandQueue *command_queue = nullptr) { if (pfn_clCommandCopyBufferToImageKHR == nullptr) { return detail::errHandler(CL_INVALID_OPERATION, __COMMAND_COPY_BUFFER_TO_IMAGE_KHR_ERR); @@ -11628,17 +11650,20 @@ class CommandBufferKhr : public detail::Wrapper cl_sync_point_khr tmp_sync_point; cl_int error = detail::errHandler( - pfn_clCommandCopyBufferToImageKHR(object_, + pfn_clCommandCopyBufferToImageKHR( + object_, (command_queue != nullptr) ? (*command_queue)() : nullptr, - src(), - dst(), - src_offset, - dst_origin.data(), - region.data(), - (sync_points_vec != nullptr) ? (cl_uint) sync_points_vec->size() : 0, - (sync_points_vec != nullptr && sync_points_vec->size() > 0) ? &sync_points_vec->front() : nullptr, +#if CL_KHR_COMMAND_BUFFER_EXTENSION_VERSION > CL_MAKE_VERSION(0, 9, 4) + &properties[0], +#endif + src(), dst(), src_offset, dst_origin.data(), region.data(), + (sync_points_vec != nullptr) ? (cl_uint)sync_points_vec->size() + : 0, + (sync_points_vec != nullptr && sync_points_vec->size() > 0) + ? &sync_points_vec->front() + : nullptr, (sync_point != nullptr) ? &tmp_sync_point : nullptr, - (cl_mutable_command_khr*) mutable_handle), + (cl_mutable_command_khr *)mutable_handle), __COMMAND_COPY_BUFFER_TO_IMAGE_KHR_ERR); if (sync_point != nullptr && error == CL_SUCCESS) @@ -11647,16 +11672,18 @@ class CommandBufferKhr : public detail::Wrapper return error; } - cl_int commandCopyImage(const Image& src, - const Image& dst, - const array& src_origin, - const array& dst_origin, - const array& region, - const vector* sync_points_vec = nullptr, - cl_sync_point_khr* sync_point = nullptr, - MutableCommandKhr* mutable_handle = nullptr, - const CommandQueue* command_queue = nullptr) - { + cl_int commandCopyImage( +#if CL_KHR_COMMAND_BUFFER_EXTENSION_VERSION > CL_MAKE_VERSION(0, 9, 4) + const cl::vector &properties, +#endif + const Image &src, const Image &dst, + const array &src_origin, + const array &dst_origin, + const array ®ion, + const vector *sync_points_vec = nullptr, + cl_sync_point_khr *sync_point = nullptr, + MutableCommandKhr *mutable_handle = nullptr, + const CommandQueue *command_queue = nullptr) { if (pfn_clCommandCopyImageKHR == nullptr) { return detail::errHandler(CL_INVALID_OPERATION, __COMMAND_COPY_IMAGE_KHR_ERR); @@ -11664,17 +11691,21 @@ class CommandBufferKhr : public detail::Wrapper cl_sync_point_khr tmp_sync_point; cl_int error = detail::errHandler( - pfn_clCommandCopyImageKHR(object_, + pfn_clCommandCopyImageKHR( + object_, (command_queue != nullptr) ? (*command_queue)() : nullptr, - src(), - dst(), - src_origin.data(), - dst_origin.data(), +#if CL_KHR_COMMAND_BUFFER_EXTENSION_VERSION > CL_MAKE_VERSION(0, 9, 4) + &properties[0], +#endif + src(), dst(), src_origin.data(), dst_origin.data(), region.data(), - (sync_points_vec != nullptr) ? (cl_uint) sync_points_vec->size() : 0, - (sync_points_vec != nullptr && sync_points_vec->size() > 0) ? &sync_points_vec->front() : nullptr, + (sync_points_vec != nullptr) ? (cl_uint)sync_points_vec->size() + : 0, + (sync_points_vec != nullptr && sync_points_vec->size() > 0) + ? &sync_points_vec->front() + : nullptr, (sync_point != nullptr) ? &tmp_sync_point : nullptr, - (cl_mutable_command_khr*) mutable_handle), + (cl_mutable_command_khr *)mutable_handle), __COMMAND_COPY_IMAGE_KHR_ERR); if (sync_point != nullptr && error == CL_SUCCESS) @@ -11683,16 +11714,17 @@ class CommandBufferKhr : public detail::Wrapper return error; } - cl_int commandCopyImageToBuffer(const Image& src, - const Buffer& dst, - const array& src_origin, - const array& region, - size_type dst_offset, - const vector* sync_points_vec = nullptr, - cl_sync_point_khr* sync_point = nullptr, - MutableCommandKhr* mutable_handle = nullptr, - const CommandQueue* command_queue = nullptr) - { + cl_int commandCopyImageToBuffer( +#if CL_KHR_COMMAND_BUFFER_EXTENSION_VERSION > CL_MAKE_VERSION(0, 9, 4) + const cl::vector &properties, +#endif + const Image &src, const Buffer &dst, + const array &src_origin, + const array ®ion, size_type dst_offset, + const vector *sync_points_vec = nullptr, + cl_sync_point_khr *sync_point = nullptr, + MutableCommandKhr *mutable_handle = nullptr, + const CommandQueue *command_queue = nullptr) { if (pfn_clCommandCopyImageToBufferKHR == nullptr) { return detail::errHandler(CL_INVALID_OPERATION, __COMMAND_COPY_IMAGE_TO_BUFFER_KHR_ERR); @@ -11700,17 +11732,20 @@ class CommandBufferKhr : public detail::Wrapper cl_sync_point_khr tmp_sync_point; cl_int error = detail::errHandler( - pfn_clCommandCopyImageToBufferKHR(object_, + pfn_clCommandCopyImageToBufferKHR( + object_, (command_queue != nullptr) ? (*command_queue)() : nullptr, - src(), - dst(), - src_origin.data(), - region.data(), - dst_offset, - (sync_points_vec != nullptr) ? (cl_uint) sync_points_vec->size() : 0, - (sync_points_vec != nullptr && sync_points_vec->size() > 0) ? &sync_points_vec->front() : nullptr, +#if CL_KHR_COMMAND_BUFFER_EXTENSION_VERSION > CL_MAKE_VERSION(0, 9, 4) + &properties[0], +#endif + src(), dst(), src_origin.data(), region.data(), dst_offset, + (sync_points_vec != nullptr) ? (cl_uint)sync_points_vec->size() + : 0, + (sync_points_vec != nullptr && sync_points_vec->size() > 0) + ? &sync_points_vec->front() + : nullptr, (sync_point != nullptr) ? &tmp_sync_point : nullptr, - (cl_mutable_command_khr*) mutable_handle), + (cl_mutable_command_khr *)mutable_handle), __COMMAND_COPY_IMAGE_TO_BUFFER_KHR_ERR); if (sync_point != nullptr && error == CL_SUCCESS) @@ -11719,16 +11754,17 @@ class CommandBufferKhr : public detail::Wrapper return error; } - template - cl_int commandFillBuffer(const Buffer& buffer, - PatternType pattern, - size_type offset, + template + cl_int commandFillBuffer( +#if CL_KHR_COMMAND_BUFFER_EXTENSION_VERSION > CL_MAKE_VERSION(0, 9, 4) + const cl::vector &properties, +#endif + const Buffer &buffer, PatternType pattern, size_type offset, size_type size, - const vector* sync_points_vec = nullptr, - cl_sync_point_khr* sync_point = nullptr, - MutableCommandKhr* mutable_handle = nullptr, - const CommandQueue* command_queue = nullptr) - { + const vector *sync_points_vec = nullptr, + cl_sync_point_khr *sync_point = nullptr, + MutableCommandKhr *mutable_handle = nullptr, + const CommandQueue *command_queue = nullptr) { if (pfn_clCommandFillBufferKHR == nullptr) { return detail::errHandler(CL_INVALID_OPERATION, __COMMAND_FILL_BUFFER_KHR_ERR); @@ -11736,17 +11772,21 @@ class CommandBufferKhr : public detail::Wrapper cl_sync_point_khr tmp_sync_point; cl_int error = detail::errHandler( - pfn_clCommandFillBufferKHR(object_, + pfn_clCommandFillBufferKHR( + object_, (command_queue != nullptr) ? (*command_queue)() : nullptr, - buffer(), - static_cast(&pattern), - sizeof(PatternType), - offset, - size, - (sync_points_vec != nullptr) ? (cl_uint) sync_points_vec->size() : 0, - (sync_points_vec != nullptr && sync_points_vec->size() > 0) ? &sync_points_vec->front() : nullptr, +#if CL_KHR_COMMAND_BUFFER_EXTENSION_VERSION > CL_MAKE_VERSION(0, 9, 4) + &properties[0], +#endif + buffer(), static_cast(&pattern), sizeof(PatternType), + offset, size, + (sync_points_vec != nullptr) ? (cl_uint)sync_points_vec->size() + : 0, + (sync_points_vec != nullptr && sync_points_vec->size() > 0) + ? &sync_points_vec->front() + : nullptr, (sync_point != nullptr) ? &tmp_sync_point : nullptr, - (cl_mutable_command_khr*) mutable_handle), + (cl_mutable_command_khr *)mutable_handle), __COMMAND_FILL_BUFFER_KHR_ERR); if (sync_point != nullptr && error == CL_SUCCESS) @@ -11755,15 +11795,16 @@ class CommandBufferKhr : public detail::Wrapper return error; } - cl_int commandFillImage(const Image& image, - cl_float4 fillColor, - const array& origin, - const array& region, - const vector* sync_points_vec = nullptr, - cl_sync_point_khr* sync_point = nullptr, - MutableCommandKhr* mutable_handle = nullptr, - const CommandQueue* command_queue = nullptr) - { + cl_int commandFillImage( +#if CL_KHR_COMMAND_BUFFER_EXTENSION_VERSION > CL_MAKE_VERSION(0, 9, 4) + const cl::vector &properties, +#endif + const Image &image, cl_float4 fillColor, + const array &origin, const array ®ion, + const vector *sync_points_vec = nullptr, + cl_sync_point_khr *sync_point = nullptr, + MutableCommandKhr *mutable_handle = nullptr, + const CommandQueue *command_queue = nullptr) { if (pfn_clCommandFillImageKHR == nullptr) { return detail::errHandler(CL_INVALID_OPERATION, __COMMAND_FILL_IMAGE_KHR_ERR); @@ -11771,16 +11812,21 @@ class CommandBufferKhr : public detail::Wrapper cl_sync_point_khr tmp_sync_point; cl_int error = detail::errHandler( - pfn_clCommandFillImageKHR(object_, + pfn_clCommandFillImageKHR( + object_, (command_queue != nullptr) ? (*command_queue)() : nullptr, - image(), - static_cast(&fillColor), - origin.data(), +#if CL_KHR_COMMAND_BUFFER_EXTENSION_VERSION > CL_MAKE_VERSION(0, 9, 4) + &properties[0], +#endif + image(), static_cast(&fillColor), origin.data(), region.data(), - (sync_points_vec != nullptr) ? (cl_uint) sync_points_vec->size() : 0, - (sync_points_vec != nullptr && sync_points_vec->size() > 0) ? &sync_points_vec->front() : nullptr, + (sync_points_vec != nullptr) ? (cl_uint)sync_points_vec->size() + : 0, + (sync_points_vec != nullptr && sync_points_vec->size() > 0) + ? &sync_points_vec->front() + : nullptr, (sync_point != nullptr) ? &tmp_sync_point : nullptr, - (cl_mutable_command_khr*) mutable_handle), + (cl_mutable_command_khr *)mutable_handle), __COMMAND_FILL_IMAGE_KHR_ERR); if (sync_point != nullptr && error == CL_SUCCESS) @@ -11789,16 +11835,18 @@ class CommandBufferKhr : public detail::Wrapper return error; } - cl_int commandNDRangeKernel(const cl::vector &properties, - const Kernel& kernel, - const NDRange& offset, - const NDRange& global, - const NDRange& local = NullRange, - const vector* sync_points_vec = nullptr, - cl_sync_point_khr* sync_point = nullptr, - MutableCommandKhr* mutable_handle = nullptr, - const CommandQueue* command_queue = nullptr) - { + cl_int commandNDRangeKernel( +#if CL_KHR_COMMAND_BUFFER_EXTENSION_VERSION > CL_MAKE_VERSION(0, 9, 4) + const cl::vector &properties, +#else + const cl::vector &properties, +#endif + const Kernel &kernel, const NDRange &offset, const NDRange &global, + const NDRange &local = NullRange, + const vector *sync_points_vec = nullptr, + cl_sync_point_khr *sync_point = nullptr, + MutableCommandKhr *mutable_handle = nullptr, + const CommandQueue *command_queue = nullptr) { if (pfn_clCommandNDRangeKernelKHR == nullptr) { return detail::errHandler(CL_INVALID_OPERATION, __COMMAND_NDRANGE_KERNEL_KHR_ERR);