Skip to content

Commit

Permalink
Update clUpdateMutableCommandsKHR binding
Browse files Browse the repository at this point in the history
In OpenCL-Docs PR KhronosGroup/OpenCL-Docs#1045
the API for `cl_khr_command_buffer_mutable_dispatch` API
`clUpdateMutableCommandsKHR` changed in a breaking way.

When the headers update OpenCL-Headers PR KhronosGroup/OpenCL-Headers#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.
  • Loading branch information
EwanC committed Jul 31, 2024
1 parent afbd082 commit d40a45d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions include/CL/opencl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11549,14 +11549,18 @@ class CommandBufferKhr : public detail::Wrapper<cl_command_buffer_khr>
}

#if defined(cl_khr_command_buffer_mutable_dispatch)
cl_int updateMutableCommands(const cl_mutable_base_config_khr* mutable_config)
{
template <int ArrayLength>
cl_int updateMutableCommands(std::array<cl_command_buffer_update_type_khr,
ArrayLength> &config_types,
std::array<void *, ArrayLength> &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 */

Expand Down

0 comments on commit d40a45d

Please sign in to comment.