From 935a451b5b0d740c5a63714a94b515d10c376b65 Mon Sep 17 00:00:00 2001 From: Ewan Crawford Date: Tue, 24 Sep 2024 12:19:31 +0100 Subject: [PATCH] const more mutable-dispatch test variables --- source/cl/examples/CMakeLists.txt | 2 +- .../MutableDispatchKHR/source/main.cpp | 6 +- .../extension/source/khr_command_buffer.cpp | 2 +- .../clEnqueueCommandBufferKHRMutability.cpp | 229 +++++++++--------- .../clUpdateMutableCommandsKHR.cpp | 68 +++--- .../thread_safety.cpp | 4 +- .../usm_arg_update.cpp | 122 +++++----- 7 files changed, 218 insertions(+), 215 deletions(-) diff --git a/source/cl/examples/CMakeLists.txt b/source/cl/examples/CMakeLists.txt index 67db1edb2..72073c492 100644 --- a/source/cl/examples/CMakeLists.txt +++ b/source/cl/examples/CMakeLists.txt @@ -88,7 +88,7 @@ endif() if(${OCL_EXTENSION_cl_khr_command_buffer_mutable_dispatch}) # Intentionally misnamed. Windows guesses that executables with "patch" # in the file name are installers and need admin privileges. - add_ca_cl_example(clMutableDispathcKHR + add_ca_cl_example(clMutableDispatchKHR ${CMAKE_CURRENT_SOURCE_DIR}/MutableDispatchKHR/source/main.cpp ${CMAKE_CURRENT_SOURCE_DIR}/include/common.h) endif() diff --git a/source/cl/examples/MutableDispatchKHR/source/main.cpp b/source/cl/examples/MutableDispatchKHR/source/main.cpp index 1789bc489..b35f38405 100644 --- a/source/cl/examples/MutableDispatchKHR/source/main.cpp +++ b/source/cl/examples/MutableDispatchKHR/source/main.cpp @@ -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 */, @@ -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, diff --git a/source/cl/source/extension/source/khr_command_buffer.cpp b/source/cl/source/extension/source/khr_command_buffer.cpp index 5babbb0d7..bf80a3ba8 100644 --- a/source/cl/source/extension/source/khr_command_buffer.cpp +++ b/source/cl/source/extension/source/khr_command_buffer.cpp @@ -1080,7 +1080,7 @@ cargo::expected createArgumentDescriptor( // Verify struct configures kernel arguments and return error if malformed 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); diff --git a/source/cl/test/UnitCL/source/cl_khr_command_buffer_mutable_dispatch/clEnqueueCommandBufferKHRMutability.cpp b/source/cl/test/UnitCL/source/cl_khr_command_buffer_mutable_dispatch/clEnqueueCommandBufferKHRMutability.cpp index a3e05fd08..d6cc54a8d 100644 --- a/source/cl/test/UnitCL/source/cl_khr_command_buffer_mutable_dispatch/clEnqueueCommandBufferKHRMutability.cpp +++ b/source/cl/test/UnitCL/source/cl_khr_command_buffer_mutable_dispatch/clEnqueueCommandBufferKHRMutability.cpp @@ -140,12 +140,12 @@ TEST_F(CommandBufferMutableBufferArgTest, UpdateOutputBufferOnce) { // Now try and enqueue the command buffer updating the output buffer. const cl_mutable_dispatch_arg_khr arg{1, sizeof(cl_mem), &updated_dst_buffer}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 1, 0, 0, 0, &arg, nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; EXPECT_SUCCESS(clUpdateMutableCommandsKHR(command_buffer, num_configs, @@ -202,12 +202,12 @@ TEST_F(CommandBufferMutableBufferArgTest, UpdateOutputBufferTwice) { // Now try and enqueue the command buffer updating the output buffer. const cl_mutable_dispatch_arg_khr first_arg{1, sizeof(cl_mem), &first_updated_dst_buffer}; - cl_mutable_dispatch_config_khr first_dispatch_config{ + const cl_mutable_dispatch_config_khr first_dispatch_config{ command_handle, 1, 0, 0, 0, &first_arg, nullptr, nullptr, nullptr, nullptr, nullptr}; const cl_uint first_num_configs = 1; - cl_command_buffer_update_type_khr first_config_types[1] = { + const cl_command_buffer_update_type_khr first_config_types[1] = { CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR}; const void *first_configs[1] = {&first_dispatch_config}; EXPECT_SUCCESS(clUpdateMutableCommandsKHR(command_buffer, first_num_configs, @@ -228,11 +228,11 @@ TEST_F(CommandBufferMutableBufferArgTest, UpdateOutputBufferTwice) { // Enqueue the command buffer again updating the output buffer a second time. const cl_mutable_dispatch_arg_khr second_arg{1, sizeof(cl_mem), &second_updated_dst_buffer}; - cl_mutable_dispatch_config_khr second_dispatch_config{ + const cl_mutable_dispatch_config_khr second_dispatch_config{ command_handle, 1, 0, 0, 0, &second_arg, nullptr, nullptr, nullptr, nullptr, nullptr}; const cl_uint second_num_configs = 1; - cl_command_buffer_update_type_khr second_config_types[1] = { + const cl_command_buffer_update_type_khr second_config_types[1] = { CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR}; const void *second_configs[1] = {&second_dispatch_config}; EXPECT_SUCCESS(clUpdateMutableCommandsKHR( @@ -292,11 +292,11 @@ TEST_F(CommandBufferMutableBufferArgTest, UpdateInputBufferOnce) { // Now try and enqueue the command buffer updating the input buffer. const cl_mutable_dispatch_arg_khr arg{0, sizeof(cl_mem), &updated_src_buffer}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 1, 0, 0, 0, &arg, nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; EXPECT_SUCCESS(clUpdateMutableCommandsKHR(command_buffer, num_configs, @@ -367,11 +367,11 @@ TEST_F(CommandBufferMutableBufferArgTest, UpdateInputBufferTwice) { // Now try and enqueue the command buffer updating the input buffer. const cl_mutable_dispatch_arg_khr first_arg{0, sizeof(cl_mem), &first_updated_src_buffer}; - cl_mutable_dispatch_config_khr first_dispatch_config{ + const cl_mutable_dispatch_config_khr first_dispatch_config{ command_handle, 1, 0, 0, 0, &first_arg, nullptr, nullptr, nullptr, nullptr, nullptr}; const cl_uint first_num_configs = 1; - cl_command_buffer_update_type_khr first_config_types[1] = { + const cl_command_buffer_update_type_khr first_config_types[1] = { CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR}; const void *first_configs[1] = {&first_dispatch_config}; EXPECT_SUCCESS(clUpdateMutableCommandsKHR(command_buffer, first_num_configs, @@ -392,11 +392,11 @@ TEST_F(CommandBufferMutableBufferArgTest, UpdateInputBufferTwice) { // Enqueue the command buffer a second time updating the input bufer again. const cl_mutable_dispatch_arg_khr second_arg{0, sizeof(cl_mem), &second_updated_src_buffer}; - cl_mutable_dispatch_config_khr second_dispatch_config{ + const cl_mutable_dispatch_config_khr second_dispatch_config{ command_handle, 1, 0, 0, 0, &second_arg, nullptr, nullptr, nullptr, nullptr, nullptr}; const cl_uint second_num_configs = 1; - cl_command_buffer_update_type_khr second_config_types[1] = { + const cl_command_buffer_update_type_khr second_config_types[1] = { CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR}; const void *second_configs[1] = {&second_dispatch_config}; EXPECT_SUCCESS(clUpdateMutableCommandsKHR( @@ -466,11 +466,11 @@ TEST_F(CommandBufferMutableBufferArgTest, const cl_mutable_dispatch_arg_khr arg_2{1, sizeof(cl_mem), &updated_dst_buffer}; const cl_mutable_dispatch_arg_khr args[] = {arg_1, arg_2}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 2, 0, 0, 0, args, nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; EXPECT_SUCCESS(clUpdateMutableCommandsKHR(command_buffer, num_configs, @@ -539,14 +539,14 @@ TEST_F(CommandBufferMutableBufferArgTest, &updated_src_buffer}; const cl_mutable_dispatch_arg_khr arg_2{1, sizeof(cl_mem), &updated_dst_buffer}; - cl_mutable_dispatch_config_khr dispatch_config_1{ + const cl_mutable_dispatch_config_khr dispatch_config_1{ command_handle, 1, 0, 0, 0, &arg_1, nullptr, nullptr, nullptr, nullptr, nullptr}; - cl_mutable_dispatch_config_khr dispatch_config_2{ + const cl_mutable_dispatch_config_khr dispatch_config_2{ command_handle, 1, 0, 0, 0, &arg_2, nullptr, nullptr, nullptr, nullptr, nullptr}; const cl_uint num_configs = 2; - cl_command_buffer_update_type_khr config_types[2] = { + const cl_command_buffer_update_type_khr config_types[2] = { CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR, CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR}; const void *configs[2] = {&dispatch_config_1, &dispatch_config_2}; @@ -611,11 +611,11 @@ TEST_F(CommandBufferMutableBufferArgTest, UpdateToBiggerBufferSize) { // Now try and enqueue the command buffer updating the output buffer. const cl_mutable_dispatch_arg_khr arg{1, sizeof(cl_mem), &updated_dst_buffer}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 1, 0, 0, 0, &arg, nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; EXPECT_SUCCESS(clUpdateMutableCommandsKHR(command_buffer, num_configs, @@ -672,11 +672,11 @@ TEST_F(CommandBufferMutableBufferArgTest, CheckUpdatePersists) { // Now try and enqueue the command buffer updating the output buffer. const cl_mutable_dispatch_arg_khr arg{1, sizeof(cl_mem), &updated_dst_buffer}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 1, 0, 0, 0, &arg, nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; EXPECT_SUCCESS(clUpdateMutableCommandsKHR(command_buffer, num_configs, @@ -762,11 +762,11 @@ TEST_F(CommandBufferMutableBufferArgTest, FillThenNDRange) { // Now try and enqueue the command buffer updating the output buffer. const cl_mutable_dispatch_arg_khr arg{1, sizeof(cl_mem), &updated_dst_buffer}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 1, 0, 0, 0, &arg, nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; EXPECT_SUCCESS(clUpdateMutableCommandsKHR(command_buffer, num_configs, @@ -832,11 +832,11 @@ TEST_F(CommandBufferMutableBufferArgTest, NDRangeThenFill) { // Now try and enqueue the command buffer updating the output buffer. const cl_mutable_dispatch_arg_khr arg{1, sizeof(cl_mem), &updated_dst_buffer}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 1, 0, 0, 0, &arg, nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; EXPECT_SUCCESS(clUpdateMutableCommandsKHR(command_buffer, num_configs, @@ -905,11 +905,11 @@ TEST_F(CommandBufferMutableBufferArgTest, FillTwiceThenNDRange) { // Now try and enqueue the command buffer updating the output buffer. const cl_mutable_dispatch_arg_khr arg{1, sizeof(cl_mem), &updated_dst_buffer}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 1, 0, 0, 0, &arg, nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; EXPECT_SUCCESS(clUpdateMutableCommandsKHR(command_buffer, num_configs, @@ -977,11 +977,11 @@ TEST_F(CommandBufferMutableBufferArgTest, CopyBufferThenNDRange) { // Now try and enqueue the command buffer updating the output buffer. const cl_mutable_dispatch_arg_khr arg{1, sizeof(cl_mem), &updated_dst_buffer}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 1, 0, 0, 0, &arg, nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; EXPECT_SUCCESS(clUpdateMutableCommandsKHR(command_buffer, num_configs, @@ -1051,11 +1051,11 @@ TEST_F(CommandBufferMutableBufferArgTest, CopyBufferRectThenNDRange) { // Now try and enqueue the command buffer updating the output buffer. const cl_mutable_dispatch_arg_khr arg{1, sizeof(cl_mem), &updated_dst_buffer}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 1, 0, 0, 0, &arg, nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; EXPECT_SUCCESS(clUpdateMutableCommandsKHR(command_buffer, num_configs, @@ -1132,11 +1132,11 @@ TEST_F(CommandBufferMutableBufferArgTest, RegularNDRangeThenMutableNDRange) { // Now try and enqueue the command buffer updating the output buffer. const cl_mutable_dispatch_arg_khr arg{1, sizeof(cl_mem), &updated_dst_buffer}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 1, 0, 0, 0, &arg, nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; EXPECT_SUCCESS(clUpdateMutableCommandsKHR(command_buffer, num_configs, @@ -1278,11 +1278,11 @@ TEST_F(CommandBufferMultiMutableBufferArgTest, UpdateSingleDispatch) { // Now try and enqueue the command buffer updating the output buffer of the // first nd range. const cl_mutable_dispatch_arg_khr arg{0, sizeof(cl_mem), &updated_src_buffer}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 1, 0, 0, 0, &arg, nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; EXPECT_SUCCESS(clUpdateMutableCommandsKHR(command_buffer, num_configs, @@ -1359,26 +1359,27 @@ TEST_F(CommandBufferMultiMutableBufferArgTest, UpdateMultipleDispatches) { // nd ranges. const cl_mutable_dispatch_arg_khr first_arg{0, sizeof(cl_mem), &first_updated_src_buffer}; - cl_mutable_dispatch_config_khr first_dispatch_config{ + const cl_mutable_dispatch_config_khr first_dispatch_config{ command_handle, 1, 0, 0, 0, &first_arg, nullptr, nullptr, nullptr, nullptr, nullptr}; const cl_mutable_dispatch_arg_khr second_arg{0, sizeof(cl_mem), &second_updated_src_buffer}; - cl_mutable_dispatch_config_khr second_dispatch_config{second_command_handle, - 1, - 0, - 0, - 0, - &second_arg, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr}; + const cl_mutable_dispatch_config_khr second_dispatch_config{ + second_command_handle, + 1, + 0, + 0, + 0, + &second_arg, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr}; const cl_uint num_configs = 2; - cl_command_buffer_update_type_khr config_types[2] = { + const cl_command_buffer_update_type_khr config_types[2] = { CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR, CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR}; const void *configs[2] = {&first_dispatch_config, &second_dispatch_config}; @@ -1502,11 +1503,11 @@ TEST_F(MutableDispatchTest, UpdateConstantBuffer) { // Now try and enqueue the command buffer updating the input buffer. const cl_mutable_dispatch_arg_khr arg{0, sizeof(cl_mem), &updated_src_buffer}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 1, 0, 0, 0, &arg, nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; EXPECT_SUCCESS(clUpdateMutableCommandsKHR(command_buffer, num_configs, @@ -1609,11 +1610,11 @@ TEST_F(CommandBufferMutableLocalBufferArgTest, UpdateOnce) { // Update the local buffer size. const cl_mutable_dispatch_arg_khr arg{0, 32, nullptr}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 1, 0, 0, 0, &arg, nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; EXPECT_SUCCESS(clUpdateMutableCommandsKHR(command_buffer, num_configs, @@ -1632,11 +1633,11 @@ TEST_F(CommandBufferMutableLocalBufferArgTest, UpdateTwice) { // Update the local buffer size. const cl_mutable_dispatch_arg_khr arg{0, 32, nullptr}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 1, 0, 0, 0, &arg, nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; EXPECT_SUCCESS(clUpdateMutableCommandsKHR(command_buffer, num_configs, @@ -1649,11 +1650,11 @@ TEST_F(CommandBufferMutableLocalBufferArgTest, UpdateTwice) { // Update the local buffer size a second time. const cl_mutable_dispatch_arg_khr arg_2{0, 32, nullptr}; - cl_mutable_dispatch_config_khr dispatch_config_2{ + const cl_mutable_dispatch_config_khr dispatch_config_2{ command_handle, 1, 0, 0, 0, &arg_2, nullptr, nullptr, nullptr, nullptr, nullptr}; const cl_uint num_configs_2 = 1; - cl_command_buffer_update_type_khr config_types_2[1] = { + const cl_command_buffer_update_type_khr config_types_2[1] = { CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR}; const void *configs_2[1] = {&dispatch_config_2}; EXPECT_SUCCESS(clUpdateMutableCommandsKHR(command_buffer, num_configs_2, @@ -1788,11 +1789,11 @@ TEST_F(DISABLED_CommandBufferMutableNullArgTest, // Update the input to null and enqueue a second time. const cl_mutable_dispatch_arg_khr arg{0, sizeof(cl_mem), nullptr}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 1, 0, 0, 0, &arg, nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; EXPECT_SUCCESS(clUpdateMutableCommandsKHR(command_buffer, num_configs, @@ -1845,11 +1846,11 @@ TEST_F(DISABLED_CommandBufferMutableNullArgTest, // Update the input to pointer to null. const cl_int *null = nullptr; const cl_mutable_dispatch_arg_khr arg{0, sizeof(cl_mem), &null}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 1, 0, 0, 0, &arg, nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; EXPECT_SUCCESS(clUpdateMutableCommandsKHR(command_buffer, num_configs, @@ -1900,11 +1901,11 @@ TEST_F(DISABLED_CommandBufferMutableNullArgTest, // Update the input to null. const cl_mutable_dispatch_arg_khr arg{0, sizeof(cl_mem), &src_buffer}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 1, 0, 0, 0, &arg, nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; EXPECT_SUCCESS(clUpdateMutableCommandsKHR(command_buffer, num_configs, @@ -1956,11 +1957,11 @@ TEST_F(DISABLED_CommandBufferMutableNullArgTest, // Update the input to null. const cl_mutable_dispatch_arg_khr arg{0, sizeof(cl_mem), &src_buffer}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 1, 0, 0, 0, &arg, nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; EXPECT_SUCCESS(clUpdateMutableCommandsKHR(command_buffer, num_configs, @@ -2009,11 +2010,11 @@ TEST_F(DISABLED_CommandBufferMutableNullArgTest, CheckUpdatePersists) { // Update the input to null and enqueue a second time. const cl_mutable_dispatch_arg_khr arg{0, sizeof(cl_mem), nullptr}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 1, 0, 0, 0, &arg, nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; EXPECT_SUCCESS(clUpdateMutableCommandsKHR(command_buffer, num_configs, @@ -2143,11 +2144,11 @@ TEST_F(DISABLED_CommandBufferMultiMutableNullArgTest, UpdateSingleDispatch) { // Update the input of the first nd range to null and enqueue a second time. const cl_mutable_dispatch_arg_khr arg{0, sizeof(cl_mem), nullptr}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 1, 0, 0, 0, &arg, nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; EXPECT_SUCCESS(clUpdateMutableCommandsKHR(command_buffer, num_configs, @@ -2192,25 +2193,26 @@ TEST_F(DISABLED_CommandBufferMultiMutableNullArgTest, // Update the input of both nd ranges to null and enqueue a second time. const cl_mutable_dispatch_arg_khr first_arg{0, sizeof(cl_mem), nullptr}; - cl_mutable_dispatch_config_khr first_dispatch_config{ + const cl_mutable_dispatch_config_khr first_dispatch_config{ command_handle, 1, 0, 0, 0, &first_arg, nullptr, nullptr, nullptr, nullptr, nullptr}; const cl_mutable_dispatch_arg_khr second_arg{0, sizeof(cl_mem), nullptr}; - cl_mutable_dispatch_config_khr second_dispatch_config{second_command_handle, - 1, - 0, - 0, - 0, - &second_arg, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr}; + const cl_mutable_dispatch_config_khr second_dispatch_config{ + second_command_handle, + 1, + 0, + 0, + 0, + &second_arg, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr}; const cl_uint num_configs = 2; - cl_command_buffer_update_type_khr config_types[2] = { + const cl_command_buffer_update_type_khr config_types[2] = { CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR, CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR}; const void *configs[2] = {&first_dispatch_config, &second_dispatch_config}; @@ -2328,11 +2330,11 @@ TEST_F(CommandBufferMutablePODArgTest, InvalidArgSize) { ucl::Environment::instance->GetInputGenerator().GenerateInt(); const cl_mutable_dispatch_arg_khr arg{0, sizeof(cl_int4), &updated_input_value}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 1, 0, 0, 0, &arg, nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; EXPECT_EQ_ERRCODE(CL_INVALID_ARG_SIZE, @@ -2365,11 +2367,11 @@ TEST_F(CommandBufferMutablePODArgTest, UpdateInputOnce) { ucl::Environment::instance->GetInputGenerator().GenerateInt(); const cl_mutable_dispatch_arg_khr arg{0, sizeof(cl_int), &updated_input_value}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 1, 0, 0, 0, &arg, nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; EXPECT_SUCCESS(clUpdateMutableCommandsKHR(command_buffer, num_configs, @@ -2411,11 +2413,11 @@ TEST_F(CommandBufferMutablePODArgTest, UpdateInputTwice) { ucl::Environment::instance->GetInputGenerator().GenerateInt(); const cl_mutable_dispatch_arg_khr first_arg{0, sizeof(cl_int), &first_updated_input_value}; - cl_mutable_dispatch_config_khr first_dispatch_config{ + const cl_mutable_dispatch_config_khr first_dispatch_config{ command_handle, 1, 0, 0, 0, &first_arg, nullptr, nullptr, nullptr, nullptr, nullptr}; const cl_uint first_num_configs = 1; - cl_command_buffer_update_type_khr first_config_types[1] = { + const cl_command_buffer_update_type_khr first_config_types[1] = { CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR}; const void *first_configs[1] = {&first_dispatch_config}; EXPECT_SUCCESS(clUpdateMutableCommandsKHR(command_buffer, first_num_configs, @@ -2441,11 +2443,11 @@ TEST_F(CommandBufferMutablePODArgTest, UpdateInputTwice) { ucl::Environment::instance->GetInputGenerator().GenerateInt(); const cl_mutable_dispatch_arg_khr second_arg{0, sizeof(cl_int), &second_updated_input_value}; - cl_mutable_dispatch_config_khr second_dispatch_config{ + const cl_mutable_dispatch_config_khr second_dispatch_config{ command_handle, 1, 0, 0, 0, &second_arg, nullptr, nullptr, nullptr, nullptr, nullptr}; const cl_uint second_num_configs = 1; - cl_command_buffer_update_type_khr second_config_types[1] = { + const cl_command_buffer_update_type_khr second_config_types[1] = { CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR}; const void *second_configs[1] = {&second_dispatch_config}; EXPECT_SUCCESS(clUpdateMutableCommandsKHR( @@ -2488,11 +2490,11 @@ TEST_F(CommandBufferMutablePODArgTest, CheckUpdatePersists) { ucl::Environment::instance->GetInputGenerator().GenerateInt(); const cl_mutable_dispatch_arg_khr arg{0, sizeof(cl_int), &updated_input_value}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 1, 0, 0, 0, &arg, nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; EXPECT_SUCCESS(clUpdateMutableCommandsKHR(command_buffer, num_configs, @@ -2622,11 +2624,11 @@ TEST_F(CommandBufferMultiMutablePODArgTest, UpdateSingleDispatch) { ucl::Environment::instance->GetInputGenerator().GenerateInt(); const cl_mutable_dispatch_arg_khr arg{0, sizeof(cl_int), &updated_input_value}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 1, 0, 0, 0, &arg, nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; EXPECT_SUCCESS(clUpdateMutableCommandsKHR(command_buffer, num_configs, @@ -2685,7 +2687,7 @@ TEST_F(CommandBufferMultiMutablePODArgTest, UpdateMultipleDispatches) { ucl::Environment::instance->GetInputGenerator().GenerateInt(); const cl_mutable_dispatch_arg_khr first_arg{0, sizeof(cl_int), &first_updated_input_value}; - cl_mutable_dispatch_config_khr first_dispatch_config{ + const cl_mutable_dispatch_config_khr first_dispatch_config{ command_handle, 1, 0, 0, 0, &first_arg, nullptr, nullptr, nullptr, nullptr, nullptr}; @@ -2693,20 +2695,21 @@ TEST_F(CommandBufferMultiMutablePODArgTest, UpdateMultipleDispatches) { ucl::Environment::instance->GetInputGenerator().GenerateInt(); const cl_mutable_dispatch_arg_khr second_arg{0, sizeof(cl_int), &second_updated_input_value}; - cl_mutable_dispatch_config_khr second_dispatch_config{second_command_handle, - 1, - 0, - 0, - 0, - &second_arg, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr}; + const cl_mutable_dispatch_config_khr second_dispatch_config{ + second_command_handle, + 1, + 0, + 0, + 0, + &second_arg, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr}; const cl_uint num_configs = 2; - cl_command_buffer_update_type_khr config_types[2] = { + const cl_command_buffer_update_type_khr config_types[2] = { CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR, CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR}; @@ -2860,11 +2863,11 @@ TEST_F(CommandBufferMutablePODMultiArgTest, const cl_mutable_dispatch_arg_khr arg_2{1, sizeof(cl_int), &updated_input_y_data}; const cl_mutable_dispatch_arg_khr args[] = {arg_1, arg_2}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 2, 0, 0, 0, args, nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; EXPECT_SUCCESS(clUpdateMutableCommandsKHR(command_buffer, num_configs, @@ -2911,14 +2914,14 @@ TEST_F(CommandBufferMutablePODMultiArgTest, &updated_input_x_data}; const cl_mutable_dispatch_arg_khr arg_2{1, sizeof(cl_int), &updated_input_y_data}; - cl_mutable_dispatch_config_khr dispatch_config_1{ + const cl_mutable_dispatch_config_khr dispatch_config_1{ command_handle, 1, 0, 0, 0, &arg_1, nullptr, nullptr, nullptr, nullptr, nullptr}; - cl_mutable_dispatch_config_khr dispatch_config_2{ + const cl_mutable_dispatch_config_khr dispatch_config_2{ command_handle, 1, 0, 0, 0, &arg_2, nullptr, nullptr, nullptr, nullptr, nullptr}; const cl_uint num_configs = 2; - cl_command_buffer_update_type_khr config_types[2] = { + const cl_command_buffer_update_type_khr config_types[2] = { CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR, CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR}; const void *configs[2] = {&dispatch_config_1, &dispatch_config_2}; @@ -3027,11 +3030,11 @@ TEST_F(CommandBufferMutableStructArgTest, UpdateInputOnce) { // Now try and enqueue the command buffer updating the output buffer. const test_struct second_value{99, 42.0f, 'j'}; const cl_mutable_dispatch_arg_khr arg{0, sizeof(test_struct), &second_value}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 1, 0, 0, 0, &arg, nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; EXPECT_SUCCESS(clUpdateMutableCommandsKHR(command_buffer, num_configs, diff --git a/source/cl/test/UnitCL/source/cl_khr_command_buffer_mutable_dispatch/clUpdateMutableCommandsKHR.cpp b/source/cl/test/UnitCL/source/cl_khr_command_buffer_mutable_dispatch/clUpdateMutableCommandsKHR.cpp index 583fd0dc2..c01e42039 100644 --- a/source/cl/test/UnitCL/source/cl_khr_command_buffer_mutable_dispatch/clUpdateMutableCommandsKHR.cpp +++ b/source/cl/test/UnitCL/source/cl_khr_command_buffer_mutable_dispatch/clUpdateMutableCommandsKHR.cpp @@ -164,20 +164,20 @@ TEST_F(CommandBufferUpdateNDKernel, InvalidSimulataneousUse) { // command object TEST_F(CommandBufferUpdateNDKernel, NullHandle) { ASSERT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); - cl_mutable_dispatch_config_khr dispatch_config{nullptr /* command */, - 0, - 0, - 0, - 0, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr}; + const cl_mutable_dispatch_config_khr dispatch_config{nullptr /* command */, + 0, + 0, + 0, + 0, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr}; 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}; @@ -205,7 +205,7 @@ TEST_F(CommandBufferUpdateNDKernel, InvalidHandle) { EXPECT_SUCCESS(clFinalizeCommandBufferKHR(new_command_buffer)); const cl_mutable_dispatch_arg_khr arg{1, sizeof(cl_mem), &dst_buffer}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ new_command_handle /* command */, 1, 0, @@ -219,7 +219,7 @@ TEST_F(CommandBufferUpdateNDKernel, InvalidHandle) { nullptr}; 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}; @@ -295,11 +295,11 @@ TEST_F(CommandBufferUpdateNDKernel, ImmutablePropertyBit) { ASSERT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); const cl_mutable_dispatch_arg_khr arg{1, sizeof(cl_mem), &dst_buffer}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 1, 0, 0, 0, &arg, nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; @@ -333,7 +333,7 @@ TEST_F(CommandBufferUpdateNDKernel, InvalidArgList) { nullptr}; 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}; @@ -372,12 +372,12 @@ TEST_F(CommandBufferUpdateNDKernel, InvalidArgIndex) { ASSERT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); const cl_mutable_dispatch_arg_khr arg = {3 /* arg_index */, sizeof(cl_mem), &src_buffer}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 1, 0, 0, 0, &arg, nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; @@ -432,12 +432,12 @@ TEST_F(CommandBufferUpdateNDKernel, InvalidArgValue) { EXPECT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); const cl_mutable_dispatch_arg_khr arg = {0, sizeof(cl_mem), &image /* arg_value */}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 1, 0, 0, 0, &arg, nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; @@ -460,12 +460,12 @@ TEST_F(CommandBufferUpdateNDKernel, InvalidArgSize) { ASSERT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); const cl_mutable_dispatch_arg_khr arg = {0, 2 /* arg_size */, &src_buffer}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 1, 0, 0, 0, &arg, nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; @@ -522,12 +522,12 @@ TEST_F(CommandBufferUpdateNDKernel, IterativeArgumentUpdate) { // Update both the input and output buffer, reusing the same // cl_mutable_dispatch_arg_khr struct cl_mutable_dispatch_arg_khr arg{0, sizeof(cl_mem), &updated_src_buffer}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 1, 0, 0, 0, &arg, nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; @@ -607,11 +607,11 @@ TEST_F(CommandBufferUpdateNDKernel, OverwriteArgumentUpdate) { // Update both the input and output buffer, reusing the same // cl_mutable_dispatch_arg_khr struct cl_mutable_dispatch_arg_khr arg{1, sizeof(cl_mem), &unused_dst_buffer}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 1, 0, 0, 0, &arg, nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; @@ -677,12 +677,12 @@ TEST_F(CommandBufferUpdateNDKernel, NoMutablePropertiesSet) { // Update the output buffer const cl_mutable_dispatch_arg_khr arg{1, sizeof(cl_mem), &updated_dst_buffer}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 1, 0, 0, 0, &arg, nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; @@ -799,12 +799,12 @@ TEST_F(CommandBufferSimultaneousUpdate, UpdatePending) { const cl_mutable_dispatch_arg_khr args[2] = { {0, sizeof(cl_mem), &updated_src_buffer}, {1, sizeof(cl_mem), &updated_dst_buffer}}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 2, 0, 0, 0, args, nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; @@ -854,7 +854,7 @@ TEST_F(CommandBufferSimultaneousUpdate, ConsecutiveUpdate) { nullptr, nullptr, nullptr, nullptr, nullptr}; 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}; @@ -926,14 +926,14 @@ TEST_F(CommandBufferSimultaneousUpdate, MultipleCommands) { &updated_dst_buffer}; const cl_mutable_dispatch_arg_khr arg2 = {0, sizeof(cl_mem), &updated_dst_buffer}; - cl_mutable_dispatch_config_khr dispatch_configs[2] = { + const cl_mutable_dispatch_config_khr dispatch_configs[2] = { {command_handle, 1, 0, 0, 0, &arg1, nullptr, nullptr, nullptr, nullptr, nullptr}, {command_handle2, 1, 0, 0, 0, &arg2, nullptr, nullptr, nullptr, nullptr, nullptr}}; const cl_uint num_configs = 2; - cl_command_buffer_update_type_khr config_types[2] = { + const cl_command_buffer_update_type_khr config_types[2] = { CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR, CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR}; const void *configs[2] = {&dispatch_configs[0], &dispatch_configs[1]}; diff --git a/source/cl/test/UnitCL/source/cl_khr_command_buffer_mutable_dispatch/thread_safety.cpp b/source/cl/test/UnitCL/source/cl_khr_command_buffer_mutable_dispatch/thread_safety.cpp index 79fa89180..64fcca800 100644 --- a/source/cl/test/UnitCL/source/cl_khr_command_buffer_mutable_dispatch/thread_safety.cpp +++ b/source/cl/test/UnitCL/source/cl_khr_command_buffer_mutable_dispatch/thread_safety.cpp @@ -109,12 +109,12 @@ TEST_F(MutableDispatchThreadSafetyTest, UpdateInParallel) { // Create a mutable config. const cl_mutable_dispatch_arg_khr arg{0, sizeof(cl_int), &updated_input_value}; - cl_mutable_dispatch_config_khr dispatch_config{ + const cl_mutable_dispatch_config_khr dispatch_config{ command_handle, 1, 0, 0, 0, &arg, nullptr, nullptr, nullptr, nullptr, nullptr}; // Update the nd range. 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}; diff --git a/source/cl/test/UnitCL/source/cl_khr_command_buffer_mutable_dispatch/usm_arg_update.cpp b/source/cl/test/UnitCL/source/cl_khr_command_buffer_mutable_dispatch/usm_arg_update.cpp index 4efa8e7f5..5eabec440 100644 --- a/source/cl/test/UnitCL/source/cl_khr_command_buffer_mutable_dispatch/usm_arg_update.cpp +++ b/source/cl/test/UnitCL/source/cl_khr_command_buffer_mutable_dispatch/usm_arg_update.cpp @@ -151,7 +151,7 @@ TEST_F(MutableDispatchUSMTest, InvalidArgList) { nullptr}; 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}; ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, @@ -191,20 +191,20 @@ TEST_F(MutableDispatchUSMTest, InvalidArgIndex) { ASSERT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); const cl_mutable_dispatch_arg_khr arg{2 /* arg index */, 0, device_ptrs[1]}; - cl_mutable_dispatch_config_khr dispatch_config{command_handle, - 0, - 1 /* num_svm_args */, - 0, - 0, - nullptr, - &arg /* arg_svm_list */, - nullptr, - nullptr, - nullptr, - nullptr}; + const cl_mutable_dispatch_config_khr dispatch_config{command_handle, + 0, + 1 /* num_svm_args */, + 0, + 0, + nullptr, + &arg /* arg_svm_list */, + nullptr, + nullptr, + nullptr, + nullptr}; 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}; ASSERT_EQ_ERRCODE(CL_INVALID_ARG_INDEX, @@ -225,17 +225,17 @@ TEST_F(MutableDispatchUSMTest, InvalidArgValue) { ASSERT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); const cl_mutable_dispatch_arg_khr arg{0, 0, &out_buffer}; - cl_mutable_dispatch_config_khr dispatch_config{command_handle, - 0, - 1 /* num_svm_args */, - 0, - 0, - nullptr, - &arg /* arg_svm_list */, - nullptr, - nullptr, - nullptr, - nullptr}; + const cl_mutable_dispatch_config_khr dispatch_config{command_handle, + 0, + 1 /* num_svm_args */, + 0, + 0, + nullptr, + &arg /* arg_svm_list */, + nullptr, + nullptr, + nullptr, + nullptr}; // The interaction between cl_intel_unified_shared_memory and // cl_khr_command_buffer_mutable_dispatch is not specified but we assume that @@ -243,7 +243,7 @@ TEST_F(MutableDispatchUSMTest, InvalidArgValue) { // will clUpdateMutableCommandsKHR. 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}; ASSERT_SUCCESS(clUpdateMutableCommandsKHR(command_buffer, num_configs, @@ -320,19 +320,19 @@ TEST_P(MutableDispatchUpdateUSMArgs, NoOffset) { // Update both the input and argument to second device USM allocation const cl_mutable_dispatch_arg_khr arg{0, 0, ptrB}; - cl_mutable_dispatch_config_khr dispatch_config{command_handle, - 0, - 1, /* num_svm_args */ - 0, - 0, - nullptr, - &arg, /* arg_svm_list */ - nullptr, - nullptr, - nullptr, - nullptr}; + const cl_mutable_dispatch_config_khr dispatch_config{command_handle, + 0, + 1, /* num_svm_args */ + 0, + 0, + nullptr, + &arg, /* arg_svm_list */ + nullptr, + nullptr, + nullptr, + nullptr}; 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}; ASSERT_SUCCESS(clUpdateMutableCommandsKHR(command_buffer, num_configs, @@ -410,19 +410,19 @@ TEST_P(MutableDispatchUpdateUSMArgs, Offset) { // Update both the input and argument to second device USM allocation const cl_mutable_dispatch_arg_khr arg{0, 0, offset_ptrB}; - cl_mutable_dispatch_config_khr dispatch_config{command_handle, - 0, - 1, /* num_svm_args */ - 0, - 0, - nullptr, - &arg, /* arg_svm_list */ - nullptr, - nullptr, - nullptr, - nullptr}; + const cl_mutable_dispatch_config_khr dispatch_config{command_handle, + 0, + 1, /* num_svm_args */ + 0, + 0, + nullptr, + &arg, /* arg_svm_list */ + nullptr, + nullptr, + nullptr, + nullptr}; 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}; ASSERT_SUCCESS(clUpdateMutableCommandsKHR(command_buffer, num_configs, @@ -535,19 +535,19 @@ TEST_F(MutableDispatchUSMTest, DISABLED_UpdateBlockingFree) { // Update both the input and argument to second device USM allocation const cl_mutable_dispatch_arg_khr arg{0, 0, usm_ptrB}; - cl_mutable_dispatch_config_khr dispatch_config{command_handle, - 0, - 1, /* num_svm_args */ - 0, - 0, - nullptr, - &arg, /* arg_svm_list */ - nullptr, - nullptr, - nullptr, - nullptr}; + const cl_mutable_dispatch_config_khr dispatch_config{command_handle, + 0, + 1, /* num_svm_args */ + 0, + 0, + nullptr, + &arg, /* arg_svm_list */ + nullptr, + nullptr, + nullptr, + nullptr}; 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}; ASSERT_SUCCESS(clUpdateMutableCommandsKHR(command_buffer, num_configs,