From d40a45d78a2c612fd2bda0c479df064af33c4cf7 Mon Sep 17 00:00:00 2001 From: Ewan Crawford Date: Wed, 31 Jul 2024 08:43:26 +0100 Subject: [PATCH] Update clUpdateMutableCommandsKHR binding In OpenCL-Docs PR https://github.com/KhronosGroup/OpenCL-Docs/pull/1045 the API for `cl_khr_command_buffer_mutable_dispatch` API `clUpdateMutableCommandsKHR` changed in a breaking way. When the headers update OpenCL-Headers PR https://github.com/KhronosGroup/OpenCL-Headers/pull/245 the bindings will break if they are not updated to reflect this change. Bindings updated in this PR to pass to arrays of templated length to the C++ method. The underlying `.data()` pointers of these parameters can be passed through to the OpenCL API. --- include/CL/opencl.hpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/include/CL/opencl.hpp b/include/CL/opencl.hpp index 3427f3e0..81b2a85e 100644 --- a/include/CL/opencl.hpp +++ b/include/CL/opencl.hpp @@ -11549,14 +11549,18 @@ class CommandBufferKhr : public detail::Wrapper } #if defined(cl_khr_command_buffer_mutable_dispatch) - cl_int updateMutableCommands(const cl_mutable_base_config_khr* mutable_config) - { + template + cl_int updateMutableCommands(std::array &config_types, + std::array &configs) { if (pfn_clUpdateMutableCommandsKHR == nullptr) { return detail::errHandler(CL_INVALID_OPERATION, __UPDATE_MUTABLE_COMMANDS_KHR_ERR); } - return detail::errHandler(pfn_clUpdateMutableCommandsKHR(object_, mutable_config), - __UPDATE_MUTABLE_COMMANDS_KHR_ERR); + return detail::errHandler( + pfn_clUpdateMutableCommandsKHR(object_, configs.length(), + config_types.data().configs.data()), + __UPDATE_MUTABLE_COMMANDS_KHR_ERR); } #endif /* cl_khr_command_buffer_mutable_dispatch */