Skip to content

Commit

Permalink
const more mutable-dispatch test variables
Browse files Browse the repository at this point in the history
  • Loading branch information
EwanC committed Sep 25, 2024
1 parent e4f9f80 commit 84be0bf
Show file tree
Hide file tree
Showing 6 changed files with 218 additions and 215 deletions.
6 changes: 3 additions & 3 deletions source/cl/examples/MutableDispatchKHR/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ int main(const int argc, const char **argv) {
&input_B_buffer};
const cl_mutable_dispatch_arg_khr arg_2{2, sizeof(cl_mem),
&output_buffer};
cl_mutable_dispatch_arg_khr args[] = {arg_0, arg_1, arg_2};
cl_mutable_dispatch_config_khr dispatch_config{
const cl_mutable_dispatch_arg_khr args[] = {arg_0, arg_1, arg_2};
const cl_mutable_dispatch_config_khr dispatch_config{
command_handle,
3 /* num_args */,
0 /* num_svm_arg */,
Expand All @@ -231,7 +231,7 @@ int main(const int argc, const char **argv) {

// Update the command buffer with the mutable configuration
const cl_uint num_configs = 1;
cl_command_buffer_update_type_khr config_types[1] = {
const cl_command_buffer_update_type_khr config_types[1] = {
CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR};
const void *configs[1] = {&dispatch_config};
error = clUpdateMutableCommandsKHR(command_buffer, num_configs,
Expand Down
4 changes: 2 additions & 2 deletions source/cl/source/extension/source/khr_command_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1078,9 +1078,9 @@ cargo::expected<mux_descriptor_info_s, cl_int> createArgumentDescriptor(
const cl_device_id device = command_queue->device;

// Verify struct configures kernel arguments and return error if malformed
for (const auto config_ptr : mutable_dispatch_configs) {
for (const auto &config_ptr : mutable_dispatch_configs) {
OCL_CHECK(config_ptr == nullptr, return CL_INVALID_VALUE);
const cl_mutable_dispatch_config_khr config = *config_ptr;
const cl_mutable_dispatch_config_khr &config = *config_ptr;
OCL_CHECK(!config.command, return CL_INVALID_MUTABLE_COMMAND_KHR);
OCL_CHECK(config.command->command_buffer != this,
return CL_INVALID_MUTABLE_COMMAND_KHR);
Expand Down
Loading

0 comments on commit 84be0bf

Please sign in to comment.