From 153542b83c6612c9622b20b3d90bc8560575fd87 Mon Sep 17 00:00:00 2001 From: Ewan Crawford Date: Thu, 15 Aug 2024 14:15:55 +0100 Subject: [PATCH 1/2] Update command-buffer API to 0.9.5 Update cl_khr_command_buffer API to match breaking change from https://github.com/KhronosGroup/OpenCL-Docs/pull/1215 --- external/CMakeLists.txt | 4 +- .../examples/CommandBufferKHR/source/main.cpp | 18 +- .../MutableDispatchKHR/source/main.cpp | 2 +- .../include/extension/khr_command_buffer.h | 3 +- .../extension/source/khr_command_buffer.cpp | 84 +++-- .../khr_command_buffer_mutable_dispatch.cpp | 16 +- .../clCommandBarrierWithWaitListKHR.cpp | 60 ++-- .../clCommandCopyBufferKHR.cpp | 156 +++++----- .../clCommandCopyBufferRectKHR.cpp | 288 +++++++++--------- .../clCommandCopyBufferToImageKHR.cpp | 91 +++--- .../clCommandCopyImageKHR.cpp | 138 +++++---- .../clCommandCopyImageToBufferKHR.cpp | 80 ++--- .../clCommandFillBufferKHR.cpp | 156 +++++----- .../clCommandFillImageKHR.cpp | 89 +++--- .../clCommandNDRangeKernelKHR.cpp | 5 +- .../clEnqueueCommandBufferKHR.cpp | 10 +- .../clEnqueueCommandBufferKHRWithEvents.cpp | 92 +++--- .../cl_khr_command_buffer/thread_safety.cpp | 14 +- .../clEnqueueCommandBufferKHRMutability.cpp | 70 ++--- .../clGetMutableCommandInfoKHR.cpp | 8 +- .../clUpdateMutableCommandsKHR.cpp | 24 +- .../thread_safety.cpp | 2 +- .../usm_arg_update.cpp | 14 +- 23 files changed, 743 insertions(+), 681 deletions(-) diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index bb24b8392..71003601b 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -25,8 +25,8 @@ set(CMAKE_CXX_EXTENSIONS ON) # them available here rather here rather than in source/cl/external. FetchContent_Declare( OpenCLHeaders - GIT_REPOSITORY https://github.com/KhronosGroup/OpenCL-Headers.git - GIT_TAG v2024.05.08 + GIT_REPOSITORY git@github.com:EwanC/OpenCL-Headers.git + GIT_TAG ewan/command_properties ) FetchContent_MakeAvailable(OpenCLHeaders) diff --git a/source/cl/examples/CommandBufferKHR/source/main.cpp b/source/cl/examples/CommandBufferKHR/source/main.cpp index d03e4ed9b..2601118c2 100644 --- a/source/cl/examples/CommandBufferKHR/source/main.cpp +++ b/source/cl/examples/CommandBufferKHR/source/main.cpp @@ -141,20 +141,20 @@ int main(const int argc, const char **argv) { CL_CHECK(error); for (size_t tile_index = 0; tile_index < tile_count; tile_index++) { - CL_CHECK(clCommandCopyBufferKHR(command_buffer, nullptr, buffer_src1, - buffer_tile1, tile_index * tile_size, 0, - tile_size, 0, nullptr, nullptr, nullptr)); - CL_CHECK(clCommandCopyBufferKHR(command_buffer, nullptr, buffer_src2, - buffer_tile2, tile_index * tile_size, 0, - tile_size, 0, nullptr, nullptr, nullptr)); + CL_CHECK(clCommandCopyBufferKHR( + command_buffer, nullptr, nullptr, buffer_src1, buffer_tile1, + tile_index * tile_size, 0, tile_size, 0, nullptr, nullptr, nullptr)); + CL_CHECK(clCommandCopyBufferKHR( + command_buffer, nullptr, nullptr, buffer_src2, buffer_tile2, + tile_index * tile_size, 0, tile_size, 0, nullptr, nullptr, nullptr)); CL_CHECK(clCommandNDRangeKernelKHR(command_buffer, nullptr, nullptr, kernel, 1, nullptr, &tile_elements, nullptr, 0, nullptr, nullptr, nullptr)); - CL_CHECK(clCommandCopyBufferKHR(command_buffer, nullptr, buffer_res, - buffer_dst, 0, tile_index * tile_size, - tile_size, 0, nullptr, nullptr, nullptr)); + CL_CHECK(clCommandCopyBufferKHR( + command_buffer, nullptr, nullptr, buffer_res, buffer_dst, 0, + tile_index * tile_size, tile_size, 0, nullptr, nullptr, nullptr)); } CL_CHECK(clFinalizeCommandBufferKHR(command_buffer)); diff --git a/source/cl/examples/MutableDispatchKHR/source/main.cpp b/source/cl/examples/MutableDispatchKHR/source/main.cpp index 1f6783c6d..20075b181 100644 --- a/source/cl/examples/MutableDispatchKHR/source/main.cpp +++ b/source/cl/examples/MutableDispatchKHR/source/main.cpp @@ -155,7 +155,7 @@ int main(const int argc, const char **argv) { CL_CHECK(clSetKernelArg(kernel, 2, sizeof(cl_mem), &output_buffers[0])); // Instruct the nd-range command to allow for mutable kernel arguments - cl_ndrange_kernel_command_properties_khr mutable_properties[] = { + cl_command_properties_khr mutable_properties[] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; diff --git a/source/cl/source/extension/include/extension/khr_command_buffer.h b/source/cl/source/extension/include/extension/khr_command_buffer.h index acfc4bd3d..306be2aa4 100644 --- a/source/cl/source/extension/include/extension/khr_command_buffer.h +++ b/source/cl/source/extension/include/extension/khr_command_buffer.h @@ -116,8 +116,7 @@ struct _cl_mutable_command_khr final { /// @brief Command-buffer used to create mutable command cl_command_buffer_khr command_buffer; /// @brief List of properties passed on creation - cargo::small_vector - properties_list; + cargo::small_vector properties_list; /// @brief Fields of mutable kernel command that can be modified cl_mutable_dispatch_fields_khr updatable_fields = 0; /// @brief Work dimensions used on mutable-dispatch creation diff --git a/source/cl/source/extension/source/khr_command_buffer.cpp b/source/cl/source/extension/source/khr_command_buffer.cpp index 598780020..d5a697f48 100644 --- a/source/cl/source/extension/source/khr_command_buffer.cpp +++ b/source/cl/source/extension/source/khr_command_buffer.cpp @@ -1285,6 +1285,7 @@ CL_API_ENTRY cl_int CL_API_CALL clEnqueueCommandBufferKHR( CL_API_ENTRY cl_int CL_API_CALL clCommandBarrierWithWaitListKHR( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, + const cl_command_properties_khr *properties, cl_uint num_sync_points_in_wait_list, const cl_sync_point_khr *sync_point_wait_list, cl_sync_point_khr *sync_point, cl_mutable_command_khr *mutable_handle) { @@ -1300,6 +1301,11 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandBarrierWithWaitListKHR( OCL_CHECK(!sync_point_wait_list && num_sync_points_in_wait_list, return CL_INVALID_SYNC_POINT_WAIT_LIST_KHR); + // No properties defined for entry-point + if (properties && properties[0] != 0) { + return CL_INVALID_VALUE; + } + cargo::array_view wait_list( sync_point_wait_list, num_sync_points_in_wait_list); @@ -1311,8 +1317,9 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandBarrierWithWaitListKHR( CL_API_ENTRY cl_int CL_API_CALL clCommandCopyBufferKHR( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, - cl_mem src_buffer, cl_mem dst_buffer, size_t src_offset, size_t dst_offset, - size_t size, cl_uint num_sync_points_in_wait_list, + const cl_command_properties_khr *properties, cl_mem src_buffer, + cl_mem dst_buffer, size_t src_offset, size_t dst_offset, size_t size, + cl_uint num_sync_points_in_wait_list, const cl_sync_point_khr *sync_point_wait_list, cl_sync_point_khr *sync_point, cl_mutable_command_khr *mutable_handle) { const tracer::TraceGuard guard("clCommandCopyBufferKHR"); @@ -1326,6 +1333,11 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandCopyBufferKHR( OCL_CHECK(!sync_point_wait_list && num_sync_points_in_wait_list, return CL_INVALID_SYNC_POINT_WAIT_LIST_KHR); + // No properties defined for entry-point + if (properties && properties[0] != 0) { + return CL_INVALID_VALUE; + } + const cl_int error = cl::validate::CopyBufferArguments( command_buffer->command_queue, src_buffer, dst_buffer, src_offset, dst_offset, size); @@ -1344,9 +1356,10 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandCopyBufferKHR( CL_API_ENTRY cl_int CL_API_CALL clCommandCopyBufferRectKHR( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, - cl_mem src_buffer, cl_mem dst_buffer, const size_t *src_origin, - const size_t *dst_origin, const size_t *region, size_t src_row_pitch, - size_t src_slice_pitch, size_t dst_row_pitch, size_t dst_slice_pitch, + const cl_command_properties_khr *properties, cl_mem src_buffer, + cl_mem dst_buffer, const size_t *src_origin, const size_t *dst_origin, + const size_t *region, size_t src_row_pitch, size_t src_slice_pitch, + size_t dst_row_pitch, size_t dst_slice_pitch, cl_uint num_sync_points_in_wait_list, const cl_sync_point_khr *sync_point_wait_list, cl_sync_point_khr *sync_point, cl_mutable_command_khr *mutable_handle) { @@ -1360,6 +1373,10 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandCopyBufferRectKHR( return CL_INVALID_SYNC_POINT_WAIT_LIST_KHR); OCL_CHECK(!sync_point_wait_list && num_sync_points_in_wait_list, return CL_INVALID_SYNC_POINT_WAIT_LIST_KHR); + // No properties defined for entry-point + if (properties && properties[0] != 0) { + return CL_INVALID_VALUE; + } // The OpenCL spec has the following special cases for the pitches. if (src_row_pitch == 0) { @@ -1394,9 +1411,9 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandCopyBufferRectKHR( CL_API_ENTRY cl_int CL_API_CALL clCommandCopyBufferToImageKHR( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, - cl_mem src_buffer, cl_mem dst_image, size_t src_offset, - const size_t *dst_origin, const size_t *region, - cl_uint num_sync_points_in_wait_list, + const cl_command_properties_khr *properties, cl_mem src_buffer, + cl_mem dst_image, size_t src_offset, const size_t *dst_origin, + const size_t *region, cl_uint num_sync_points_in_wait_list, const cl_sync_point_khr *sync_point_wait_list, cl_sync_point_khr *sync_point, cl_mutable_command_khr *mutable_handle) { const tracer::TraceGuard guard( @@ -1410,6 +1427,10 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandCopyBufferToImageKHR( return CL_INVALID_SYNC_POINT_WAIT_LIST_KHR); OCL_CHECK(!sync_point_wait_list && num_sync_points_in_wait_list, return CL_INVALID_SYNC_POINT_WAIT_LIST_KHR); + // No properties defined for entry-point + if (properties && properties[0] != 0) { + return CL_INVALID_VALUE; + } const cl_int error = cl::validate::CopyBufferToImageArguments( command_buffer->command_queue, src_buffer, dst_image, src_offset, @@ -1429,9 +1450,9 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandCopyBufferToImageKHR( CL_API_ENTRY cl_int CL_API_CALL clCommandCopyImageKHR( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, - cl_mem src_image, cl_mem dst_image, const size_t *src_origin, - const size_t *dst_origin, const size_t *region, - cl_uint num_sync_points_in_wait_list, + const cl_command_properties_khr *properties, cl_mem src_image, + cl_mem dst_image, const size_t *src_origin, const size_t *dst_origin, + const size_t *region, cl_uint num_sync_points_in_wait_list, const cl_sync_point_khr *sync_point_wait_list, cl_sync_point_khr *sync_point, cl_mutable_command_khr *mutable_handle) { const tracer::TraceGuard guard("clCommandCopyImageKHR"); @@ -1444,6 +1465,10 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandCopyImageKHR( return CL_INVALID_SYNC_POINT_WAIT_LIST_KHR); OCL_CHECK(!sync_point_wait_list && num_sync_points_in_wait_list, return CL_INVALID_SYNC_POINT_WAIT_LIST_KHR); + // No properties defined for entry-point + if (properties && properties[0] != 0) { + return CL_INVALID_VALUE; + } const cl_int error = cl::validate::CopyImageArguments( command_buffer->command_queue, src_image, dst_image, src_origin, @@ -1463,9 +1488,9 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandCopyImageKHR( CL_API_ENTRY cl_int CL_API_CALL clCommandCopyImageToBufferKHR( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, - cl_mem src_image, cl_mem dst_buffer, const size_t *src_origin, - const size_t *region, size_t dst_offset, - cl_uint num_sync_points_in_wait_list, + const cl_command_properties_khr *properties, cl_mem src_image, + cl_mem dst_buffer, const size_t *src_origin, const size_t *region, + size_t dst_offset, cl_uint num_sync_points_in_wait_list, const cl_sync_point_khr *sync_point_wait_list, cl_sync_point_khr *sync_point, cl_mutable_command_khr *mutable_handle) { const tracer::TraceGuard guard( @@ -1479,6 +1504,10 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandCopyImageToBufferKHR( return CL_INVALID_SYNC_POINT_WAIT_LIST_KHR); OCL_CHECK(!sync_point_wait_list && num_sync_points_in_wait_list, return CL_INVALID_SYNC_POINT_WAIT_LIST_KHR); + // No properties defined for entry-point + if (properties && properties[0] != 0) { + return CL_INVALID_VALUE; + } const cl_int error = cl::validate::CopyImageToBufferArguments( command_buffer->command_queue, src_image, dst_buffer, src_origin, region, @@ -1498,8 +1527,9 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandCopyImageToBufferKHR( CL_API_ENTRY cl_int CL_API_CALL clCommandFillBufferKHR( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, - cl_mem buffer, const void *pattern, size_t pattern_size, size_t offset, - size_t size, cl_uint num_sync_points_in_wait_list, + const cl_command_properties_khr *properties, cl_mem buffer, + const void *pattern, size_t pattern_size, size_t offset, size_t size, + cl_uint num_sync_points_in_wait_list, const cl_sync_point_khr *sync_point_wait_list, cl_sync_point_khr *sync_point, cl_mutable_command_khr *mutable_handle) { const tracer::TraceGuard guard("clCommandFillBufferKHR"); @@ -1512,6 +1542,10 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandFillBufferKHR( return CL_INVALID_SYNC_POINT_WAIT_LIST_KHR); OCL_CHECK(!sync_point_wait_list && num_sync_points_in_wait_list, return CL_INVALID_SYNC_POINT_WAIT_LIST_KHR); + // No properties defined for entry-point + if (properties && properties[0] != 0) { + return CL_INVALID_VALUE; + } const cl_int error = cl::validate::FillBufferArguments(command_buffer->command_queue, buffer, @@ -1530,8 +1564,9 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandFillBufferKHR( CL_API_ENTRY cl_int CL_API_CALL clCommandFillImageKHR( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, - cl_mem image, const void *fill_color, const size_t *origin, - const size_t *region, cl_uint num_sync_points_in_wait_list, + const cl_command_properties_khr *properties, cl_mem image, + const void *fill_color, const size_t *origin, const size_t *region, + cl_uint num_sync_points_in_wait_list, const cl_sync_point_khr *sync_point_wait_list, cl_sync_point_khr *sync_point, cl_mutable_command_khr *mutable_handle) { const tracer::TraceGuard guard("clCommandFillImageKHR"); @@ -1544,6 +1579,10 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandFillImageKHR( return CL_INVALID_SYNC_POINT_WAIT_LIST_KHR); OCL_CHECK(!sync_point_wait_list && num_sync_points_in_wait_list, return CL_INVALID_SYNC_POINT_WAIT_LIST_KHR); + // No properties defined for entry-point + if (properties && properties[0] != 0) { + return CL_INVALID_VALUE; + } const cl_int error = cl::validate::FillImageArguments( command_buffer->command_queue, image, fill_color, origin, region); @@ -1561,8 +1600,8 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandFillImageKHR( CL_API_ENTRY cl_int CL_API_CALL clCommandNDRangeKernelKHR( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, - const cl_ndrange_kernel_command_properties_khr *properties, - cl_kernel kernel, cl_uint work_dim, const size_t *global_work_offset, + const cl_command_properties_khr *properties, cl_kernel kernel, + cl_uint work_dim, const size_t *global_work_offset, const size_t *global_work_size, const size_t *local_work_size, cl_uint num_sync_points_in_wait_list, const cl_sync_point_khr *sync_point_wait_list, @@ -1580,8 +1619,7 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandNDRangeKernelKHR( OCL_CHECK(!sync_point_wait_list && num_sync_points_in_wait_list, return CL_INVALID_SYNC_POINT_WAIT_LIST_KHR); - cargo::small_vector - properties_list; + cargo::small_vector properties_list; // CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR defaults to values supported by // the device in CL_DEVICE_MUTABLE_DISPATCH_CAPABILITIES_KHR @@ -1595,7 +1633,7 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandNDRangeKernelKHR( return CL_INVALID_VALUE; #endif - cl_ndrange_kernel_command_properties_khr seen = 0; + cl_command_properties_khr seen = 0; auto current = properties; do { const cl_command_buffer_properties_khr property = current[0]; diff --git a/source/cl/source/extension/source/khr_command_buffer_mutable_dispatch.cpp b/source/cl/source/extension/source/khr_command_buffer_mutable_dispatch.cpp index 3feec64fc..21eb24e96 100644 --- a/source/cl/source/extension/source/khr_command_buffer_mutable_dispatch.cpp +++ b/source/cl/source/extension/source/khr_command_buffer_mutable_dispatch.cpp @@ -60,7 +60,7 @@ cl_int extension::khr_command_buffer_mutable_dispatch::GetDeviceInfo( return CL_INVALID_DEVICE; } - cl_ndrange_kernel_command_properties_khr result = 0; + cl_command_properties_khr result = 0; if (CL_DEVICE_MUTABLE_DISPATCH_CAPABILITIES_KHR == param_name) { result = CL_MUTABLE_DISPATCH_ARGUMENTS_KHR; } else { @@ -73,8 +73,7 @@ cl_int extension::khr_command_buffer_mutable_dispatch::GetDeviceInfo( constexpr size_t type_size = sizeof(result); if (nullptr != param_value) { OCL_CHECK(param_value_size < type_size, return CL_INVALID_VALUE); - *static_cast(param_value) = - result; + *static_cast(param_value) = result; } OCL_SET_IF_NOT_NULL(param_value_size_ret, type_size); return CL_SUCCESS; @@ -174,13 +173,12 @@ CL_API_ENTRY cl_int CL_API_CALL clGetMutableCommandInfoKHR( case CL_MUTABLE_DISPATCH_PROPERTIES_ARRAY_KHR: { const auto &properties_list = command->properties_list; - OCL_SET_IF_NOT_NULL(param_value_size_ret, - sizeof(cl_ndrange_kernel_command_properties_khr) * - properties_list.size()); + OCL_SET_IF_NOT_NULL( + param_value_size_ret, + sizeof(cl_command_properties_khr) * properties_list.size()); OCL_CHECK( - param_value && param_value_size < - sizeof(cl_ndrange_kernel_command_properties_khr) * - properties_list.size(), + param_value && param_value_size < sizeof(cl_command_properties_khr) * + properties_list.size(), return CL_INVALID_VALUE); if (param_value) { std::copy(std::begin(properties_list), std::end(properties_list), diff --git a/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandBarrierWithWaitListKHR.cpp b/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandBarrierWithWaitListKHR.cpp index c95aada10..b608f0e3a 100644 --- a/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandBarrierWithWaitListKHR.cpp +++ b/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandBarrierWithWaitListKHR.cpp @@ -36,47 +36,49 @@ class clCommandBarrierWithWaitListTest : public cl_khr_command_buffer_Test { }; TEST_F(clCommandBarrierWithWaitListTest, InvalidCommandBuffer) { - ASSERT_EQ_ERRCODE(CL_INVALID_COMMAND_BUFFER_KHR, - clCommandBarrierWithWaitListKHR(nullptr, nullptr, 0, - nullptr, nullptr, nullptr)); + ASSERT_EQ_ERRCODE( + CL_INVALID_COMMAND_BUFFER_KHR, + clCommandBarrierWithWaitListKHR(nullptr, nullptr, nullptr, 0, nullptr, + nullptr, nullptr)); } TEST_F(clCommandBarrierWithWaitListTest, InvalidCommandQueue) { ASSERT_EQ_ERRCODE( CL_INVALID_COMMAND_QUEUE, - clCommandBarrierWithWaitListKHR(command_buffer, command_queue, 0, nullptr, - nullptr, nullptr)); + clCommandBarrierWithWaitListKHR(command_buffer, command_queue, nullptr, 0, + nullptr, nullptr, nullptr)); } TEST_F(clCommandBarrierWithWaitListTest, FinalizedCommandBuffer) { ASSERT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); - ASSERT_EQ_ERRCODE(CL_INVALID_OPERATION, - clCommandBarrierWithWaitListKHR(command_buffer, nullptr, 0, - nullptr, nullptr, nullptr)); + ASSERT_EQ_ERRCODE(CL_INVALID_OPERATION, clCommandBarrierWithWaitListKHR( + command_buffer, nullptr, nullptr, + 0, nullptr, nullptr, nullptr)); } TEST_F(clCommandBarrierWithWaitListTest, InvalidMutableHandle) { cl_mutable_command_khr handle; - ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, - clCommandBarrierWithWaitListKHR(command_buffer, nullptr, 0, - nullptr, nullptr, &handle)); + ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, clCommandBarrierWithWaitListKHR( + command_buffer, nullptr, nullptr, 0, + nullptr, nullptr, &handle)); } TEST_F(clCommandBarrierWithWaitListTest, InvalidSyncPoints) { - ASSERT_EQ_ERRCODE(CL_INVALID_SYNC_POINT_WAIT_LIST_KHR, - clCommandBarrierWithWaitListKHR(command_buffer, nullptr, 1, - nullptr, nullptr, nullptr)); + ASSERT_EQ_ERRCODE( + CL_INVALID_SYNC_POINT_WAIT_LIST_KHR, + clCommandBarrierWithWaitListKHR(command_buffer, nullptr, nullptr, 1, + nullptr, nullptr, nullptr)); cl_sync_point_khr sync_point; ASSERT_EQ_ERRCODE( CL_INVALID_SYNC_POINT_WAIT_LIST_KHR, - clCommandBarrierWithWaitListKHR(command_buffer, nullptr, 0, &sync_point, - nullptr, nullptr)); + clCommandBarrierWithWaitListKHR(command_buffer, nullptr, nullptr, 0, + &sync_point, nullptr, nullptr)); } TEST_F(clCommandBarrierWithWaitListTest, Default) { - ASSERT_SUCCESS(clCommandBarrierWithWaitListKHR(command_buffer, nullptr, 0, - nullptr, nullptr, nullptr)); + ASSERT_SUCCESS(clCommandBarrierWithWaitListKHR( + command_buffer, nullptr, nullptr, 0, nullptr, nullptr, nullptr)); ASSERT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); ASSERT_SUCCESS(clEnqueueCommandBufferKHR(0, nullptr, command_buffer, 0, nullptr, nullptr)); @@ -89,15 +91,15 @@ TEST_F(clCommandBarrierWithWaitListTest, Sync) { std::numeric_limits::max()}; ASSERT_SUCCESS(clCommandBarrierWithWaitListKHR( - command_buffer, nullptr, 0, nullptr, &sync_points[0], nullptr)); + command_buffer, nullptr, nullptr, 0, nullptr, &sync_points[0], nullptr)); ASSERT_NE(sync_points[0], std::numeric_limits::max()); ASSERT_SUCCESS(clCommandBarrierWithWaitListKHR( - command_buffer, nullptr, 0, nullptr, &sync_points[1], nullptr)); + command_buffer, nullptr, nullptr, 0, nullptr, &sync_points[1], nullptr)); ASSERT_NE(sync_points[1], std::numeric_limits::max()); ASSERT_SUCCESS(clCommandBarrierWithWaitListKHR( - command_buffer, nullptr, 2, sync_points, nullptr, nullptr)); + command_buffer, nullptr, nullptr, 2, sync_points, nullptr, nullptr)); } TEST_F(clCommandBarrierWithWaitListTest, FillAndCopy) { @@ -114,16 +116,16 @@ TEST_F(clCommandBarrierWithWaitListTest, FillAndCopy) { // Add the fill command to the buffer and finalize it. cl_uint pattern = 42; - EXPECT_SUCCESS(clCommandFillBufferKHR(command_buffer, nullptr, src_buffer, - &pattern, sizeof(pattern), 0, data_size, - 0, nullptr, nullptr, nullptr)); + EXPECT_SUCCESS(clCommandFillBufferKHR( + command_buffer, nullptr, nullptr, src_buffer, &pattern, sizeof(pattern), + 0, data_size, 0, nullptr, nullptr, nullptr)); - EXPECT_SUCCESS(clCommandBarrierWithWaitListKHR(command_buffer, nullptr, 0, - nullptr, nullptr, nullptr)); + EXPECT_SUCCESS(clCommandBarrierWithWaitListKHR( + command_buffer, nullptr, nullptr, 0, nullptr, nullptr, nullptr)); - EXPECT_SUCCESS(clCommandCopyBufferKHR(command_buffer, nullptr, src_buffer, - dst_buffer, 0, 0, data_size, 0, nullptr, - nullptr, nullptr)); + EXPECT_SUCCESS(clCommandCopyBufferKHR(command_buffer, nullptr, nullptr, + src_buffer, dst_buffer, 0, 0, data_size, + 0, nullptr, nullptr, nullptr)); EXPECT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); diff --git a/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandCopyBufferKHR.cpp b/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandCopyBufferKHR.cpp index e53b2f8aa..d00455282 100644 --- a/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandCopyBufferKHR.cpp +++ b/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandCopyBufferKHR.cpp @@ -63,9 +63,9 @@ TEST_F(CommandBufferCopyBufferTest, Default) { data_size_in_bytes, input_data.data(), 0, nullptr, nullptr)); - ASSERT_SUCCESS(clCommandCopyBufferKHR(command_buffer, nullptr, src_buffer, - dst_buffer, 0, 0, data_size_in_bytes, 0, - nullptr, nullptr, nullptr)); + ASSERT_SUCCESS(clCommandCopyBufferKHR( + command_buffer, nullptr, nullptr, src_buffer, dst_buffer, 0, 0, + data_size_in_bytes, 0, nullptr, nullptr, nullptr)); ASSERT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); ASSERT_SUCCESS(clEnqueueCommandBufferKHR(0, nullptr, command_buffer, 0, nullptr, nullptr)); @@ -84,45 +84,48 @@ TEST_F(CommandBufferCopyBufferTest, Sync) { std::numeric_limits::max(), std::numeric_limits::max()}; - ASSERT_SUCCESS(clCommandCopyBufferKHR(command_buffer, nullptr, src_buffer, - dst_buffer, 0, 0, data_size_in_bytes, 0, - nullptr, &sync_points[0], nullptr)); + ASSERT_SUCCESS(clCommandCopyBufferKHR( + command_buffer, nullptr, nullptr, src_buffer, dst_buffer, 0, 0, + data_size_in_bytes, 0, nullptr, &sync_points[0], nullptr)); ASSERT_NE(sync_points[0], std::numeric_limits::max()); - ASSERT_SUCCESS(clCommandCopyBufferKHR(command_buffer, nullptr, src_buffer, - dst_buffer, 0, 0, data_size_in_bytes, 0, - nullptr, &sync_points[1], nullptr)); + ASSERT_SUCCESS(clCommandCopyBufferKHR( + command_buffer, nullptr, nullptr, src_buffer, dst_buffer, 0, 0, + data_size_in_bytes, 0, nullptr, &sync_points[1], nullptr)); ASSERT_NE(sync_points[1], std::numeric_limits::max()); - ASSERT_SUCCESS(clCommandCopyBufferKHR(command_buffer, nullptr, src_buffer, - dst_buffer, 0, 0, data_size_in_bytes, 2, - sync_points, nullptr, nullptr)); + ASSERT_SUCCESS(clCommandCopyBufferKHR( + command_buffer, nullptr, nullptr, src_buffer, dst_buffer, 0, 0, + data_size_in_bytes, 2, sync_points, nullptr, nullptr)); } TEST_F(CommandBufferCopyBufferTest, InvalidCommandBuffer) { - ASSERT_EQ_ERRCODE( - CL_INVALID_COMMAND_BUFFER_KHR, - clCommandCopyBufferKHR(nullptr, nullptr, src_buffer, dst_buffer, 0, 0, - data_size_in_bytes, 0, nullptr, nullptr, nullptr)); + ASSERT_EQ_ERRCODE(CL_INVALID_COMMAND_BUFFER_KHR, + clCommandCopyBufferKHR( + nullptr, nullptr, nullptr, src_buffer, dst_buffer, 0, 0, + data_size_in_bytes, 0, nullptr, nullptr, nullptr)); ASSERT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); - ASSERT_EQ_ERRCODE(CL_INVALID_OPERATION, - clCommandCopyBufferKHR(command_buffer, nullptr, src_buffer, - dst_buffer, 0, 0, data_size_in_bytes, - 0, nullptr, nullptr, nullptr)); + ASSERT_EQ_ERRCODE( + CL_INVALID_OPERATION, + clCommandCopyBufferKHR(command_buffer, nullptr, nullptr, src_buffer, + dst_buffer, 0, 0, data_size_in_bytes, 0, nullptr, + nullptr, nullptr)); } TEST_F(CommandBufferCopyBufferTest, InvalidMemObjects) { ASSERT_EQ_ERRCODE( CL_INVALID_MEM_OBJECT, - clCommandCopyBufferKHR(command_buffer, nullptr, nullptr, dst_buffer, 0, 0, - data_size_in_bytes, 0, nullptr, nullptr, nullptr)); + clCommandCopyBufferKHR(command_buffer, nullptr, nullptr, nullptr, + dst_buffer, 0, 0, data_size_in_bytes, 0, nullptr, + nullptr, nullptr)); ASSERT_EQ_ERRCODE( CL_INVALID_MEM_OBJECT, - clCommandCopyBufferKHR(command_buffer, nullptr, src_buffer, nullptr, 0, 0, - data_size_in_bytes, 0, nullptr, nullptr, nullptr)); + clCommandCopyBufferKHR(command_buffer, nullptr, nullptr, src_buffer, + nullptr, 0, 0, data_size_in_bytes, 0, nullptr, + nullptr, nullptr)); } TEST_F(CommandBufferCopyBufferTest, InvalidContext) { @@ -137,14 +140,16 @@ TEST_F(CommandBufferCopyBufferTest, InvalidContext) { EXPECT_TRUE(other_buffer); EXPECT_SUCCESS(error); - EXPECT_EQ_ERRCODE(CL_INVALID_CONTEXT, - clCommandCopyBufferKHR( - command_buffer, nullptr, src_buffer, other_buffer, 0, 0, - data_size_in_bytes, 0, nullptr, nullptr, nullptr)); - EXPECT_EQ_ERRCODE(CL_INVALID_CONTEXT, - clCommandCopyBufferKHR( - command_buffer, nullptr, other_buffer, other_buffer, 0, - 0, data_size_in_bytes, 0, nullptr, nullptr, nullptr)); + EXPECT_EQ_ERRCODE( + CL_INVALID_CONTEXT, + clCommandCopyBufferKHR(command_buffer, nullptr, nullptr, src_buffer, + other_buffer, 0, 0, data_size_in_bytes, 0, nullptr, + nullptr, nullptr)); + EXPECT_EQ_ERRCODE( + CL_INVALID_CONTEXT, + clCommandCopyBufferKHR(command_buffer, nullptr, nullptr, other_buffer, + other_buffer, 0, 0, data_size_in_bytes, 0, nullptr, + nullptr, nullptr)); EXPECT_SUCCESS(clReleaseMemObject(other_buffer)); EXPECT_SUCCESS(clReleaseContext(other_context)); @@ -152,62 +157,69 @@ TEST_F(CommandBufferCopyBufferTest, InvalidContext) { TEST_F(CommandBufferCopyBufferTest, CopyOverlap) { const auto half_size = data_size_in_bytes / 2; - ASSERT_EQ_ERRCODE(CL_MEM_COPY_OVERLAP, - clCommandCopyBufferKHR(command_buffer, nullptr, src_buffer, - src_buffer, 0, 0, data_size_in_bytes, - 0, nullptr, nullptr, nullptr)); - - ASSERT_EQ_ERRCODE(CL_MEM_COPY_OVERLAP, - clCommandCopyBufferKHR(command_buffer, nullptr, src_buffer, - src_buffer, half_size, 1, half_size, - 0, nullptr, nullptr, nullptr)); - - ASSERT_EQ_ERRCODE(CL_MEM_COPY_OVERLAP, - clCommandCopyBufferKHR(command_buffer, nullptr, src_buffer, - src_buffer, half_size, 1, half_size, - 0, nullptr, nullptr, nullptr)); + ASSERT_EQ_ERRCODE( + CL_MEM_COPY_OVERLAP, + clCommandCopyBufferKHR(command_buffer, nullptr, nullptr, src_buffer, + src_buffer, 0, 0, data_size_in_bytes, 0, nullptr, + nullptr, nullptr)); + + ASSERT_EQ_ERRCODE( + CL_MEM_COPY_OVERLAP, + clCommandCopyBufferKHR(command_buffer, nullptr, nullptr, src_buffer, + src_buffer, half_size, 1, half_size, 0, nullptr, + nullptr, nullptr)); + + ASSERT_EQ_ERRCODE( + CL_MEM_COPY_OVERLAP, + clCommandCopyBufferKHR(command_buffer, nullptr, nullptr, src_buffer, + src_buffer, half_size, 1, half_size, 0, nullptr, + nullptr, nullptr)); } TEST_F(CommandBufferCopyBufferTest, InvalidOffset) { ASSERT_EQ_ERRCODE( CL_INVALID_VALUE, - clCommandCopyBufferKHR(command_buffer, nullptr, src_buffer, dst_buffer, - data_size_in_bytes + 1, 0, data_size_in_bytes, 0, - nullptr, nullptr, nullptr)); + clCommandCopyBufferKHR(command_buffer, nullptr, nullptr, src_buffer, + dst_buffer, data_size_in_bytes + 1, 0, + data_size_in_bytes, 0, nullptr, nullptr, nullptr)); ASSERT_EQ_ERRCODE( CL_INVALID_VALUE, - clCommandCopyBufferKHR(command_buffer, nullptr, src_buffer, dst_buffer, 0, - data_size_in_bytes + 1, data_size_in_bytes, 0, - nullptr, nullptr, nullptr)); + clCommandCopyBufferKHR(command_buffer, nullptr, nullptr, src_buffer, + dst_buffer, 0, data_size_in_bytes + 1, + data_size_in_bytes, 0, nullptr, nullptr, nullptr)); - ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, - clCommandCopyBufferKHR(command_buffer, nullptr, src_buffer, - dst_buffer, 0, 1, data_size_in_bytes, - 0, nullptr, nullptr, nullptr)); + ASSERT_EQ_ERRCODE( + CL_INVALID_VALUE, + clCommandCopyBufferKHR(command_buffer, nullptr, nullptr, src_buffer, + dst_buffer, 0, 1, data_size_in_bytes, 0, nullptr, + nullptr, nullptr)); - ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, - clCommandCopyBufferKHR(command_buffer, nullptr, src_buffer, - dst_buffer, 1, 0, data_size_in_bytes, - 0, nullptr, nullptr, nullptr)); + ASSERT_EQ_ERRCODE( + CL_INVALID_VALUE, + clCommandCopyBufferKHR(command_buffer, nullptr, nullptr, src_buffer, + dst_buffer, 1, 0, data_size_in_bytes, 0, nullptr, + nullptr, nullptr)); } TEST_F(CommandBufferCopyBufferTest, InvalidSize) { - ASSERT_EQ_ERRCODE( - CL_INVALID_VALUE, - clCommandCopyBufferKHR(command_buffer, nullptr, src_buffer, dst_buffer, 0, - 0, 0, 0, nullptr, nullptr, nullptr)); + ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, + clCommandCopyBufferKHR(command_buffer, nullptr, nullptr, + src_buffer, dst_buffer, 0, 0, 0, 0, + nullptr, nullptr, nullptr)); } TEST_F(CommandBufferCopyBufferTest, InvalidSyncPoints) { - ASSERT_EQ_ERRCODE(CL_INVALID_SYNC_POINT_WAIT_LIST_KHR, + ASSERT_EQ_ERRCODE( + CL_INVALID_SYNC_POINT_WAIT_LIST_KHR, - clCommandCopyBufferKHR(command_buffer, nullptr, src_buffer, - dst_buffer, 0, 0, data_size_in_bytes, - 1, nullptr, nullptr, nullptr)); + clCommandCopyBufferKHR(command_buffer, nullptr, nullptr, src_buffer, + dst_buffer, 0, 0, data_size_in_bytes, 1, nullptr, + nullptr, nullptr)); cl_sync_point_khr sync_point; - ASSERT_EQ_ERRCODE(CL_INVALID_SYNC_POINT_WAIT_LIST_KHR, - clCommandCopyBufferKHR(command_buffer, nullptr, src_buffer, - dst_buffer, 0, 0, data_size_in_bytes, - 0, &sync_point, nullptr, nullptr)); + ASSERT_EQ_ERRCODE( + CL_INVALID_SYNC_POINT_WAIT_LIST_KHR, + clCommandCopyBufferKHR(command_buffer, nullptr, nullptr, src_buffer, + dst_buffer, 0, 0, data_size_in_bytes, 0, + &sync_point, nullptr, nullptr)); } diff --git a/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandCopyBufferRectKHR.cpp b/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandCopyBufferRectKHR.cpp index 945d86089..1d7707372 100644 --- a/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandCopyBufferRectKHR.cpp +++ b/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandCopyBufferRectKHR.cpp @@ -119,9 +119,10 @@ TEST_P(CommandCopyBufferRectParamTest, CopyArbitraryRect) { // Push a CopyBufferRect into the command buffer and finalize it. EXPECT_SUCCESS(clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer, dst_buffer, src_origin.data(), - dst_origin.data(), region.data(), src_row_pitch, src_slice_pitch, - dst_row_pitch, dst_slice_pitch, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, src_buffer, dst_buffer, + src_origin.data(), dst_origin.data(), region.data(), src_row_pitch, + src_slice_pitch, dst_row_pitch, dst_slice_pitch, 0, nullptr, nullptr, + nullptr)); EXPECT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); // Enqueue the command buffer containing the copy. @@ -244,23 +245,25 @@ TEST_F(CommandCopyBufferRectTest, Sync) { std::numeric_limits::max()}; ASSERT_SUCCESS(clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer, src_buffer, src_origin.data(), - dst_origin.data(), region.data(), row_pitch, slice_pitch, row_pitch, - slice_pitch, 0, nullptr, &sync_points[0], nullptr)); + command_buffer, nullptr, nullptr, src_buffer, src_buffer, + src_origin.data(), dst_origin.data(), region.data(), row_pitch, + slice_pitch, row_pitch, slice_pitch, 0, nullptr, &sync_points[0], + nullptr)); ASSERT_NE(sync_points[0], std::numeric_limits::max()); ASSERT_SUCCESS(clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer, src_buffer, src_origin.data(), - dst_origin.data(), region.data(), row_pitch, slice_pitch, row_pitch, - slice_pitch, 0, nullptr, &sync_points[1], nullptr)); + command_buffer, nullptr, nullptr, src_buffer, src_buffer, + src_origin.data(), dst_origin.data(), region.data(), row_pitch, + slice_pitch, row_pitch, slice_pitch, 0, nullptr, &sync_points[1], + nullptr)); ASSERT_NE(sync_points[1], std::numeric_limits::max()); ASSERT_SUCCESS(clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer, src_buffer, src_origin.data(), - dst_origin.data(), region.data(), row_pitch, slice_pitch, row_pitch, - slice_pitch, 2, sync_points, nullptr, nullptr)); + command_buffer, nullptr, nullptr, src_buffer, src_buffer, + src_origin.data(), dst_origin.data(), region.data(), row_pitch, + slice_pitch, row_pitch, slice_pitch, 2, sync_points, nullptr, nullptr)); } // Tests we can successfully execute a copy rect command where the source and @@ -282,9 +285,9 @@ TEST_F(CommandCopyBufferRectTest, SrcDoesntOverlapDst) { const size_t row_pitch = 4; const size_t slice_pitch = 4 * row_pitch; ASSERT_SUCCESS(clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer, src_buffer, src_origin.data(), - dst_origin.data(), region.data(), row_pitch, slice_pitch, row_pitch, - slice_pitch, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, src_buffer, src_buffer, + src_origin.data(), dst_origin.data(), region.data(), row_pitch, + slice_pitch, row_pitch, slice_pitch, 0, nullptr, nullptr, nullptr)); // Finalize the buffer. ASSERT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); @@ -335,8 +338,8 @@ TEST_F(CommandCopyBufferRectTest, FillThenCopyRect) { // Push a fill into the command buffer. ASSERT_SUCCESS(clCommandFillBufferKHR( - command_buffer, nullptr, src_buffer, &fill_pattern, fill_pattern_size, - fill_offset, fill_size, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, src_buffer, &fill_pattern, + fill_pattern_size, fill_offset, fill_size, 0, nullptr, nullptr, nullptr)); // Push a copy buffer rect into the command buffer. Just copy the whole // buffer but treating it like an 8 x 8 x 8 cube. @@ -349,9 +352,10 @@ TEST_F(CommandCopyBufferRectTest, FillThenCopyRect) { const size_t dst_slice_pitch = 8 * dst_row_pitch; ASSERT_SUCCESS(clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer, dst_buffer, src_origin.data(), - dst_origin.data(), region.data(), src_row_pitch, src_slice_pitch, - dst_row_pitch, dst_slice_pitch, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, src_buffer, dst_buffer, + src_origin.data(), dst_origin.data(), region.data(), src_row_pitch, + src_slice_pitch, dst_row_pitch, dst_slice_pitch, 0, nullptr, nullptr, + nullptr)); // Finalize the command buffer. ASSERT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); @@ -425,10 +429,10 @@ TEST_F(CommandCopyBufferRectTest, MultipleCopyRectsSameBuffer) { const size_t dst_slice_pitch = 4 * dst_row_pitch; EXPECT_SUCCESS(clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer, out_buffer, src_a_origin.data(), - dst_origin_first_copy.data(), region.data(), src_a_row_pitch, - src_a_slice_pitch, dst_row_pitch, dst_slice_pitch, 0, nullptr, nullptr, - nullptr)); + command_buffer, nullptr, nullptr, src_buffer, out_buffer, + src_a_origin.data(), dst_origin_first_copy.data(), region.data(), + src_a_row_pitch, src_a_slice_pitch, dst_row_pitch, dst_slice_pitch, 0, + nullptr, nullptr, nullptr)); // Push a second CopyBufferRect into the command buffer treating the second // src buffer as a 16 x 16 square such that it copies a 4 x 4 region to the @@ -439,10 +443,10 @@ TEST_F(CommandCopyBufferRectTest, MultipleCopyRectsSameBuffer) { const size_t src_b_slice_pitch = 16 * src_a_row_pitch; EXPECT_SUCCESS(clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer_b, out_buffer, src_b_origin.data(), - dst_origin_second_copy.data(), region.data(), src_b_row_pitch, - src_b_slice_pitch, dst_row_pitch, dst_slice_pitch, 0, nullptr, nullptr, - nullptr)); + command_buffer, nullptr, nullptr, src_buffer_b, out_buffer, + src_b_origin.data(), dst_origin_second_copy.data(), region.data(), + src_b_row_pitch, src_b_slice_pitch, dst_row_pitch, dst_slice_pitch, 0, + nullptr, nullptr, nullptr)); // Finalize the buffer. EXPECT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); @@ -521,10 +525,10 @@ TEST_F(CommandCopyBufferRectTest, MultipleCopyRectsSameBufferOverlapping) { const size_t dst_slice_pitch = 4 * dst_row_pitch; EXPECT_SUCCESS(clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer, out_buffer, src_a_origin.data(), - dst_origin_first_copy.data(), region.data(), src_a_row_pitch, - src_a_slice_pitch, dst_row_pitch, dst_slice_pitch, 0, nullptr, nullptr, - nullptr)); + command_buffer, nullptr, nullptr, src_buffer, out_buffer, + src_a_origin.data(), dst_origin_first_copy.data(), region.data(), + src_a_row_pitch, src_a_slice_pitch, dst_row_pitch, dst_slice_pitch, 0, + nullptr, nullptr, nullptr)); // Push a second CopyBufferRect into the command buffer treating the second // src buffer as a 16 x 16 square such that it copies a 4 x 4 region to the @@ -535,10 +539,10 @@ TEST_F(CommandCopyBufferRectTest, MultipleCopyRectsSameBufferOverlapping) { const size_t src_b_slice_pitch = 16 * src_a_row_pitch; EXPECT_SUCCESS(clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer_b, out_buffer, src_b_origin.data(), - dst_origin_second_copy.data(), region.data(), src_b_row_pitch, - src_b_slice_pitch, dst_row_pitch, dst_slice_pitch, 0, nullptr, nullptr, - nullptr)); + command_buffer, nullptr, nullptr, src_buffer_b, out_buffer, + src_b_origin.data(), dst_origin_second_copy.data(), region.data(), + src_b_row_pitch, src_b_slice_pitch, dst_row_pitch, dst_slice_pitch, 0, + nullptr, nullptr, nullptr)); // Finalize the buffer. EXPECT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); @@ -614,7 +618,7 @@ TEST_F(CommandCopyBufferRectTest, MultipleCopyDifferentBuffers) { const size_t dst_a_slice_pitch = 32 * dst_a_row_pitch; EXPECT_SUCCESS(clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer, dst_buffer_a, + command_buffer, nullptr, nullptr, src_buffer, dst_buffer_a, src_origin_first_copy.data(), dst_a_origin.data(), region_first_copy.data(), src_row_pitch_first_copy, src_slice_pitch_first_copy, dst_a_row_pitch, dst_a_slice_pitch, 0, @@ -632,7 +636,7 @@ TEST_F(CommandCopyBufferRectTest, MultipleCopyDifferentBuffers) { const size_t dst_b_slice_pitch = 64 * dst_b_row_pitch; EXPECT_SUCCESS(clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer, dst_buffer_b, + command_buffer, nullptr, nullptr, src_buffer, dst_buffer_b, src_origin_second_copy.data(), dst_b_origin.data(), region_second_copy.data(), src_row_pitch_second_copy, src_slice_pitch_second_copy, dst_b_row_pitch, dst_b_slice_pitch, 0, @@ -701,9 +705,9 @@ TEST_F(CommandCopyBufferRectTest, MixedQueue) { const size_t slice_pitch = 16 * row_pitch; ASSERT_SUCCESS(clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer, dst_buffer, src_origin.data(), - dst_origin.data(), region.data(), row_pitch, slice_pitch, row_pitch, - slice_pitch, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, src_buffer, dst_buffer, + src_origin.data(), dst_origin.data(), region.data(), row_pitch, + slice_pitch, row_pitch, slice_pitch, 0, nullptr, nullptr, nullptr)); // Finalize the buffer. ASSERT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); @@ -745,7 +749,7 @@ TEST_F(CommandCopyBufferRectErrorTest, InvalidCommandBuffer) { ASSERT_EQ_ERRCODE( CL_INVALID_COMMAND_BUFFER_KHR, clCommandCopyBufferRectKHR( - nullptr, nullptr, src_buffer, dst_buffer, src_origin.data(), + nullptr, nullptr, nullptr, src_buffer, dst_buffer, src_origin.data(), dst_origin.data(), region.data(), row_pitch, slice_pitch, row_pitch, slice_pitch, 0, nullptr, nullptr, nullptr)); @@ -753,9 +757,9 @@ TEST_F(CommandCopyBufferRectErrorTest, InvalidCommandBuffer) { ASSERT_EQ_ERRCODE( CL_INVALID_OPERATION, clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer, dst_buffer, src_origin.data(), - dst_origin.data(), region.data(), row_pitch, slice_pitch, row_pitch, - slice_pitch, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, src_buffer, dst_buffer, + src_origin.data(), dst_origin.data(), region.data(), row_pitch, + slice_pitch, row_pitch, slice_pitch, 0, nullptr, nullptr, nullptr)); } TEST_F(CommandCopyBufferRectErrorTest, InvalidContext) { @@ -773,9 +777,9 @@ TEST_F(CommandCopyBufferRectErrorTest, InvalidContext) { EXPECT_EQ_ERRCODE( CL_INVALID_CONTEXT, clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer, other_buffer, src_origin.data(), - dst_origin.data(), region.data(), row_pitch, slice_pitch, row_pitch, - slice_pitch, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, src_buffer, other_buffer, + src_origin.data(), dst_origin.data(), region.data(), row_pitch, + slice_pitch, row_pitch, slice_pitch, 0, nullptr, nullptr, nullptr)); EXPECT_SUCCESS(clReleaseMemObject(other_buffer)); EXPECT_SUCCESS(clReleaseContext(other_context)); @@ -785,41 +789,41 @@ TEST_F(CommandCopyBufferRectErrorTest, InvalidMemObject) { ASSERT_EQ_ERRCODE( CL_INVALID_MEM_OBJECT, clCommandCopyBufferRectKHR( - command_buffer, nullptr, nullptr, dst_buffer, src_origin.data(), - dst_origin.data(), region.data(), row_pitch, slice_pitch, row_pitch, - slice_pitch, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, nullptr, dst_buffer, + src_origin.data(), dst_origin.data(), region.data(), row_pitch, + slice_pitch, row_pitch, slice_pitch, 0, nullptr, nullptr, nullptr)); ASSERT_EQ_ERRCODE( CL_INVALID_MEM_OBJECT, clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer, nullptr, src_origin.data(), - dst_origin.data(), region.data(), row_pitch, slice_pitch, row_pitch, - slice_pitch, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, src_buffer, nullptr, + src_origin.data(), dst_origin.data(), region.data(), row_pitch, + slice_pitch, row_pitch, slice_pitch, 0, nullptr, nullptr, nullptr)); } TEST_F(CommandCopyBufferRectErrorTest, InvalidOrigin) { ASSERT_EQ_ERRCODE( CL_INVALID_VALUE, clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer, dst_buffer, nullptr, + command_buffer, nullptr, nullptr, src_buffer, dst_buffer, nullptr, dst_origin.data(), region.data(), row_pitch, slice_pitch, row_pitch, slice_pitch, 0, nullptr, nullptr, nullptr)); ASSERT_EQ_ERRCODE( CL_INVALID_VALUE, clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer, dst_buffer, src_origin.data(), - nullptr, region.data(), row_pitch, slice_pitch, row_pitch, - slice_pitch, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, src_buffer, dst_buffer, + src_origin.data(), nullptr, region.data(), row_pitch, slice_pitch, + row_pitch, slice_pitch, 0, nullptr, nullptr, nullptr)); } TEST_F(CommandCopyBufferRectErrorTest, InvalidRegion) { ASSERT_EQ_ERRCODE( CL_INVALID_VALUE, clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer, dst_buffer, src_origin.data(), - dst_origin.data(), nullptr, row_pitch, slice_pitch, row_pitch, - slice_pitch, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, src_buffer, dst_buffer, + src_origin.data(), dst_origin.data(), nullptr, row_pitch, slice_pitch, + row_pitch, slice_pitch, 0, nullptr, nullptr, nullptr)); } TEST_F(CommandCopyBufferRectErrorTest, OutOfBounds) { @@ -827,27 +831,27 @@ TEST_F(CommandCopyBufferRectErrorTest, OutOfBounds) { ASSERT_EQ_ERRCODE( CL_INVALID_VALUE, clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer, dst_buffer, src_origin.data(), - dst_origin.data(), region.data(), row_pitch, slice_pitch, row_pitch, - slice_pitch, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, src_buffer, dst_buffer, + src_origin.data(), dst_origin.data(), region.data(), row_pitch, + slice_pitch, row_pitch, slice_pitch, 0, nullptr, nullptr, nullptr)); src_origin = {0, 0, 0}; dst_origin = {64, 64, 64}; ASSERT_EQ_ERRCODE( CL_INVALID_VALUE, clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer, dst_buffer, src_origin.data(), - dst_origin.data(), region.data(), row_pitch, slice_pitch, row_pitch, - slice_pitch, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, src_buffer, dst_buffer, + src_origin.data(), dst_origin.data(), region.data(), row_pitch, + slice_pitch, row_pitch, slice_pitch, 0, nullptr, nullptr, nullptr)); dst_origin = {0, 0, 0}; region = {64, 64, 64}; ASSERT_EQ_ERRCODE( CL_INVALID_VALUE, clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer, dst_buffer, src_origin.data(), - dst_origin.data(), region.data(), row_pitch, slice_pitch, row_pitch, - slice_pitch, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, src_buffer, dst_buffer, + src_origin.data(), dst_origin.data(), region.data(), row_pitch, + slice_pitch, row_pitch, slice_pitch, 0, nullptr, nullptr, nullptr)); } TEST_F(CommandCopyBufferRectErrorTest, InvalidRegionElementZero) { @@ -855,27 +859,27 @@ TEST_F(CommandCopyBufferRectErrorTest, InvalidRegionElementZero) { ASSERT_EQ_ERRCODE( CL_INVALID_VALUE, clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer, dst_buffer, src_origin.data(), - dst_origin.data(), region.data(), row_pitch, slice_pitch, row_pitch, - slice_pitch, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, src_buffer, dst_buffer, + src_origin.data(), dst_origin.data(), region.data(), row_pitch, + slice_pitch, row_pitch, slice_pitch, 0, nullptr, nullptr, nullptr)); region[0] = 16; region[1] = 0; ASSERT_EQ_ERRCODE( CL_INVALID_VALUE, clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer, dst_buffer, src_origin.data(), - dst_origin.data(), region.data(), row_pitch, slice_pitch, row_pitch, - slice_pitch, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, src_buffer, dst_buffer, + src_origin.data(), dst_origin.data(), region.data(), row_pitch, + slice_pitch, row_pitch, slice_pitch, 0, nullptr, nullptr, nullptr)); region[1] = 16; region[2] = 0; ASSERT_EQ_ERRCODE( CL_INVALID_VALUE, clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer, dst_buffer, src_origin.data(), - dst_origin.data(), region.data(), row_pitch, slice_pitch, row_pitch, - slice_pitch, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, src_buffer, dst_buffer, + src_origin.data(), dst_origin.data(), region.data(), row_pitch, + slice_pitch, row_pitch, slice_pitch, 0, nullptr, nullptr, nullptr)); region[2] = 16; } @@ -884,101 +888,101 @@ TEST_F(CommandCopyBufferRectErrorTest, InvalidRowPitch) { ASSERT_EQ_ERRCODE( CL_INVALID_VALUE, clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer, dst_buffer, src_origin.data(), - dst_origin.data(), region.data(), src_row_pitch, slice_pitch, - row_pitch, slice_pitch, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, src_buffer, dst_buffer, + src_origin.data(), dst_origin.data(), region.data(), src_row_pitch, + slice_pitch, row_pitch, slice_pitch, 0, nullptr, nullptr, nullptr)); src_row_pitch = region[0] - 1; ASSERT_EQ_ERRCODE( CL_INVALID_VALUE, clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer, dst_buffer, src_origin.data(), - dst_origin.data(), region.data(), src_row_pitch, slice_pitch, - row_pitch, slice_pitch, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, src_buffer, dst_buffer, + src_origin.data(), dst_origin.data(), region.data(), src_row_pitch, + slice_pitch, row_pitch, slice_pitch, 0, nullptr, nullptr, nullptr)); size_t dst_row_pitch = 1; - ASSERT_EQ_ERRCODE( - CL_INVALID_VALUE, - clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer, dst_buffer, src_origin.data(), - dst_origin.data(), region.data(), row_pitch, slice_pitch, - dst_row_pitch, slice_pitch, 0, nullptr, nullptr, nullptr)); + ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, + clCommandCopyBufferRectKHR( + command_buffer, nullptr, nullptr, src_buffer, + dst_buffer, src_origin.data(), dst_origin.data(), + region.data(), row_pitch, slice_pitch, dst_row_pitch, + slice_pitch, 0, nullptr, nullptr, nullptr)); dst_row_pitch = region[0] - 1; - ASSERT_EQ_ERRCODE( - CL_INVALID_VALUE, - clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer, dst_buffer, src_origin.data(), - dst_origin.data(), region.data(), row_pitch, slice_pitch, - dst_row_pitch, slice_pitch, 0, nullptr, nullptr, nullptr)); + ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, + clCommandCopyBufferRectKHR( + command_buffer, nullptr, nullptr, src_buffer, + dst_buffer, src_origin.data(), dst_origin.data(), + region.data(), row_pitch, slice_pitch, dst_row_pitch, + slice_pitch, 0, nullptr, nullptr, nullptr)); } TEST_F(CommandCopyBufferRectErrorTest, InvalidSlicePitch) { size_t src_slice_pitch = 1; - ASSERT_EQ_ERRCODE( - CL_INVALID_VALUE, - clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer, dst_buffer, src_origin.data(), - dst_origin.data(), region.data(), row_pitch, src_slice_pitch, - row_pitch, slice_pitch, 0, nullptr, nullptr, nullptr)); + ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, + clCommandCopyBufferRectKHR( + command_buffer, nullptr, nullptr, src_buffer, + dst_buffer, src_origin.data(), dst_origin.data(), + region.data(), row_pitch, src_slice_pitch, row_pitch, + slice_pitch, 0, nullptr, nullptr, nullptr)); src_slice_pitch = (region[1] * row_pitch) - 1; - ASSERT_EQ_ERRCODE( - CL_INVALID_VALUE, - clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer, dst_buffer, src_origin.data(), - dst_origin.data(), region.data(), row_pitch, src_slice_pitch, - row_pitch, slice_pitch, 0, nullptr, nullptr, nullptr)); + ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, + clCommandCopyBufferRectKHR( + command_buffer, nullptr, nullptr, src_buffer, + dst_buffer, src_origin.data(), dst_origin.data(), + region.data(), row_pitch, src_slice_pitch, row_pitch, + slice_pitch, 0, nullptr, nullptr, nullptr)); size_t dst_slice_pitch = 1; - ASSERT_EQ_ERRCODE( - CL_INVALID_VALUE, - clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer, dst_buffer, src_origin.data(), - dst_origin.data(), region.data(), row_pitch, slice_pitch, row_pitch, - dst_slice_pitch, 0, nullptr, nullptr, nullptr)); + ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, + clCommandCopyBufferRectKHR( + command_buffer, nullptr, nullptr, src_buffer, + dst_buffer, src_origin.data(), dst_origin.data(), + region.data(), row_pitch, slice_pitch, row_pitch, + dst_slice_pitch, 0, nullptr, nullptr, nullptr)); dst_slice_pitch = (region[1] * row_pitch) - 1; - ASSERT_EQ_ERRCODE( - CL_INVALID_VALUE, - clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer, dst_buffer, src_origin.data(), - dst_origin.data(), region.data(), row_pitch, slice_pitch, row_pitch, - dst_slice_pitch, 0, nullptr, nullptr, nullptr)); + ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, + clCommandCopyBufferRectKHR( + command_buffer, nullptr, nullptr, src_buffer, + dst_buffer, src_origin.data(), dst_origin.data(), + region.data(), row_pitch, slice_pitch, row_pitch, + dst_slice_pitch, 0, nullptr, nullptr, nullptr)); } TEST_F(CommandCopyBufferRectErrorTest, InvalidSameBufferPitchMismatch) { const size_t dst_row_pitch = row_pitch - 1; - ASSERT_EQ_ERRCODE( - CL_INVALID_VALUE, - clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer, dst_buffer, src_origin.data(), - dst_origin.data(), region.data(), row_pitch, slice_pitch, - dst_row_pitch, slice_pitch, 0, nullptr, nullptr, nullptr)); + ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, + clCommandCopyBufferRectKHR( + command_buffer, nullptr, nullptr, src_buffer, + dst_buffer, src_origin.data(), dst_origin.data(), + region.data(), row_pitch, slice_pitch, dst_row_pitch, + slice_pitch, 0, nullptr, nullptr, nullptr)); const size_t dst_slice_pitch = slice_pitch - 1; - ASSERT_EQ_ERRCODE( - CL_INVALID_VALUE, - clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer, dst_buffer, src_origin.data(), - dst_origin.data(), region.data(), row_pitch, slice_pitch, row_pitch, - dst_slice_pitch, 0, nullptr, nullptr, nullptr)); + ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, + clCommandCopyBufferRectKHR( + command_buffer, nullptr, nullptr, src_buffer, + dst_buffer, src_origin.data(), dst_origin.data(), + region.data(), row_pitch, slice_pitch, row_pitch, + dst_slice_pitch, 0, nullptr, nullptr, nullptr)); } TEST_F(CommandCopyBufferRectErrorTest, InvalidSyncPoints) { ASSERT_EQ_ERRCODE( CL_INVALID_SYNC_POINT_WAIT_LIST_KHR, clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer, dst_buffer, src_origin.data(), - dst_origin.data(), region.data(), row_pitch, slice_pitch, row_pitch, - slice_pitch, 1, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, src_buffer, dst_buffer, + src_origin.data(), dst_origin.data(), region.data(), row_pitch, + slice_pitch, row_pitch, slice_pitch, 1, nullptr, nullptr, nullptr)); cl_sync_point_khr sync_point; - ASSERT_EQ_ERRCODE( - CL_INVALID_SYNC_POINT_WAIT_LIST_KHR, - clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffer, dst_buffer, src_origin.data(), - dst_origin.data(), region.data(), row_pitch, slice_pitch, row_pitch, - slice_pitch, 0, &sync_point, nullptr, nullptr)); + ASSERT_EQ_ERRCODE(CL_INVALID_SYNC_POINT_WAIT_LIST_KHR, + clCommandCopyBufferRectKHR( + command_buffer, nullptr, nullptr, src_buffer, + dst_buffer, src_origin.data(), dst_origin.data(), + region.data(), row_pitch, slice_pitch, row_pitch, + slice_pitch, 0, &sync_point, nullptr, nullptr)); } diff --git a/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandCopyBufferToImageKHR.cpp b/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandCopyBufferToImageKHR.cpp index f06f8f0c3..46e7c8d70 100644 --- a/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandCopyBufferToImageKHR.cpp +++ b/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandCopyBufferToImageKHR.cpp @@ -97,9 +97,9 @@ TEST_F(CommandBufferCopyBufferToImageTest, Default) { const size_t origin[] = {0, 0, 0}; const size_t region[] = {image_width, image_height, 1}; - ASSERT_SUCCESS(clCommandCopyBufferToImageKHR(command_buffer, nullptr, buffer, - image, 0, origin, region, 0, - nullptr, nullptr, nullptr)); + ASSERT_SUCCESS(clCommandCopyBufferToImageKHR(command_buffer, nullptr, nullptr, + buffer, image, 0, origin, region, + 0, nullptr, nullptr, nullptr)); ASSERT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); ASSERT_SUCCESS(clEnqueueCommandBufferKHR(0, nullptr, command_buffer, 0, nullptr, nullptr)); @@ -125,36 +125,36 @@ TEST_F(CommandBufferCopyBufferToImageTest, Sync) { std::numeric_limits::max()}; ASSERT_SUCCESS(clCommandCopyBufferToImageKHR( - command_buffer, nullptr, buffer, image, 0, origin, region, 0, nullptr, - &sync_points[0], nullptr)); + command_buffer, nullptr, nullptr, buffer, image, 0, origin, region, 0, + nullptr, &sync_points[0], nullptr)); ASSERT_NE(sync_points[0], std::numeric_limits::max()); ASSERT_SUCCESS(clCommandCopyBufferToImageKHR( - command_buffer, nullptr, buffer, image, 0, origin, region, 0, nullptr, - &sync_points[1], nullptr)); + command_buffer, nullptr, nullptr, buffer, image, 0, origin, region, 0, + nullptr, &sync_points[1], nullptr)); ASSERT_NE(sync_points[1], std::numeric_limits::max()); - ASSERT_SUCCESS(clCommandCopyBufferToImageKHR(command_buffer, nullptr, buffer, - image, 0, origin, region, 2, - sync_points, nullptr, nullptr)); + ASSERT_SUCCESS(clCommandCopyBufferToImageKHR( + command_buffer, nullptr, nullptr, buffer, image, 0, origin, region, 2, + sync_points, nullptr, nullptr)); } TEST_F(CommandBufferCopyBufferToImageTest, InvalidCommandBuffer) { const size_t origin[] = {0, 0, 0}; const size_t region[] = {image_width, image_height, 1}; - ASSERT_EQ_ERRCODE( - CL_INVALID_COMMAND_BUFFER_KHR, - clCommandCopyBufferToImageKHR(nullptr, nullptr, buffer, image, 0, origin, - region, 0, nullptr, nullptr, nullptr)); + ASSERT_EQ_ERRCODE(CL_INVALID_COMMAND_BUFFER_KHR, + clCommandCopyBufferToImageKHR( + nullptr, nullptr, nullptr, buffer, image, 0, origin, + region, 0, nullptr, nullptr, nullptr)); ASSERT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); ASSERT_EQ_ERRCODE(CL_INVALID_OPERATION, clCommandCopyBufferToImageKHR( - command_buffer, nullptr, buffer, image, 0, origin, - region, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, buffer, image, 0, + origin, region, 0, nullptr, nullptr, nullptr)); } TEST_F(CommandBufferCopyBufferToImageTest, InvalidContext) { @@ -174,8 +174,8 @@ TEST_F(CommandBufferCopyBufferToImageTest, InvalidContext) { const size_t region[] = {image_width, image_height, 1}; EXPECT_EQ_ERRCODE(CL_INVALID_CONTEXT, clCommandCopyBufferToImageKHR( - command_buffer, nullptr, other_buffer, image, 0, origin, - region, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, other_buffer, image, + 0, origin, region, 0, nullptr, nullptr, nullptr)); EXPECT_SUCCESS(clReleaseMemObject(other_buffer)); EXPECT_SUCCESS(clReleaseContext(other_context)); @@ -186,12 +186,12 @@ TEST_F(CommandBufferCopyBufferToImageTest, InvalidMemObject) { const size_t region[] = {image_width, image_height, 1}; ASSERT_EQ_ERRCODE(CL_INVALID_MEM_OBJECT, clCommandCopyBufferToImageKHR( - command_buffer, nullptr, nullptr, image, 0, origin, - region, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, nullptr, image, 0, + origin, region, 0, nullptr, nullptr, nullptr)); ASSERT_EQ_ERRCODE(CL_INVALID_MEM_OBJECT, clCommandCopyBufferToImageKHR( - command_buffer, nullptr, buffer, nullptr, 0, origin, - region, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, buffer, nullptr, 0, + origin, region, 0, nullptr, nullptr, nullptr)); } TEST_F(CommandBufferCopyBufferToImageTest, InvalidSrcOffset) { @@ -199,14 +199,15 @@ TEST_F(CommandBufferCopyBufferToImageTest, InvalidSrcOffset) { const size_t region[] = {image_width, image_height, 1}; const size_t buffer_size = image_elements * sizeof(cl_float4); + ASSERT_EQ_ERRCODE( + CL_INVALID_VALUE, + clCommandCopyBufferToImageKHR(command_buffer, nullptr, nullptr, buffer, + image, buffer_size + 1, origin, region, 0, + nullptr, nullptr, nullptr)); ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, clCommandCopyBufferToImageKHR( - command_buffer, nullptr, buffer, image, buffer_size + 1, + command_buffer, nullptr, nullptr, buffer, image, 1, origin, region, 0, nullptr, nullptr, nullptr)); - ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, - clCommandCopyBufferToImageKHR( - command_buffer, nullptr, buffer, image, 1, origin, - region, 0, nullptr, nullptr, nullptr)); } TEST_F(CommandBufferCopyBufferToImageTest, InvalidDstOrigin) { @@ -214,19 +215,19 @@ TEST_F(CommandBufferCopyBufferToImageTest, InvalidDstOrigin) { const size_t region[] = {image_width, image_height, 1}; ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, clCommandCopyBufferToImageKHR( - command_buffer, nullptr, buffer, image, 0, origin, - region, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, buffer, image, 0, + origin, region, 0, nullptr, nullptr, nullptr)); origin[0] = 0; origin[1] = 1; ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, clCommandCopyBufferToImageKHR( - command_buffer, nullptr, buffer, image, 0, origin, - region, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, buffer, image, 0, + origin, region, 0, nullptr, nullptr, nullptr)); ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, clCommandCopyBufferToImageKHR( - command_buffer, nullptr, buffer, image, 0, nullptr, - region, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, buffer, image, 0, + nullptr, region, 0, nullptr, nullptr, nullptr)); } TEST_F(CommandBufferCopyBufferToImageTest, InvalidDstRegion) { @@ -234,25 +235,25 @@ TEST_F(CommandBufferCopyBufferToImageTest, InvalidDstRegion) { size_t region[] = {image_width + 1, image_height, 1}; ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, clCommandCopyBufferToImageKHR( - command_buffer, nullptr, buffer, image, 0, origin, - region, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, buffer, image, 0, + origin, region, 0, nullptr, nullptr, nullptr)); region[0] = image_width; region[1] = image_height + 1; ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, clCommandCopyBufferToImageKHR( - command_buffer, nullptr, buffer, image, 0, origin, - region, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, buffer, image, 0, + origin, region, 0, nullptr, nullptr, nullptr)); region[1] = image_height; region[2] = 2; ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, clCommandCopyBufferToImageKHR( - command_buffer, nullptr, buffer, image, 0, origin, - region, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, buffer, image, 0, + origin, region, 0, nullptr, nullptr, nullptr)); ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, clCommandCopyBufferToImageKHR( - command_buffer, nullptr, buffer, image, 0, origin, - nullptr, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, buffer, image, 0, + origin, nullptr, 0, nullptr, nullptr, nullptr)); } TEST_F(CommandBufferCopyBufferToImageTest, InvalidSyncPoints) { @@ -261,12 +262,12 @@ TEST_F(CommandBufferCopyBufferToImageTest, InvalidSyncPoints) { ASSERT_EQ_ERRCODE(CL_INVALID_SYNC_POINT_WAIT_LIST_KHR, clCommandCopyBufferToImageKHR( - command_buffer, nullptr, buffer, image, 0, origin, - region, 1, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, buffer, image, 0, + origin, region, 1, nullptr, nullptr, nullptr)); cl_sync_point_khr sync_point; ASSERT_EQ_ERRCODE(CL_INVALID_SYNC_POINT_WAIT_LIST_KHR, clCommandCopyBufferToImageKHR( - command_buffer, nullptr, buffer, image, 0, origin, - region, 0, &sync_point, nullptr, nullptr)); + command_buffer, nullptr, nullptr, buffer, image, 0, + origin, region, 0, &sync_point, nullptr, nullptr)); } diff --git a/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandCopyImageKHR.cpp b/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandCopyImageKHR.cpp index 0d21e3777..ab8031083 100644 --- a/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandCopyImageKHR.cpp +++ b/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandCopyImageKHR.cpp @@ -99,30 +99,30 @@ TEST_F(CommandBufferCopyImageTest, Sync) { std::numeric_limits::max(), std::numeric_limits::max()}; - ASSERT_SUCCESS(clCommandCopyImageKHR(command_buffer, nullptr, src_image, - dst_image, origin, origin, region, 0, - nullptr, &sync_points[0], nullptr)); + ASSERT_SUCCESS(clCommandCopyImageKHR( + command_buffer, nullptr, nullptr, src_image, dst_image, origin, origin, + region, 0, nullptr, &sync_points[0], nullptr)); ASSERT_NE(sync_points[0], std::numeric_limits::max()); - ASSERT_SUCCESS(clCommandCopyImageKHR(command_buffer, nullptr, src_image, - dst_image, origin, origin, region, 0, - nullptr, &sync_points[1], nullptr)); + ASSERT_SUCCESS(clCommandCopyImageKHR( + command_buffer, nullptr, nullptr, src_image, dst_image, origin, origin, + region, 0, nullptr, &sync_points[1], nullptr)); ASSERT_NE(sync_points[1], std::numeric_limits::max()); - ASSERT_SUCCESS(clCommandCopyImageKHR(command_buffer, nullptr, src_image, - dst_image, origin, origin, region, 2, - sync_points, nullptr, nullptr)); + ASSERT_SUCCESS(clCommandCopyImageKHR( + command_buffer, nullptr, nullptr, src_image, dst_image, origin, origin, + region, 2, sync_points, nullptr, nullptr)); } TEST_F(CommandBufferCopyImageTest, CopyFull) { const size_t origin[] = {0, 0, 0}; const size_t region[] = {dimension_length, 1, 1}; - ASSERT_SUCCESS(clCommandCopyImageKHR(command_buffer, nullptr, src_image, - dst_image, origin, origin, region, 0, - nullptr, nullptr, nullptr)); + ASSERT_SUCCESS(clCommandCopyImageKHR(command_buffer, nullptr, nullptr, + src_image, dst_image, origin, origin, + region, 0, nullptr, nullptr, nullptr)); ASSERT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); ASSERT_SUCCESS(clEnqueueCommandBufferKHR(0, nullptr, command_buffer, 0, nullptr, nullptr)); @@ -138,9 +138,9 @@ TEST_F(CommandBufferCopyImageTest, CopyStart) { const size_t origin[] = {0, 0, 0}; const size_t region[] = {half_dimension, 1, 1}; - ASSERT_SUCCESS(clCommandCopyImageKHR(command_buffer, nullptr, src_image, - dst_image, origin, origin, region, 0, - nullptr, nullptr, nullptr)); + ASSERT_SUCCESS(clCommandCopyImageKHR(command_buffer, nullptr, nullptr, + src_image, dst_image, origin, origin, + region, 0, nullptr, nullptr, nullptr)); ASSERT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); ASSERT_SUCCESS(clEnqueueCommandBufferKHR(0, nullptr, command_buffer, 0, nullptr, nullptr)); @@ -162,9 +162,9 @@ TEST_F(CommandBufferCopyImageTest, CopyEnd) { const size_t origin[] = {half_dimension, 0, 0}; const size_t region[] = {half_dimension, 1, 1}; - ASSERT_SUCCESS(clCommandCopyImageKHR(command_buffer, nullptr, src_image, - dst_image, origin, origin, region, 0, - nullptr, nullptr, nullptr)); + ASSERT_SUCCESS(clCommandCopyImageKHR(command_buffer, nullptr, nullptr, + src_image, dst_image, origin, origin, + region, 0, nullptr, nullptr, nullptr)); ASSERT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); ASSERT_SUCCESS(clEnqueueCommandBufferKHR(0, nullptr, command_buffer, 0, nullptr, nullptr)); @@ -187,30 +187,30 @@ TEST_F(CommandBufferCopyImageTest, InvalidCommandBuffer) { size_t origin[3] = {0, 0, 0}; size_t region[3] = {dimension_length, 1, 1}; - ASSERT_EQ_ERRCODE( - CL_INVALID_COMMAND_BUFFER_KHR, - clCommandCopyImageKHR(nullptr, nullptr, src_image, dst_image, origin, - origin, region, 0, nullptr, nullptr, nullptr)); + ASSERT_EQ_ERRCODE(CL_INVALID_COMMAND_BUFFER_KHR, + clCommandCopyImageKHR(nullptr, nullptr, nullptr, src_image, + dst_image, origin, origin, region, 0, + nullptr, nullptr, nullptr)); ASSERT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); ASSERT_EQ_ERRCODE(CL_INVALID_OPERATION, - clCommandCopyImageKHR(command_buffer, nullptr, src_image, - dst_image, origin, origin, region, 0, - nullptr, nullptr, nullptr)); + clCommandCopyImageKHR( + command_buffer, nullptr, nullptr, src_image, dst_image, + origin, origin, region, 0, nullptr, nullptr, nullptr)); } TEST_F(CommandBufferCopyImageTest, InvalidMemObject) { size_t origin[3] = {0, 0, 0}; size_t region[3] = {dimension_length, 1, 1}; - ASSERT_EQ_ERRCODE( - CL_INVALID_MEM_OBJECT, - clCommandCopyImageKHR(command_buffer, nullptr, nullptr, dst_image, origin, - origin, region, 0, nullptr, nullptr, nullptr)); + ASSERT_EQ_ERRCODE(CL_INVALID_MEM_OBJECT, + clCommandCopyImageKHR( + command_buffer, nullptr, nullptr, nullptr, dst_image, + origin, origin, region, 0, nullptr, nullptr, nullptr)); - ASSERT_EQ_ERRCODE( - CL_INVALID_MEM_OBJECT, - clCommandCopyImageKHR(command_buffer, nullptr, src_image, nullptr, origin, - origin, region, 0, nullptr, nullptr, nullptr)); + ASSERT_EQ_ERRCODE(CL_INVALID_MEM_OBJECT, + clCommandCopyImageKHR( + command_buffer, nullptr, nullptr, src_image, nullptr, + origin, origin, region, 0, nullptr, nullptr, nullptr)); } TEST_F(CommandBufferCopyImageTest, ImageFormatMismatch) { @@ -226,15 +226,17 @@ TEST_F(CommandBufferCopyImageTest, ImageFormatMismatch) { size_t origin[3] = {0, 0, 0}; size_t region[3] = {dimension_length, 1, 1}; - ASSERT_EQ_ERRCODE(CL_IMAGE_FORMAT_MISMATCH, - clCommandCopyImageKHR(command_buffer, nullptr, other_image, - dst_image, origin, origin, region, 0, - nullptr, nullptr, nullptr)); + ASSERT_EQ_ERRCODE( + CL_IMAGE_FORMAT_MISMATCH, + clCommandCopyImageKHR(command_buffer, nullptr, nullptr, other_image, + dst_image, origin, origin, region, 0, nullptr, + nullptr, nullptr)); - ASSERT_EQ_ERRCODE(CL_IMAGE_FORMAT_MISMATCH, - clCommandCopyImageKHR(command_buffer, nullptr, src_image, - other_image, origin, origin, region, - 0, nullptr, nullptr, nullptr)); + ASSERT_EQ_ERRCODE( + CL_IMAGE_FORMAT_MISMATCH, + clCommandCopyImageKHR(command_buffer, nullptr, nullptr, src_image, + other_image, origin, origin, region, 0, nullptr, + nullptr, nullptr)); ASSERT_SUCCESS(clReleaseMemObject(other_image)); } @@ -245,14 +247,15 @@ TEST_F(CommandBufferCopyImageTest, InvalidSrcOrigin) { ASSERT_EQ_ERRCODE( CL_INVALID_VALUE, - clCommandCopyImageKHR(command_buffer, nullptr, src_image, dst_image, - src_origin, dst_origin, region, 0, nullptr, nullptr, - nullptr)); + clCommandCopyImageKHR(command_buffer, nullptr, nullptr, src_image, + dst_image, src_origin, dst_origin, region, 0, + nullptr, nullptr, nullptr)); - ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, - clCommandCopyImageKHR( - command_buffer, nullptr, src_image, dst_image, nullptr, - dst_origin, region, 0, nullptr, nullptr, nullptr)); + ASSERT_EQ_ERRCODE( + CL_INVALID_VALUE, + clCommandCopyImageKHR(command_buffer, nullptr, nullptr, src_image, + dst_image, nullptr, dst_origin, region, 0, nullptr, + nullptr, nullptr)); } TEST_F(CommandBufferCopyImageTest, InvalidDstOrigin) { size_t src_origin[3] = {0, 0, 0}; @@ -261,15 +264,15 @@ TEST_F(CommandBufferCopyImageTest, InvalidDstOrigin) { ASSERT_EQ_ERRCODE( CL_INVALID_VALUE, - clCommandCopyImageKHR(command_buffer, nullptr, src_image, dst_image, - src_origin, dst_origin, region, 0, nullptr, nullptr, - nullptr)); + clCommandCopyImageKHR(command_buffer, nullptr, nullptr, src_image, + dst_image, src_origin, dst_origin, region, 0, + nullptr, nullptr, nullptr)); ASSERT_EQ_ERRCODE( CL_INVALID_VALUE, - clCommandCopyImageKHR(command_buffer, nullptr, src_image, dst_image, - src_origin, nullptr, region, 0, nullptr, nullptr, - nullptr)); + clCommandCopyImageKHR(command_buffer, nullptr, nullptr, src_image, + dst_image, src_origin, nullptr, region, 0, nullptr, + nullptr, nullptr)); } TEST_F(CommandBufferCopyImageTest, InvalidRegion) { @@ -277,14 +280,14 @@ TEST_F(CommandBufferCopyImageTest, InvalidRegion) { size_t region[3] = {dimension_length + 1, 1, 1}; ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, - clCommandCopyImageKHR(command_buffer, nullptr, src_image, - dst_image, origin, origin, region, 0, - nullptr, nullptr, nullptr)); + clCommandCopyImageKHR( + command_buffer, nullptr, nullptr, src_image, dst_image, + origin, origin, region, 0, nullptr, nullptr, nullptr)); ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, - clCommandCopyImageKHR(command_buffer, nullptr, src_image, - dst_image, origin, origin, nullptr, 0, - nullptr, nullptr, nullptr)); + clCommandCopyImageKHR( + command_buffer, nullptr, nullptr, src_image, dst_image, + origin, origin, nullptr, 0, nullptr, nullptr, nullptr)); } TEST_F(CommandBufferCopyImageTest, InvalidSyncPoints) { @@ -292,13 +295,14 @@ TEST_F(CommandBufferCopyImageTest, InvalidSyncPoints) { size_t region[3] = {dimension_length, 1, 1}; ASSERT_EQ_ERRCODE(CL_INVALID_SYNC_POINT_WAIT_LIST_KHR, - clCommandCopyImageKHR(command_buffer, nullptr, src_image, - dst_image, origin, origin, region, 1, - nullptr, nullptr, nullptr)); + clCommandCopyImageKHR( + command_buffer, nullptr, nullptr, src_image, dst_image, + origin, origin, region, 1, nullptr, nullptr, nullptr)); cl_sync_point_khr sync_point; - ASSERT_EQ_ERRCODE(CL_INVALID_SYNC_POINT_WAIT_LIST_KHR, - clCommandCopyImageKHR(command_buffer, nullptr, src_image, - dst_image, origin, origin, region, 0, - &sync_point, nullptr, nullptr)); + ASSERT_EQ_ERRCODE( + CL_INVALID_SYNC_POINT_WAIT_LIST_KHR, + clCommandCopyImageKHR(command_buffer, nullptr, nullptr, src_image, + dst_image, origin, origin, region, 0, &sync_point, + nullptr, nullptr)); } diff --git a/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandCopyImageToBufferKHR.cpp b/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandCopyImageToBufferKHR.cpp index 9890865a2..da2ce199e 100644 --- a/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandCopyImageToBufferKHR.cpp +++ b/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandCopyImageToBufferKHR.cpp @@ -92,9 +92,9 @@ TEST_F(CommandBufferCopyImageToBufferTest, Default) { const size_t origin[] = {0, 0, 0}; const size_t region[] = {image_width, image_height, 1}; - ASSERT_SUCCESS(clCommandCopyImageToBufferKHR(command_buffer, nullptr, image, - buffer, origin, region, 0, 0, - nullptr, nullptr, nullptr)); + ASSERT_SUCCESS(clCommandCopyImageToBufferKHR(command_buffer, nullptr, nullptr, + image, buffer, origin, region, 0, + 0, nullptr, nullptr, nullptr)); ASSERT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); ASSERT_SUCCESS(clEnqueueCommandBufferKHR(0, nullptr, command_buffer, 0, nullptr, nullptr)); @@ -116,36 +116,36 @@ TEST_F(CommandBufferCopyImageToBufferTest, Sync) { std::numeric_limits::max()}; ASSERT_SUCCESS(clCommandCopyImageToBufferKHR( - command_buffer, nullptr, image, buffer, origin, region, 0, 0, nullptr, - &sync_points[0], nullptr)); + command_buffer, nullptr, nullptr, image, buffer, origin, region, 0, 0, + nullptr, &sync_points[0], nullptr)); ASSERT_NE(sync_points[0], std::numeric_limits::max()); ASSERT_SUCCESS(clCommandCopyImageToBufferKHR( - command_buffer, nullptr, image, buffer, origin, region, 0, 0, nullptr, - &sync_points[1], nullptr)); + command_buffer, nullptr, nullptr, image, buffer, origin, region, 0, 0, + nullptr, &sync_points[1], nullptr)); ASSERT_NE(sync_points[1], std::numeric_limits::max()); - ASSERT_SUCCESS(clCommandCopyImageToBufferKHR(command_buffer, nullptr, image, - buffer, origin, region, 0, 2, - sync_points, nullptr, nullptr)); + ASSERT_SUCCESS(clCommandCopyImageToBufferKHR( + command_buffer, nullptr, nullptr, image, buffer, origin, region, 0, 2, + sync_points, nullptr, nullptr)); } TEST_F(CommandBufferCopyImageToBufferTest, InvalidCommandBuffer) { const size_t origin[] = {0, 0, 0}; const size_t region[] = {image_width, image_height, 1}; - ASSERT_EQ_ERRCODE( - CL_INVALID_COMMAND_BUFFER_KHR, - clCommandCopyImageToBufferKHR(nullptr, nullptr, image, buffer, origin, - region, 0, 0, nullptr, nullptr, nullptr)); + ASSERT_EQ_ERRCODE(CL_INVALID_COMMAND_BUFFER_KHR, + clCommandCopyImageToBufferKHR( + nullptr, nullptr, nullptr, image, buffer, origin, + region, 0, 0, nullptr, nullptr, nullptr)); ASSERT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); ASSERT_EQ_ERRCODE(CL_INVALID_OPERATION, clCommandCopyImageToBufferKHR( - command_buffer, nullptr, image, buffer, origin, region, - 0, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, image, buffer, origin, + region, 0, 0, nullptr, nullptr, nullptr)); } TEST_F(CommandBufferCopyImageToBufferTest, InvalidContext) { @@ -165,8 +165,8 @@ TEST_F(CommandBufferCopyImageToBufferTest, InvalidContext) { const size_t region[] = {image_width, image_height, 1}; EXPECT_EQ_ERRCODE(CL_INVALID_CONTEXT, clCommandCopyImageToBufferKHR( - command_buffer, nullptr, image, other_buffer, origin, - region, 0, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, image, other_buffer, + origin, region, 0, 0, nullptr, nullptr, nullptr)); EXPECT_SUCCESS(clReleaseMemObject(other_buffer)); EXPECT_SUCCESS(clReleaseContext(other_context)); @@ -177,13 +177,13 @@ TEST_F(CommandBufferCopyImageToBufferTest, InvalidMemObject) { const size_t region[] = {image_width, image_height, 1}; ASSERT_EQ_ERRCODE(CL_INVALID_MEM_OBJECT, clCommandCopyImageToBufferKHR( - command_buffer, nullptr, image, nullptr, origin, region, - 0, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, image, nullptr, + origin, region, 0, 0, nullptr, nullptr, nullptr)); ASSERT_EQ_ERRCODE(CL_INVALID_MEM_OBJECT, clCommandCopyImageToBufferKHR( - command_buffer, nullptr, nullptr, buffer, origin, - region, 0, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, nullptr, buffer, + origin, region, 0, 0, nullptr, nullptr, nullptr)); } TEST_F(CommandBufferCopyImageToBufferTest, InvalidSrcOrigin) { @@ -191,13 +191,13 @@ TEST_F(CommandBufferCopyImageToBufferTest, InvalidSrcOrigin) { const size_t region[] = {image_width, image_height, 1}; ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, clCommandCopyImageToBufferKHR( - command_buffer, nullptr, image, buffer, origin, region, - 0, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, image, buffer, origin, + region, 0, 0, nullptr, nullptr, nullptr)); ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, clCommandCopyImageToBufferKHR( - command_buffer, nullptr, image, buffer, nullptr, region, - 0, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, image, buffer, + nullptr, region, 0, 0, nullptr, nullptr, nullptr)); } TEST_F(CommandBufferCopyImageToBufferTest, InvalidSrcOriginPlusSrcRegion) { @@ -205,8 +205,8 @@ TEST_F(CommandBufferCopyImageToBufferTest, InvalidSrcOriginPlusSrcRegion) { const size_t region[] = {image_width + 1, image_height, 1}; ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, clCommandCopyImageToBufferKHR( - command_buffer, nullptr, image, buffer, origin, region, - 0, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, image, buffer, origin, + region, 0, 0, nullptr, nullptr, nullptr)); } TEST_F(CommandBufferCopyImageToBufferTest, InvalidDstOffset) { @@ -215,8 +215,8 @@ TEST_F(CommandBufferCopyImageToBufferTest, InvalidDstOffset) { const size_t offset = image_elements + 1; ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, clCommandCopyImageToBufferKHR( - command_buffer, nullptr, image, buffer, origin, region, - offset, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, image, buffer, origin, + region, offset, 0, nullptr, nullptr, nullptr)); } TEST_F(CommandBufferCopyImageToBufferTest, InvalidDstOffsetPlusDstCb) { @@ -225,16 +225,16 @@ TEST_F(CommandBufferCopyImageToBufferTest, InvalidDstOffsetPlusDstCb) { const size_t offset = 1; ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, clCommandCopyImageToBufferKHR( - command_buffer, nullptr, image, buffer, origin, region, - offset, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, image, buffer, origin, + region, offset, 0, nullptr, nullptr, nullptr)); } TEST_F(CommandBufferCopyImageToBufferTest, InvalidNullRegion) { const size_t origin[] = {0, 0, 0}; ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, clCommandCopyImageToBufferKHR( - command_buffer, nullptr, image, buffer, origin, nullptr, - 0, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, image, buffer, origin, + nullptr, 0, 0, nullptr, nullptr, nullptr)); } TEST_F(CommandBufferCopyImageToBufferTest, InvalidOriginRegionRules) { @@ -243,8 +243,8 @@ TEST_F(CommandBufferCopyImageToBufferTest, InvalidOriginRegionRules) { const size_t offset = 0; ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, clCommandCopyImageToBufferKHR( - command_buffer, nullptr, image, buffer, origin, region, - offset, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, image, buffer, origin, + region, offset, 0, nullptr, nullptr, nullptr)); } TEST_F(CommandBufferCopyImageToBufferTest, InvalidSyncPoints) { @@ -253,12 +253,12 @@ TEST_F(CommandBufferCopyImageToBufferTest, InvalidSyncPoints) { ASSERT_EQ_ERRCODE(CL_INVALID_SYNC_POINT_WAIT_LIST_KHR, clCommandCopyImageToBufferKHR( - command_buffer, nullptr, image, buffer, origin, region, - 0, 1, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, image, buffer, origin, + region, 0, 1, nullptr, nullptr, nullptr)); cl_sync_point_khr sync_point; ASSERT_EQ_ERRCODE(CL_INVALID_SYNC_POINT_WAIT_LIST_KHR, clCommandCopyImageToBufferKHR( - command_buffer, nullptr, image, buffer, origin, region, - 0, 0, &sync_point, nullptr, nullptr)); + command_buffer, nullptr, nullptr, image, buffer, origin, + region, 0, 0, &sync_point, nullptr, nullptr)); } diff --git a/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandFillBufferKHR.cpp b/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandFillBufferKHR.cpp index 8ef1ab773..6af01cb41 100644 --- a/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandFillBufferKHR.cpp +++ b/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandFillBufferKHR.cpp @@ -110,9 +110,9 @@ TEST_P(CommandFillBufferKHRParamTest, FillBufferWithRandomPattern) { nullptr, nullptr)); // Add the fill command to the buffer and finalize it. - EXPECT_SUCCESS(clCommandFillBufferKHR(command_buffer, nullptr, buffer, - pattern.data(), pattern_size, offset, - size, 0, nullptr, nullptr, nullptr)); + EXPECT_SUCCESS(clCommandFillBufferKHR( + command_buffer, nullptr, nullptr, buffer, pattern.data(), pattern_size, + offset, size, 0, nullptr, nullptr, nullptr)); EXPECT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); // Enqueue the command buffer. @@ -159,21 +159,21 @@ TEST_F(CommandFillBufferKHRTest, Sync) { std::numeric_limits::max(), std::numeric_limits::max()}; - ASSERT_SUCCESS(clCommandFillBufferKHR(command_buffer, nullptr, buffer, - &pattern, pattern_size, offset, size, 0, - nullptr, &sync_points[0], nullptr)); + ASSERT_SUCCESS(clCommandFillBufferKHR( + command_buffer, nullptr, nullptr, buffer, &pattern, pattern_size, offset, + size, 0, nullptr, &sync_points[0], nullptr)); ASSERT_NE(sync_points[0], std::numeric_limits::max()); - ASSERT_SUCCESS(clCommandFillBufferKHR(command_buffer, nullptr, buffer, - &pattern, pattern_size, offset, size, 0, - nullptr, &sync_points[1], nullptr)); + ASSERT_SUCCESS(clCommandFillBufferKHR( + command_buffer, nullptr, nullptr, buffer, &pattern, pattern_size, offset, + size, 0, nullptr, &sync_points[1], nullptr)); ASSERT_NE(sync_points[1], std::numeric_limits::max()); - ASSERT_SUCCESS(clCommandFillBufferKHR(command_buffer, nullptr, buffer, - &pattern, pattern_size, offset, size, 2, - sync_points, nullptr, nullptr)); + ASSERT_SUCCESS(clCommandFillBufferKHR( + command_buffer, nullptr, nullptr, buffer, &pattern, pattern_size, offset, + size, 2, sync_points, nullptr, nullptr)); } // Tests we can reuse the pattern memory after putting the command in the @@ -197,9 +197,9 @@ TEST_F(CommandFillBufferKHRTest, ReusePatternMemory) { fillBuffer(initial_value, pattern, pattern_size, size, offset); // Add the fill command to the buffer. - ASSERT_SUCCESS(clCommandFillBufferKHR(command_buffer, nullptr, buffer, - &pattern, pattern_size, offset, size, 0, - nullptr, nullptr, nullptr)); + ASSERT_SUCCESS(clCommandFillBufferKHR(command_buffer, nullptr, nullptr, + buffer, &pattern, pattern_size, offset, + size, 0, nullptr, nullptr, nullptr)); // Finalize the buffer. ASSERT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); @@ -250,14 +250,14 @@ TEST_F(CommandFillBufferKHRTest, FillThenCopy) { const size_t offset = 4; // Add the fill command to the buffer. - ASSERT_SUCCESS(clCommandFillBufferKHR(command_buffer, nullptr, buffer, - &pattern, pattern_size, offset, size, 0, - nullptr, nullptr, nullptr)); + ASSERT_SUCCESS(clCommandFillBufferKHR(command_buffer, nullptr, nullptr, + buffer, &pattern, pattern_size, offset, + size, 0, nullptr, nullptr, nullptr)); // Add the copy command to copy to the output buffer. - ASSERT_SUCCESS(clCommandCopyBufferKHR(command_buffer, nullptr, buffer, - other_buffer, 0, 0, buffer_size, 0, - nullptr, nullptr, nullptr)); + ASSERT_SUCCESS(clCommandCopyBufferKHR(command_buffer, nullptr, nullptr, + buffer, other_buffer, 0, 0, buffer_size, + 0, nullptr, nullptr, nullptr)); ASSERT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); // Enqueue the command buffer. @@ -300,12 +300,12 @@ TEST_F(CommandFillBufferKHRTest, MultipleFillSameBuffer) { const size_t offset_b = 128; // Add the fill commands to the buffer. - EXPECT_SUCCESS(clCommandFillBufferKHR(command_buffer, nullptr, buffer, - &pattern_a, pattern_a_size, offset_a, - size_a, 0, nullptr, nullptr, nullptr)); - ASSERT_SUCCESS(clCommandFillBufferKHR(command_buffer, nullptr, buffer, - &pattern_b, pattern_b_size, offset_b, - size_b, 0, nullptr, nullptr, nullptr)); + EXPECT_SUCCESS(clCommandFillBufferKHR( + command_buffer, nullptr, nullptr, buffer, &pattern_a, pattern_a_size, + offset_a, size_a, 0, nullptr, nullptr, nullptr)); + ASSERT_SUCCESS(clCommandFillBufferKHR( + command_buffer, nullptr, nullptr, buffer, &pattern_b, pattern_b_size, + offset_b, size_b, 0, nullptr, nullptr, nullptr)); // Finalize the buffer. ASSERT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); @@ -352,12 +352,12 @@ TEST_F(CommandFillBufferKHRTest, MultipleFillSameBufferOverlapping) { const size_t offset_b = 18; // Add the fill commands to the buffer. - ASSERT_SUCCESS(clCommandFillBufferKHR(command_buffer, nullptr, buffer, - &pattern_a, pattern_a_size, offset_a, - size_a, 0, nullptr, nullptr, nullptr)); - ASSERT_SUCCESS(clCommandFillBufferKHR(command_buffer, nullptr, buffer, - &pattern_b, pattern_b_size, offset_b, - size_b, 0, nullptr, nullptr, nullptr)); + ASSERT_SUCCESS(clCommandFillBufferKHR( + command_buffer, nullptr, nullptr, buffer, &pattern_a, pattern_a_size, + offset_a, size_a, 0, nullptr, nullptr, nullptr)); + ASSERT_SUCCESS(clCommandFillBufferKHR( + command_buffer, nullptr, nullptr, buffer, &pattern_b, pattern_b_size, + offset_b, size_b, 0, nullptr, nullptr, nullptr)); // Finalize the buffer. ASSERT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); @@ -409,12 +409,12 @@ TEST_F(CommandFillBufferKHRTest, MultipleFillDifferentBuffers) { const size_t offset_b = 18; // Add the fill commands to the buffers. - ASSERT_SUCCESS(clCommandFillBufferKHR(command_buffer, nullptr, buffer, - &pattern_a, pattern_a_size, offset_a, - size_a, 0, nullptr, nullptr, nullptr)); - ASSERT_SUCCESS(clCommandFillBufferKHR(command_buffer, nullptr, other_buffer, - &pattern_b, pattern_b_size, offset_b, - size_b, 0, nullptr, nullptr, nullptr)); + ASSERT_SUCCESS(clCommandFillBufferKHR( + command_buffer, nullptr, nullptr, buffer, &pattern_a, pattern_a_size, + offset_a, size_a, 0, nullptr, nullptr, nullptr)); + ASSERT_SUCCESS(clCommandFillBufferKHR( + command_buffer, nullptr, nullptr, other_buffer, &pattern_b, + pattern_b_size, offset_b, size_b, 0, nullptr, nullptr, nullptr)); // Finalize the buffer. ASSERT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); @@ -449,16 +449,17 @@ TEST_F(CommandFillBufferKHRTest, InvalidCommandBuffer) { const size_t size = 16; const size_t offset = 0; - ASSERT_EQ_ERRCODE( - CL_INVALID_COMMAND_BUFFER_KHR, - clCommandFillBufferKHR(nullptr, nullptr, buffer, &pattern, pattern_size, - offset, size, 0, nullptr, nullptr, nullptr)); - - ASSERT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); - ASSERT_EQ_ERRCODE(CL_INVALID_OPERATION, - clCommandFillBufferKHR(command_buffer, nullptr, buffer, + ASSERT_EQ_ERRCODE(CL_INVALID_COMMAND_BUFFER_KHR, + clCommandFillBufferKHR(nullptr, nullptr, nullptr, buffer, &pattern, pattern_size, offset, size, 0, nullptr, nullptr, nullptr)); + + ASSERT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); + ASSERT_EQ_ERRCODE( + CL_INVALID_OPERATION, + clCommandFillBufferKHR(command_buffer, nullptr, nullptr, buffer, &pattern, + pattern_size, offset, size, 0, nullptr, nullptr, + nullptr)); } TEST_F(CommandFillBufferKHRTest, InvalidMemObject) { @@ -467,10 +468,11 @@ TEST_F(CommandFillBufferKHRTest, InvalidMemObject) { const size_t size = 16; const size_t offset = 0; - ASSERT_EQ_ERRCODE(CL_INVALID_MEM_OBJECT, - clCommandFillBufferKHR(command_buffer, nullptr, nullptr, - &pattern, pattern_size, offset, size, - 0, nullptr, nullptr, nullptr)); + ASSERT_EQ_ERRCODE( + CL_INVALID_MEM_OBJECT, + clCommandFillBufferKHR(command_buffer, nullptr, nullptr, nullptr, + &pattern, pattern_size, offset, size, 0, nullptr, + nullptr, nullptr)); } TEST_F(CommandFillBufferKHRTest, InvalidContext) { @@ -492,9 +494,9 @@ TEST_F(CommandFillBufferKHRTest, InvalidContext) { EXPECT_EQ_ERRCODE( CL_INVALID_CONTEXT, - clCommandFillBufferKHR(command_buffer, nullptr, other_buffer, &pattern, - pattern_size, offset, size, 0, nullptr, nullptr, - nullptr)); + clCommandFillBufferKHR(command_buffer, nullptr, nullptr, other_buffer, + &pattern, pattern_size, offset, size, 0, nullptr, + nullptr, nullptr)); EXPECT_SUCCESS(clReleaseMemObject(other_buffer)); EXPECT_SUCCESS(clReleaseContext(other_context)); @@ -505,15 +507,16 @@ TEST_F(CommandFillBufferKHRTest, InvalidOffset) { const size_t pattern_size = sizeof(pattern); const size_t size = 16; - EXPECT_EQ_ERRCODE(CL_INVALID_VALUE, - clCommandFillBufferKHR(command_buffer, nullptr, buffer, - &pattern, pattern_size, size + 1, - size, 0, nullptr, nullptr, nullptr)); + EXPECT_EQ_ERRCODE( + CL_INVALID_VALUE, + clCommandFillBufferKHR(command_buffer, nullptr, nullptr, buffer, &pattern, + pattern_size, size + 1, size, 0, nullptr, nullptr, + nullptr)); const size_t half_size = size / 2; EXPECT_EQ_ERRCODE( CL_INVALID_VALUE, - clCommandFillBufferKHR(command_buffer, nullptr, buffer, &pattern, + clCommandFillBufferKHR(command_buffer, nullptr, nullptr, buffer, &pattern, pattern_size, half_size + 1, half_size, 0, nullptr, nullptr, nullptr)); } @@ -524,23 +527,23 @@ TEST_F(CommandFillBufferKHRTest, InvalidPattern) { const size_t size = 16; EXPECT_EQ_ERRCODE(CL_INVALID_VALUE, - clCommandFillBufferKHR(command_buffer, nullptr, buffer, - nullptr, pattern_size, size, size, 0, - nullptr, nullptr, nullptr)); + clCommandFillBufferKHR(command_buffer, nullptr, nullptr, + buffer, nullptr, pattern_size, size, + size, 0, nullptr, nullptr, nullptr)); EXPECT_EQ_ERRCODE( CL_INVALID_VALUE, - clCommandFillBufferKHR(command_buffer, nullptr, buffer, &pattern, 0, 0, - size, 0, nullptr, nullptr, nullptr)); + clCommandFillBufferKHR(command_buffer, nullptr, nullptr, buffer, &pattern, + 0, 0, size, 0, nullptr, nullptr, nullptr)); EXPECT_EQ_ERRCODE( CL_INVALID_VALUE, - clCommandFillBufferKHR(command_buffer, nullptr, buffer, &pattern, 3, 0, - size, 0, nullptr, nullptr, nullptr)); + clCommandFillBufferKHR(command_buffer, nullptr, nullptr, buffer, &pattern, + 3, 0, size, 0, nullptr, nullptr, nullptr)); EXPECT_EQ_ERRCODE(CL_INVALID_VALUE, - clCommandFillBufferKHR(command_buffer, nullptr, buffer, - &pattern, pattern_size, 6, size, 0, - nullptr, nullptr, nullptr)); + clCommandFillBufferKHR(command_buffer, nullptr, nullptr, + buffer, &pattern, pattern_size, 6, + size, 0, nullptr, nullptr, nullptr)); } TEST_F(CommandFillBufferKHRTest, InvalidSyncPoints) { @@ -549,13 +552,14 @@ TEST_F(CommandFillBufferKHRTest, InvalidSyncPoints) { const size_t size = 16; ASSERT_EQ_ERRCODE(CL_INVALID_SYNC_POINT_WAIT_LIST_KHR, - clCommandFillBufferKHR(command_buffer, nullptr, buffer, - &pattern, pattern_size, 0, size, 1, - nullptr, nullptr, nullptr)); + clCommandFillBufferKHR(command_buffer, nullptr, nullptr, + buffer, &pattern, pattern_size, 0, + size, 1, nullptr, nullptr, nullptr)); cl_sync_point_khr sync_point; - ASSERT_EQ_ERRCODE(CL_INVALID_SYNC_POINT_WAIT_LIST_KHR, - clCommandFillBufferKHR(command_buffer, nullptr, buffer, - &pattern, pattern_size, 0, size, 0, - &sync_point, nullptr, nullptr)); + ASSERT_EQ_ERRCODE( + CL_INVALID_SYNC_POINT_WAIT_LIST_KHR, + clCommandFillBufferKHR(command_buffer, nullptr, nullptr, buffer, &pattern, + pattern_size, 0, size, 0, &sync_point, nullptr, + nullptr)); } diff --git a/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandFillImageKHR.cpp b/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandFillImageKHR.cpp index 52d5be110..6cfdcc440 100644 --- a/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandFillImageKHR.cpp +++ b/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandFillImageKHR.cpp @@ -96,19 +96,19 @@ TEST_F(CommandBufferFillImageTest, Sync) { std::numeric_limits::max(), std::numeric_limits::max()}; - ASSERT_SUCCESS(clCommandFillImageKHR(command_buffer, nullptr, image, + ASSERT_SUCCESS(clCommandFillImageKHR(command_buffer, nullptr, nullptr, image, &fill_color, origin, region, 0, nullptr, &sync_points[0], nullptr)); ASSERT_NE(sync_points[0], std::numeric_limits::max()); - ASSERT_SUCCESS(clCommandFillImageKHR(command_buffer, nullptr, image, + ASSERT_SUCCESS(clCommandFillImageKHR(command_buffer, nullptr, nullptr, image, &fill_color, origin, region, 0, nullptr, &sync_points[1], nullptr)); ASSERT_NE(sync_points[1], std::numeric_limits::max()); - ASSERT_SUCCESS(clCommandFillImageKHR(command_buffer, nullptr, image, + ASSERT_SUCCESS(clCommandFillImageKHR(command_buffer, nullptr, nullptr, image, &fill_color, origin, region, 2, sync_points, nullptr, nullptr)); } @@ -117,7 +117,7 @@ TEST_F(CommandBufferFillImageTest, FillFull) { const size_t origin[] = {0, 0, 0}; const size_t region[] = {dimension_length, 1, 1}; - ASSERT_SUCCESS(clCommandFillImageKHR(command_buffer, nullptr, image, + ASSERT_SUCCESS(clCommandFillImageKHR(command_buffer, nullptr, nullptr, image, &fill_color, origin, region, 0, nullptr, nullptr, nullptr)); @@ -148,7 +148,7 @@ TEST_F(CommandBufferFillImageTest, FillStart) { const size_t origin[] = {0, 0, 0}; const size_t region[] = {half_dimension, 1, 1}; - ASSERT_SUCCESS(clCommandFillImageKHR(command_buffer, nullptr, image, + ASSERT_SUCCESS(clCommandFillImageKHR(command_buffer, nullptr, nullptr, image, &fill_color, origin, region, 0, nullptr, nullptr, nullptr)); @@ -184,7 +184,7 @@ TEST_F(CommandBufferFillImageTest, FillEnd) { const size_t origin[] = {half_dimension, 0, 0}; const size_t region[] = {half_dimension, 1, 1}; - ASSERT_SUCCESS(clCommandFillImageKHR(command_buffer, nullptr, image, + ASSERT_SUCCESS(clCommandFillImageKHR(command_buffer, nullptr, nullptr, image, &fill_color, origin, region, 0, nullptr, nullptr, nullptr)); @@ -222,23 +222,23 @@ TEST_F(CommandBufferFillImageTest, InvalidCommandBuffer) { ASSERT_EQ_ERRCODE( CL_INVALID_COMMAND_BUFFER_KHR, - clCommandFillImageKHR(nullptr, nullptr, image, &fill_color, origin, - region, 0, nullptr, nullptr, nullptr)); + clCommandFillImageKHR(nullptr, nullptr, nullptr, image, &fill_color, + origin, region, 0, nullptr, nullptr, nullptr)); ASSERT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); - ASSERT_EQ_ERRCODE( - CL_INVALID_OPERATION, - clCommandFillImageKHR(command_buffer, nullptr, image, &fill_color, origin, - region, 0, nullptr, nullptr, nullptr)); + ASSERT_EQ_ERRCODE(CL_INVALID_OPERATION, + clCommandFillImageKHR(command_buffer, nullptr, nullptr, + image, &fill_color, origin, region, 0, + nullptr, nullptr, nullptr)); } TEST_F(CommandBufferFillImageTest, InvalidMemObject) { size_t origin[3] = {0, 0, 0}; size_t region[3] = {dimension_length, 1, 1}; - ASSERT_EQ_ERRCODE( - CL_INVALID_MEM_OBJECT, - clCommandFillImageKHR(command_buffer, nullptr, nullptr, &fill_color, - origin, region, 0, nullptr, nullptr, nullptr)); + ASSERT_EQ_ERRCODE(CL_INVALID_MEM_OBJECT, + clCommandFillImageKHR(command_buffer, nullptr, nullptr, + nullptr, &fill_color, origin, region, + 0, nullptr, nullptr, nullptr)); } TEST_F(CommandBufferFillImageTest, InvalidContext) { @@ -257,8 +257,9 @@ TEST_F(CommandBufferFillImageTest, InvalidContext) { size_t region[3] = {dimension_length, 1, 1}; EXPECT_EQ_ERRCODE( CL_INVALID_CONTEXT, - clCommandFillImageKHR(command_buffer, nullptr, other_image, &fill_color, - origin, region, 0, nullptr, nullptr, nullptr)); + clCommandFillImageKHR(command_buffer, nullptr, nullptr, other_image, + &fill_color, origin, region, 0, nullptr, nullptr, + nullptr)); EXPECT_SUCCESS(clReleaseMemObject(other_image)); EXPECT_SUCCESS(clReleaseContext(other_context)); @@ -269,49 +270,49 @@ TEST_F(CommandBufferFillImageTest, NullConfig) { ASSERT_EQ_ERRCODE( CL_INVALID_VALUE, - clCommandFillImageKHR(command_buffer, nullptr, image, nullptr, origin, - region, 0, nullptr, nullptr, nullptr)); + clCommandFillImageKHR(command_buffer, nullptr, nullptr, image, nullptr, + origin, region, 0, nullptr, nullptr, nullptr)); - ASSERT_EQ_ERRCODE( - CL_INVALID_VALUE, - clCommandFillImageKHR(command_buffer, nullptr, image, &fill_color, - nullptr, region, 0, nullptr, nullptr, nullptr)); + ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, + clCommandFillImageKHR(command_buffer, nullptr, nullptr, + image, &fill_color, nullptr, region, + 0, nullptr, nullptr, nullptr)); - ASSERT_EQ_ERRCODE( - CL_INVALID_VALUE, - clCommandFillImageKHR(command_buffer, nullptr, image, &fill_color, origin, - nullptr, 0, nullptr, nullptr, nullptr)); + ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, + clCommandFillImageKHR(command_buffer, nullptr, nullptr, + image, &fill_color, origin, nullptr, + 0, nullptr, nullptr, nullptr)); } TEST_F(CommandBufferFillImageTest, OutOfBounds) { size_t origin[3] = {0, 0, 0}; size_t region[3] = {dimension_length + 1, 1, 1}; - ASSERT_EQ_ERRCODE( - CL_INVALID_VALUE, - clCommandFillImageKHR(command_buffer, nullptr, image, &fill_color, origin, - region, 0, nullptr, nullptr, nullptr)); + ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, + clCommandFillImageKHR(command_buffer, nullptr, nullptr, + image, &fill_color, origin, region, 0, + nullptr, nullptr, nullptr)); region[0]--; origin[0] = 2; - ASSERT_EQ_ERRCODE( - CL_INVALID_VALUE, - clCommandFillImageKHR(command_buffer, nullptr, image, &fill_color, origin, - region, 0, nullptr, nullptr, nullptr)); + ASSERT_EQ_ERRCODE(CL_INVALID_VALUE, + clCommandFillImageKHR(command_buffer, nullptr, nullptr, + image, &fill_color, origin, region, 0, + nullptr, nullptr, nullptr)); } TEST_F(CommandBufferFillImageTest, InvalidSyncPoints) { size_t origin[3] = {0, 0, 0}; size_t region[3] = {dimension_length, 1, 1}; - ASSERT_EQ_ERRCODE( - CL_INVALID_SYNC_POINT_WAIT_LIST_KHR, - clCommandFillImageKHR(command_buffer, nullptr, image, &fill_color, origin, - region, 1, nullptr, nullptr, nullptr)); + ASSERT_EQ_ERRCODE(CL_INVALID_SYNC_POINT_WAIT_LIST_KHR, + clCommandFillImageKHR(command_buffer, nullptr, nullptr, + image, &fill_color, origin, region, 1, + nullptr, nullptr, nullptr)); cl_sync_point_khr sync_point; - ASSERT_EQ_ERRCODE( - CL_INVALID_SYNC_POINT_WAIT_LIST_KHR, - clCommandFillImageKHR(command_buffer, nullptr, image, &fill_color, origin, - region, 0, &sync_point, nullptr, nullptr)); + ASSERT_EQ_ERRCODE(CL_INVALID_SYNC_POINT_WAIT_LIST_KHR, + clCommandFillImageKHR(command_buffer, nullptr, nullptr, + image, &fill_color, origin, region, 0, + &sync_point, nullptr, nullptr)); } diff --git a/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandNDRangeKernelKHR.cpp b/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandNDRangeKernelKHR.cpp index 588b8be9d..a9e374d5b 100644 --- a/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandNDRangeKernelKHR.cpp +++ b/source/cl/test/UnitCL/source/cl_khr_command_buffer/clCommandNDRangeKernelKHR.cpp @@ -295,13 +295,12 @@ TEST_F(ParallelCopyCommandBuffer, InvalidProperties) { GTEST_SKIP(); } - cl_ndrange_kernel_command_properties_khr valid_properties[1] = {0}; + cl_command_properties_khr valid_properties[1] = {0}; ASSERT_SUCCESS(clCommandNDRangeKernelKHR( command_buffer, nullptr, valid_properties, kernel, 1, nullptr, &global_size, nullptr, 0, nullptr, nullptr, nullptr)); - cl_ndrange_kernel_command_properties_khr invalid_properties[3] = {0xDEAD, - 0xBEEF, 0}; + cl_command_properties_khr invalid_properties[3] = {0xDEAD, 0xBEEF, 0}; ASSERT_EQ_ERRCODE( CL_INVALID_VALUE, clCommandNDRangeKernelKHR(command_buffer, nullptr, invalid_properties, diff --git a/source/cl/test/UnitCL/source/cl_khr_command_buffer/clEnqueueCommandBufferKHR.cpp b/source/cl/test/UnitCL/source/cl_khr_command_buffer/clEnqueueCommandBufferKHR.cpp index 3013dcde0..f64f5f6c9 100644 --- a/source/cl/test/UnitCL/source/cl_khr_command_buffer/clEnqueueCommandBufferKHR.cpp +++ b/source/cl/test/UnitCL/source/cl_khr_command_buffer/clEnqueueCommandBufferKHR.cpp @@ -343,9 +343,9 @@ TEST_F(CommandBufferEnqueueTest, MixedCommands) { ASSERT_SUCCESS(clCommandNDRangeKernelKHR( command_buffer, nullptr, nullptr, kernel, 1, nullptr, &global_size, nullptr, 0, nullptr, nullptr, nullptr)); - ASSERT_SUCCESS(clCommandCopyBufferKHR(command_buffer, nullptr, src_buffer, - dst_buffer, 0, 0, data_size_in_bytes, - 0, nullptr, nullptr, nullptr)); + ASSERT_SUCCESS(clCommandCopyBufferKHR( + command_buffer, nullptr, nullptr, src_buffer, dst_buffer, 0, 0, + data_size_in_bytes, 0, nullptr, nullptr, nullptr)); } ASSERT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); for (unsigned i = 0; i < 4; ++i) { @@ -599,8 +599,8 @@ TEST_F(CommandBufferEnqueueTest, CommandBufferAfterReversedUserEvents) { cl_command_buffer_khr command_buffer = clCreateCommandBufferKHR(1, &command_queue, nullptr, &error); ASSERT_SUCCESS(clCommandCopyBufferKHR( - command_buffer, nullptr, intermediate_buffer_b, final_buffer, 0, 0, - sizeof(cl_int), 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, intermediate_buffer_b, final_buffer, 0, + 0, sizeof(cl_int), 0, nullptr, nullptr, nullptr)); ASSERT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); // Now we enqueue the copies but have them wait on user events. diff --git a/source/cl/test/UnitCL/source/cl_khr_command_buffer/clEnqueueCommandBufferKHRWithEvents.cpp b/source/cl/test/UnitCL/source/cl_khr_command_buffer/clEnqueueCommandBufferKHRWithEvents.cpp index 6f0b47d51..c9cb9ddcd 100644 --- a/source/cl/test/UnitCL/source/cl_khr_command_buffer/clEnqueueCommandBufferKHRWithEvents.cpp +++ b/source/cl/test/UnitCL/source/cl_khr_command_buffer/clEnqueueCommandBufferKHRWithEvents.cpp @@ -43,9 +43,9 @@ TEST_F(cl_khr_command_buffer_Test, SameQueueSingleEventTest) { cl_command_buffer_khr command_buffer = clCreateCommandBufferKHR(1, &command_queue, nullptr, &error); EXPECT_SUCCESS(error); - EXPECT_SUCCESS(clCommandCopyBufferKHR(command_buffer, nullptr, input_buffer, - output_buffer, 0, 0, sizeof(cl_int), 0, - nullptr, nullptr, nullptr)); + EXPECT_SUCCESS(clCommandCopyBufferKHR( + command_buffer, nullptr, nullptr, input_buffer, output_buffer, 0, 0, + sizeof(cl_int), 0, nullptr, nullptr, nullptr)); EXPECT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); // Enqueue a non-blocking write and have the command buffer enqueue wait on @@ -100,9 +100,9 @@ TEST_F(cl_khr_command_buffer_Test, SameQueueMultipleEventTest) { cl_command_buffer_khr command_buffer = clCreateCommandBufferKHR(1, &command_queue, nullptr, &error); EXPECT_SUCCESS(error); - EXPECT_SUCCESS(clCommandCopyBufferKHR(command_buffer, nullptr, input_buffer, - output_buffer, 0, 0, 2 * sizeof(cl_int), - 0, nullptr, nullptr, nullptr)); + EXPECT_SUCCESS(clCommandCopyBufferKHR( + command_buffer, nullptr, nullptr, input_buffer, output_buffer, 0, 0, + 2 * sizeof(cl_int), 0, nullptr, nullptr, nullptr)); EXPECT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); // Enqueue two non-blocking writes and have the command buffer enqueue wait on @@ -168,9 +168,9 @@ TEST_F(cl_khr_command_buffer_Test, SameQueueSingleCommandBufferEventTest) { cl_command_buffer_khr command_buffer = clCreateCommandBufferKHR(1, &command_queue, nullptr, &error); EXPECT_SUCCESS(error); - EXPECT_SUCCESS(clCommandCopyBufferKHR(command_buffer, nullptr, input_buffer, - output_buffer, 0, 0, sizeof(cl_int), 0, - nullptr, nullptr, nullptr)); + EXPECT_SUCCESS(clCommandCopyBufferKHR( + command_buffer, nullptr, nullptr, input_buffer, output_buffer, 0, 0, + sizeof(cl_int), 0, nullptr, nullptr, nullptr)); EXPECT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); // Enqueue the command buffer which contains the copy and get its signal @@ -226,7 +226,7 @@ TEST_F(cl_khr_command_buffer_Test, SameQueueMultipleCommandBufferEventTest) { clCreateCommandBufferKHR(1, &command_queue, nullptr, &error); EXPECT_SUCCESS(error); EXPECT_SUCCESS(clCommandCopyBufferKHR( - first_command_buffer, nullptr, input_buffer, output_buffer, 0, 0, + first_command_buffer, nullptr, nullptr, input_buffer, output_buffer, 0, 0, sizeof(cl_int), 0, nullptr, nullptr, nullptr)); EXPECT_SUCCESS(clFinalizeCommandBufferKHR(first_command_buffer)); @@ -235,10 +235,10 @@ TEST_F(cl_khr_command_buffer_Test, SameQueueMultipleCommandBufferEventTest) { cl_command_buffer_khr second_command_buffer = clCreateCommandBufferKHR(1, &command_queue, nullptr, &error); EXPECT_SUCCESS(error); - EXPECT_SUCCESS( - clCommandCopyBufferKHR(second_command_buffer, nullptr, input_buffer, - output_buffer, sizeof(cl_int), sizeof(cl_int), - sizeof(cl_int), 0, nullptr, nullptr, nullptr)); + EXPECT_SUCCESS(clCommandCopyBufferKHR( + second_command_buffer, nullptr, nullptr, input_buffer, output_buffer, + sizeof(cl_int), sizeof(cl_int), sizeof(cl_int), 0, nullptr, nullptr, + nullptr)); EXPECT_SUCCESS(clFinalizeCommandBufferKHR(second_command_buffer)); // Enqueue the command buffer which contains the copy and get its signal @@ -308,8 +308,8 @@ TEST_F(cl_khr_command_buffer_Test, SameQueueInterCommandBufferEventTest) { clCreateCommandBufferKHR(1, &command_queue, nullptr, &error); EXPECT_SUCCESS(error); EXPECT_SUCCESS(clCommandCopyBufferKHR( - first_command_buffer, nullptr, input_buffer, intermediate_buffer, 0, 0, - sizeof(cl_int), 0, nullptr, nullptr, nullptr)); + first_command_buffer, nullptr, nullptr, input_buffer, intermediate_buffer, + 0, 0, sizeof(cl_int), 0, nullptr, nullptr, nullptr)); EXPECT_SUCCESS(clFinalizeCommandBufferKHR(first_command_buffer)); // Create a command buffer and have it copy between the second two data @@ -318,8 +318,8 @@ TEST_F(cl_khr_command_buffer_Test, SameQueueInterCommandBufferEventTest) { clCreateCommandBufferKHR(1, &command_queue, nullptr, &error); EXPECT_SUCCESS(error); EXPECT_SUCCESS(clCommandCopyBufferKHR( - second_command_buffer, nullptr, intermediate_buffer, output_buffer, 0, 0, - sizeof(cl_int), 0, nullptr, nullptr, nullptr)); + second_command_buffer, nullptr, nullptr, intermediate_buffer, + output_buffer, 0, 0, sizeof(cl_int), 0, nullptr, nullptr, nullptr)); EXPECT_SUCCESS(clFinalizeCommandBufferKHR(second_command_buffer)); // Enqueue the first command buffer and get its signal event. @@ -383,8 +383,8 @@ TEST_F(cl_khr_command_buffer_Test, clCreateCommandBufferKHR(1, &command_queue, nullptr, &error); EXPECT_SUCCESS(error); EXPECT_SUCCESS(clCommandCopyBufferKHR( - first_command_buffer, nullptr, input_buffer, intermediate_buffer, 0, 0, - sizeof(cl_int), 0, nullptr, nullptr, nullptr)); + first_command_buffer, nullptr, nullptr, input_buffer, intermediate_buffer, + 0, 0, sizeof(cl_int), 0, nullptr, nullptr, nullptr)); EXPECT_SUCCESS(clFinalizeCommandBufferKHR(first_command_buffer)); // Create a command buffer and have it copy the second cl_int between the @@ -393,9 +393,9 @@ TEST_F(cl_khr_command_buffer_Test, clCreateCommandBufferKHR(1, &command_queue, nullptr, &error); EXPECT_SUCCESS(error); EXPECT_SUCCESS(clCommandCopyBufferKHR( - second_command_buffer, nullptr, input_buffer, intermediate_buffer, - sizeof(cl_int), sizeof(cl_int), sizeof(cl_int), 0, nullptr, nullptr, - nullptr)); + second_command_buffer, nullptr, nullptr, input_buffer, + intermediate_buffer, sizeof(cl_int), sizeof(cl_int), sizeof(cl_int), 0, + nullptr, nullptr, nullptr)); EXPECT_SUCCESS(clFinalizeCommandBufferKHR(second_command_buffer)); // Create a command buffer and have it copy both cl_ints between the last two @@ -404,8 +404,8 @@ TEST_F(cl_khr_command_buffer_Test, clCreateCommandBufferKHR(1, &command_queue, nullptr, &error); EXPECT_SUCCESS(error); EXPECT_SUCCESS(clCommandCopyBufferKHR( - third_command_buffer, nullptr, intermediate_buffer, output_buffer, 0, 0, - 2 * sizeof(cl_int), 0, nullptr, nullptr, nullptr)); + third_command_buffer, nullptr, nullptr, intermediate_buffer, + output_buffer, 0, 0, 2 * sizeof(cl_int), 0, nullptr, nullptr, nullptr)); EXPECT_SUCCESS(clFinalizeCommandBufferKHR(third_command_buffer)); // Enqueue the first two command buffers and get their @@ -471,9 +471,9 @@ TEST_F(cl_khr_command_buffer_Test, SingleUserEventTest) { cl_command_buffer_khr command_buffer = clCreateCommandBufferKHR(1, &command_queue, nullptr, &error); EXPECT_SUCCESS(error); - EXPECT_SUCCESS(clCommandCopyBufferKHR(command_buffer, nullptr, input_buffer, - output_buffer, 0, 0, sizeof(cl_int), 0, - nullptr, nullptr, nullptr)); + EXPECT_SUCCESS(clCommandCopyBufferKHR( + command_buffer, nullptr, nullptr, input_buffer, output_buffer, 0, 0, + sizeof(cl_int), 0, nullptr, nullptr, nullptr)); EXPECT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); // Enqueue the command buffer and have it wait on a user event that we then @@ -524,9 +524,9 @@ TEST_F(cl_khr_command_buffer_Test, MultipleUserEventTest) { cl_command_buffer_khr command_buffer = clCreateCommandBufferKHR(1, &command_queue, nullptr, &error); EXPECT_SUCCESS(error); - EXPECT_SUCCESS(clCommandCopyBufferKHR(command_buffer, nullptr, input_buffer, - output_buffer, 0, 0, sizeof(cl_int), 0, - nullptr, nullptr, nullptr)); + EXPECT_SUCCESS(clCommandCopyBufferKHR( + command_buffer, nullptr, nullptr, input_buffer, output_buffer, 0, 0, + sizeof(cl_int), 0, nullptr, nullptr, nullptr)); EXPECT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); // Enqueue the command buffer and have it wait on a user event that we then @@ -595,16 +595,16 @@ TEST_F(cl_khr_command_buffer_Test, BlockQueueOnUserEventWithCommandEvent) { clCreateCommandBufferKHR(1, &command_queue, nullptr, &error); EXPECT_SUCCESS(error); EXPECT_SUCCESS(clCommandCopyBufferKHR( - first_command_buffer, nullptr, input_buffer, intermediate_buffer, 0, 0, - sizeof(cl_int), 0, nullptr, nullptr, nullptr)); + first_command_buffer, nullptr, nullptr, input_buffer, intermediate_buffer, + 0, 0, sizeof(cl_int), 0, nullptr, nullptr, nullptr)); EXPECT_SUCCESS(clFinalizeCommandBufferKHR(first_command_buffer)); cl_command_buffer_khr second_command_buffer = clCreateCommandBufferKHR(1, &command_queue, nullptr, &error); EXPECT_SUCCESS(error); EXPECT_SUCCESS(clCommandCopyBufferKHR( - second_command_buffer, nullptr, intermediate_buffer, output_buffer, 0, 0, - sizeof(cl_int), 0, nullptr, nullptr, nullptr)); + second_command_buffer, nullptr, nullptr, intermediate_buffer, + output_buffer, 0, 0, sizeof(cl_int), 0, nullptr, nullptr, nullptr)); EXPECT_SUCCESS(clFinalizeCommandBufferKHR(second_command_buffer)); // Create a user event which the second copy will wait on. @@ -671,9 +671,9 @@ TEST_F(cl_khr_command_buffer_Test, BlockQueueOnUserEvent) { cl_command_buffer_khr command_buffer = clCreateCommandBufferKHR(1, &command_queue, nullptr, &error); EXPECT_SUCCESS(error); - EXPECT_SUCCESS(clCommandCopyBufferKHR(command_buffer, nullptr, input_buffer, - output_buffer, 0, 0, sizeof(cl_int), 0, - nullptr, nullptr, nullptr)); + EXPECT_SUCCESS(clCommandCopyBufferKHR( + command_buffer, nullptr, nullptr, input_buffer, output_buffer, 0, 0, + sizeof(cl_int), 0, nullptr, nullptr, nullptr)); EXPECT_SUCCESS(clFinalizeCommandBufferKHR(command_buffer)); // Create a user event which the second copy will wait on. @@ -742,16 +742,16 @@ TEST_F(cl_khr_command_buffer_Test, BlockQueueOnTwoUserEvents) { clCreateCommandBufferKHR(1, &command_queue, nullptr, &error); EXPECT_SUCCESS(error); EXPECT_SUCCESS(clCommandCopyBufferKHR( - first_command_buffer, nullptr, input_buffer, intermediate_buffer, 0, 0, - sizeof(cl_int), 0, nullptr, nullptr, nullptr)); + first_command_buffer, nullptr, nullptr, input_buffer, intermediate_buffer, + 0, 0, sizeof(cl_int), 0, nullptr, nullptr, nullptr)); EXPECT_SUCCESS(clFinalizeCommandBufferKHR(first_command_buffer)); cl_command_buffer_khr second_command_buffer = clCreateCommandBufferKHR(1, &command_queue, nullptr, &error); EXPECT_SUCCESS(error); EXPECT_SUCCESS(clCommandCopyBufferKHR( - second_command_buffer, nullptr, intermediate_buffer, output_buffer, 0, 0, - sizeof(cl_int), 0, nullptr, nullptr, nullptr)); + second_command_buffer, nullptr, nullptr, intermediate_buffer, + output_buffer, 0, 0, sizeof(cl_int), 0, nullptr, nullptr, nullptr)); EXPECT_SUCCESS(clFinalizeCommandBufferKHR(second_command_buffer)); // Create users events which the copies will wait on. @@ -823,16 +823,16 @@ TEST_F(cl_khr_command_buffer_Test, BlockQueueOnTwoUserEventsReversed) { clCreateCommandBufferKHR(1, &command_queue, nullptr, &error); EXPECT_SUCCESS(error); EXPECT_SUCCESS(clCommandCopyBufferKHR( - first_command_buffer, nullptr, input_buffer, intermediate_buffer, 0, 0, - sizeof(cl_int), 0, nullptr, nullptr, nullptr)); + first_command_buffer, nullptr, nullptr, input_buffer, intermediate_buffer, + 0, 0, sizeof(cl_int), 0, nullptr, nullptr, nullptr)); EXPECT_SUCCESS(clFinalizeCommandBufferKHR(first_command_buffer)); cl_command_buffer_khr second_command_buffer = clCreateCommandBufferKHR(1, &command_queue, nullptr, &error); EXPECT_SUCCESS(error); EXPECT_SUCCESS(clCommandCopyBufferKHR( - second_command_buffer, nullptr, intermediate_buffer, output_buffer, 0, 0, - sizeof(cl_int), 0, nullptr, nullptr, nullptr)); + second_command_buffer, nullptr, nullptr, intermediate_buffer, + output_buffer, 0, 0, sizeof(cl_int), 0, nullptr, nullptr, nullptr)); EXPECT_SUCCESS(clFinalizeCommandBufferKHR(second_command_buffer)); // Create users events which the copies will wait on. diff --git a/source/cl/test/UnitCL/source/cl_khr_command_buffer/thread_safety.cpp b/source/cl/test/UnitCL/source/cl_khr_command_buffer/thread_safety.cpp index 4534799eb..82ea5be55 100644 --- a/source/cl/test/UnitCL/source/cl_khr_command_buffer/thread_safety.cpp +++ b/source/cl/test/UnitCL/source/cl_khr_command_buffer/thread_safety.cpp @@ -73,8 +73,8 @@ TEST_F(CommandBufferThreadSafetyTest, FillInParallel) { auto enqueue_fill_command = [&](cl_int &error, size_t id) { const cl_char pattern = id; error = clCommandFillBufferKHR( - command_buffer, nullptr, buffers_to_fill[id], &pattern, sizeof(pattern), - 0, buffer_size_in_bytes, 0, nullptr, nullptr, nullptr); + command_buffer, nullptr, nullptr, buffers_to_fill[id], &pattern, + sizeof(pattern), 0, buffer_size_in_bytes, 0, nullptr, nullptr, nullptr); }; std::vector threads; @@ -166,9 +166,9 @@ TEST_F(CommandBufferThreadSafetyTest, CopyInParallel) { // command buffer. auto command_queue = this->command_queue; auto enqueue_copy_command = [&](cl_int &error, size_t id) { - error = clCommandCopyBufferKHR(command_buffer, nullptr, src_buffers[id], - dst_buffers[id], 0, 0, buffer_size_in_bytes, - 0, nullptr, nullptr, nullptr); + error = clCommandCopyBufferKHR( + command_buffer, nullptr, nullptr, src_buffers[id], dst_buffers[id], 0, + 0, buffer_size_in_bytes, 0, nullptr, nullptr, nullptr); }; std::vector threads; @@ -264,8 +264,8 @@ TEST_F(CommandBufferThreadSafetyTest, CopyRectInParallel) { const size_t origin[]{0, 0, 0}; const size_t region[]{buffer_size_in_bytes, 1, 1}; error = clCommandCopyBufferRectKHR( - command_buffer, nullptr, src_buffers[id], dst_buffers[id], origin, - origin, region, 0, 0, 0, 0, 0, nullptr, nullptr, nullptr); + command_buffer, nullptr, nullptr, src_buffers[id], dst_buffers[id], + origin, origin, region, 0, 0, 0, 0, 0, nullptr, nullptr, nullptr); }; std::vector threads; 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 40f8f5080..24fe5f2ba 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 @@ -109,7 +109,7 @@ class CommandBufferMutableBufferArgTest : public MutableDispatchTest { TEST_F(CommandBufferMutableBufferArgTest, UpdateOutputBufferOnce) { // Enqueue a mutable dispatch to the command buffer. - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; EXPECT_SUCCESS(clCommandNDRangeKernelKHR( @@ -173,7 +173,7 @@ TEST_F(CommandBufferMutableBufferArgTest, UpdateOutputBufferOnce) { TEST_F(CommandBufferMutableBufferArgTest, UpdateOutputBufferTwice) { // Enqueue a mutable dispatch to the command buffer. - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; EXPECT_SUCCESS(clCommandNDRangeKernelKHR( @@ -281,7 +281,7 @@ TEST_F(CommandBufferMutableBufferArgTest, UpdateOutputBufferTwice) { TEST_F(CommandBufferMutableBufferArgTest, UpdateInputBufferOnce) { // Enqueue a mutable dispatch to the command buffer. - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; EXPECT_SUCCESS(clCommandNDRangeKernelKHR( @@ -351,7 +351,7 @@ TEST_F(CommandBufferMutableBufferArgTest, UpdateInputBufferOnce) { TEST_F(CommandBufferMutableBufferArgTest, UpdateInputBufferTwice) { // Enqueue a mutable dispatch to the command buffer. - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; EXPECT_SUCCESS(clCommandNDRangeKernelKHR( @@ -473,7 +473,7 @@ TEST_F(CommandBufferMutableBufferArgTest, UpdateInputBufferTwice) { TEST_F(CommandBufferMutableBufferArgTest, UpdateInputAndOutputBuffersSameMutableDispatchConfig) { // Enqueue a mutable dispatch to the command buffer. - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; EXPECT_SUCCESS(clCommandNDRangeKernelKHR( @@ -555,7 +555,7 @@ TEST_F(CommandBufferMutableBufferArgTest, TEST_F(CommandBufferMutableBufferArgTest, UpdateInputAndOutputBuffersDifferentMutableDispatchConfigs) { // Enqueue a mutable dispatch to the command buffer. - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; EXPECT_SUCCESS(clCommandNDRangeKernelKHR( @@ -651,7 +651,7 @@ TEST_F(CommandBufferMutableBufferArgTest, TEST_F(CommandBufferMutableBufferArgTest, UpdateToBiggerBufferSize) { // Enqueue a mutable dispatch to the command buffer. - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; EXPECT_SUCCESS(clCommandNDRangeKernelKHR( @@ -731,7 +731,7 @@ TEST_F(CommandBufferMutableBufferArgTest, UpdateToBiggerBufferSize) { TEST_F(CommandBufferMutableBufferArgTest, CheckUpdatePersists) { // Enqueue a mutable dispatch to the command buffer. - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; EXPECT_SUCCESS(clCommandNDRangeKernelKHR( @@ -827,11 +827,11 @@ TEST_F(CommandBufferMutableBufferArgTest, FillThenNDRange) { // mutable dispatch. const cl_int zero = 0x0; EXPECT_SUCCESS(clCommandFillBufferKHR( - command_buffer, nullptr, extra_buffer, &zero, sizeof(cl_int), 0, + command_buffer, nullptr, nullptr, extra_buffer, &zero, sizeof(cl_int), 0, data_size_in_bytes, 0, nullptr, nullptr, nullptr)); // Now enqueue the mutable dispatch. - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; EXPECT_SUCCESS(clCommandNDRangeKernelKHR( @@ -895,7 +895,7 @@ TEST_F(CommandBufferMutableBufferArgTest, FillThenNDRange) { TEST_F(CommandBufferMutableBufferArgTest, NDRangeThenFill) { // Enqueue the mutable dispatch. - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; EXPECT_SUCCESS(clCommandNDRangeKernelKHR( @@ -913,7 +913,7 @@ TEST_F(CommandBufferMutableBufferArgTest, NDRangeThenFill) { // mutable dispatch. const cl_int zero = 0x0; EXPECT_SUCCESS(clCommandFillBufferKHR( - command_buffer, nullptr, extra_buffer, &zero, sizeof(cl_int), 0, + command_buffer, nullptr, nullptr, extra_buffer, &zero, sizeof(cl_int), 0, data_size_in_bytes, 0, nullptr, nullptr, nullptr)); // Finalize the command buffer. @@ -983,14 +983,14 @@ TEST_F(CommandBufferMutableBufferArgTest, FillTwiceThenNDRange) { // mutable dispatch. const cl_int zero = 0x0; EXPECT_SUCCESS(clCommandFillBufferKHR( - command_buffer, nullptr, extra_buffer, &zero, sizeof(cl_int), 0, + command_buffer, nullptr, nullptr, extra_buffer, &zero, sizeof(cl_int), 0, data_size_in_bytes, 0, nullptr, nullptr, nullptr)); EXPECT_SUCCESS(clCommandFillBufferKHR( - command_buffer, nullptr, extra_buffer, &zero, sizeof(cl_int), 0, + command_buffer, nullptr, nullptr, extra_buffer, &zero, sizeof(cl_int), 0, data_size_in_bytes, 0, nullptr, nullptr, nullptr)); // Now enqueue the mutable dispatch. - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; EXPECT_SUCCESS(clCommandNDRangeKernelKHR( @@ -1065,12 +1065,12 @@ TEST_F(CommandBufferMutableBufferArgTest, CopyBufferThenNDRange) { // is to test we can have other commands in the command buffer with the // mutable dispatch. ASSERT_SUCCESS(clCommandCopyBufferKHR( - command_buffer, nullptr, first_extra_buffer, second_extra_buffer, 0, 0, - data_size_in_bytes, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, first_extra_buffer, second_extra_buffer, + 0, 0, data_size_in_bytes, 0, nullptr, nullptr, nullptr)); // Now enqueue the mutable dispatch. - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; EXPECT_SUCCESS(clCommandNDRangeKernelKHR( @@ -1148,11 +1148,11 @@ TEST_F(CommandBufferMutableBufferArgTest, CopyBufferRectThenNDRange) { const size_t origin[]{0, 0, 0}; const size_t region[]{data_size_in_bytes, 1, 1}; ASSERT_SUCCESS(clCommandCopyBufferRectKHR( - command_buffer, nullptr, first_extra_buffer, second_extra_buffer, origin, - origin, region, 0, 0, 0, 0, 0, nullptr, nullptr, nullptr)); + command_buffer, nullptr, nullptr, first_extra_buffer, second_extra_buffer, + origin, origin, region, 0, 0, 0, 0, 0, nullptr, nullptr, nullptr)); // Now enqueue the mutable dispatch. - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; EXPECT_SUCCESS(clCommandNDRangeKernelKHR( @@ -1241,7 +1241,7 @@ TEST_F(CommandBufferMutableBufferArgTest, RegularNDRangeThenMutableNDRange) { &global_size, nullptr, 0, nullptr, nullptr, nullptr)); // Now enqueue the mutable dispatch. - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; EXPECT_SUCCESS(clCommandNDRangeKernelKHR( @@ -1319,7 +1319,7 @@ class CommandBufferMultiMutableBufferArgTest void SetUp() override { UCL_RETURN_ON_FATAL_FAILURE(CommandBufferMutableBufferArgTest::SetUp()); // Enqueue the first mutable dispatch. - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; EXPECT_SUCCESS(clCommandNDRangeKernelKHR( @@ -1630,7 +1630,7 @@ TEST_F(MutableDispatchTest, UpdateConstantBuffer) { EXPECT_SUCCESS(error); // Enqueue a mutable dispatch to the command buffer. - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; cl_mutable_command_khr command_handle; @@ -1742,7 +1742,7 @@ class CommandBufferMutableLocalBufferArgTest : public MutableDispatchTest { EXPECT_SUCCESS(clSetKernelArg(kernel, 0, 64, nullptr)); // Enqueue a mutable dispatch to the command buffer. - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; EXPECT_SUCCESS(clCommandNDRangeKernelKHR( @@ -1962,7 +1962,7 @@ TEST_F(DISABLED_CommandBufferMutableNullArgTest, clSetKernelArg(null_test_kernel, 1, sizeof(dst_buffer), &dst_buffer)); // Enqueue a mutable dispatch to the command buffer. - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; EXPECT_SUCCESS(clCommandNDRangeKernelKHR( @@ -2026,7 +2026,7 @@ TEST_F(DISABLED_CommandBufferMutableNullArgTest, // Enqueue a mutable dispatch to the command buffer. cl_mutable_command_khr command_handle; - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; EXPECT_SUCCESS(clCommandNDRangeKernelKHR( @@ -2090,7 +2090,7 @@ TEST_F(DISABLED_CommandBufferMutableNullArgTest, // Enqueue a mutable dispatch to the command buffer. cl_mutable_command_khr command_handle; - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; EXPECT_SUCCESS(clCommandNDRangeKernelKHR( @@ -2154,7 +2154,7 @@ TEST_F(DISABLED_CommandBufferMutableNullArgTest, // Enqueue a mutable dispatch to the command buffer. cl_mutable_command_khr command_handle; - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; EXPECT_SUCCESS(clCommandNDRangeKernelKHR( @@ -2215,7 +2215,7 @@ TEST_F(DISABLED_CommandBufferMutableNullArgTest, CheckUpdatePersists) { clSetKernelArg(null_test_kernel, 1, sizeof(dst_buffer), &dst_buffer)); // Enqueue a mutable dispatch to the command buffer. - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; EXPECT_SUCCESS(clCommandNDRangeKernelKHR( @@ -2304,7 +2304,7 @@ class DISABLED_CommandBufferMultiMutableNullArgTest clSetKernelArg(null_test_kernel, 1, sizeof(dst_buffer), &dst_buffer)); // Enqueue a mutable dispatch to the command buffer. - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; EXPECT_SUCCESS(clCommandNDRangeKernelKHR( @@ -2545,7 +2545,7 @@ class CommandBufferMutablePODArgTest : public MutableDispatchTest { EXPECT_SUCCESS(error); // Enqueue a mutable dispatch to the command buffer. - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; EXPECT_SUCCESS(clCommandNDRangeKernelKHR( @@ -2868,7 +2868,7 @@ class CommandBufferMultiMutablePODArgTest &second_dst_buffer)); // Enqueue a mutable dispatch to the command buffer. - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; EXPECT_SUCCESS(clCommandNDRangeKernelKHR( @@ -3115,7 +3115,7 @@ class CommandBufferMutablePODMultiArgTest : public MutableDispatchTest { EXPECT_SUCCESS(error); // Enqueue a mutable dispatch to the command buffer. - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; EXPECT_SUCCESS(clCommandNDRangeKernelKHR( @@ -3349,7 +3349,7 @@ TEST_F(CommandBufferMutableStructArgTest, UpdateInputOnce) { // Enqueue a mutable dispatch to the command buffer. cl_mutable_command_khr command_handle; - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; const size_t one = 1; diff --git a/source/cl/test/UnitCL/source/cl_khr_command_buffer_mutable_dispatch/clGetMutableCommandInfoKHR.cpp b/source/cl/test/UnitCL/source/cl_khr_command_buffer_mutable_dispatch/clGetMutableCommandInfoKHR.cpp index 30ee82868..8099cc856 100644 --- a/source/cl/test/UnitCL/source/cl_khr_command_buffer_mutable_dispatch/clGetMutableCommandInfoKHR.cpp +++ b/source/cl/test/UnitCL/source/cl_khr_command_buffer_mutable_dispatch/clGetMutableCommandInfoKHR.cpp @@ -67,7 +67,7 @@ struct MutableCommandInfoTest : MutableDispatchTest { cl_program program = nullptr; cl_kernel kernel = nullptr; - std::array mutable_properties; + std::array mutable_properties; constexpr static size_t global_size = 8; }; @@ -121,10 +121,10 @@ TEST_F(MutableCommandInfoTest, PropertiesSet) { ASSERT_SUCCESS(clGetMutableCommandInfoKHR( command_handle, CL_MUTABLE_DISPATCH_PROPERTIES_ARRAY_KHR, 0, nullptr, &size)); - ASSERT_EQ(size, sizeof(cl_ndrange_kernel_command_properties_khr) * - mutable_properties.size()); + ASSERT_EQ(size, + sizeof(cl_command_properties_khr) * mutable_properties.size()); - std::array queried_properties; + std::array queried_properties; ASSERT_SUCCESS(clGetMutableCommandInfoKHR( command_handle, CL_MUTABLE_DISPATCH_PROPERTIES_ARRAY_KHR, size, queried_properties.data(), nullptr)); 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 039c02b13..22b99b930 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 @@ -320,7 +320,7 @@ TEST_F(CommandBufferUpdateNDKernel, InvalidHandle) { clCreateCommandBufferKHR(1, &command_queue, nullptr, &error); EXPECT_SUCCESS(error); - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; cl_mutable_command_khr new_command_handle; @@ -374,7 +374,7 @@ TEST_F(CommandBufferUpdateNDKernel, UnsupportedPropertyBit) { GTEST_SKIP(); } - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, all_mutable_capabilities, 0}; ASSERT_EQ_ERRCODE( CL_INVALID_OPERATION, @@ -386,7 +386,7 @@ TEST_F(CommandBufferUpdateNDKernel, UnsupportedPropertyBit) { // Return CL_INVALID_VALUE if a property is set that isn't defined TEST_F(CommandBufferUpdateNDKernel, InvalidPropertyBit) { // CL_MUTABLE_DISPATCH_EXEC_INFO_KHR is max representatble value - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_EXEC_INFO_KHR << 1, 0}; ASSERT_EQ_ERRCODE( @@ -399,7 +399,7 @@ TEST_F(CommandBufferUpdateNDKernel, InvalidPropertyBit) { // Return CL_INVALID_VALUE if cl_mutable_dispatch_config_khr type is not // CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR TEST_F(CommandBufferUpdateNDKernel, InvalidDispatchConfigStuctType) { - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; ASSERT_SUCCESS(clCommandNDRangeKernelKHR( @@ -431,7 +431,7 @@ TEST_F(CommandBufferUpdateNDKernel, InvalidDispatchConfigStuctType) { // Return CL_INVALID_VALUE if a bad property was set TEST_F(CommandBufferUpdateNDKernel, InvalidCommandProperty) { - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { 1 /* Invalid property */, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; ASSERT_EQ_ERRCODE( CL_INVALID_VALUE, @@ -443,7 +443,7 @@ TEST_F(CommandBufferUpdateNDKernel, InvalidCommandProperty) { // Return CL_INVALID_OPERATION if the CL_MUTABLE_DISPATCH_ARGUMENTS_KHR // property was not set on command recording and num_args is non-zero. TEST_F(CommandBufferUpdateNDKernel, ImmutablePropertyBit) { - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, 0 /* should have CL_MUTABLE_DISPATCH_ARGUMENTS_KHR*/, 0}; ASSERT_SUCCESS(clCommandNDRangeKernelKHR( @@ -476,7 +476,7 @@ TEST_F(CommandBufferUpdateNDKernel, ImmutablePropertyBit) { // Return CL_INVALID_VALUE if arg_list is NULL and num_args > 0, // or arg_list is not NULL and num_args is 0. TEST_F(CommandBufferUpdateNDKernel, InvalidArgList) { - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; ASSERT_SUCCESS(clCommandNDRangeKernelKHR( @@ -527,7 +527,7 @@ TEST_F(CommandBufferUpdateNDKernel, InvalidArgList) { // Test clSetKernelArg error code for CL_INVALID_ARG_INDEX if arg_index is not // a valid argument index. TEST_F(CommandBufferUpdateNDKernel, InvalidArgIndex) { - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; ASSERT_SUCCESS(clCommandNDRangeKernelKHR( @@ -594,7 +594,7 @@ TEST_F(CommandBufferUpdateNDKernel, InvalidArgValue) { data.data(), &err); EXPECT_SUCCESS(err); - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; EXPECT_SUCCESS(clCommandNDRangeKernelKHR( @@ -630,7 +630,7 @@ TEST_F(CommandBufferUpdateNDKernel, InvalidArgValue) { // Test clSetKernelArg error code for CL_INVALID_ARG_SIZE if arg_size does not // match the size of the data type for an argument TEST_F(CommandBufferUpdateNDKernel, InvalidArgSize) { - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; ASSERT_SUCCESS(clCommandNDRangeKernelKHR( @@ -684,7 +684,7 @@ TEST_F(CommandBufferUpdateNDKernel, IterativeArgumentUpdate) { // Record a mutable dispatch to the command buffer we'll change the arguments // to - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; EXPECT_SUCCESS(clCommandNDRangeKernelKHR( @@ -771,7 +771,7 @@ TEST_F(CommandBufferUpdateNDKernel, OverwriteArgumentUpdate) { nullptr, nullptr)); // Record a mutable dispatch to the command buffer. - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; EXPECT_SUCCESS(clCommandNDRangeKernelKHR( 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 2bffe0756..9be9577fa 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 @@ -92,7 +92,7 @@ TEST_F(MutableDispatchThreadSafetyTest, UpdateInParallel) { // Enqueue the ND range to the kernel getting a handle so we can update it // later. cl_mutable_command_khr command_handle; - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; EXPECT_SUCCESS(clCommandNDRangeKernelKHR( 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 66426c968..1950d1010 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 @@ -129,7 +129,7 @@ void kernel usm_copy(__global int* in, TEST_F(MutableDispatchUSMTest, InvalidArgList) { ASSERT_SUCCESS(clSetKernelArgMemPointerINTEL(kernel, 0, device_ptrs[0])); - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; ASSERT_SUCCESS(clCommandNDRangeKernelKHR( @@ -182,7 +182,7 @@ TEST_F(MutableDispatchUSMTest, InvalidArgList) { TEST_F(MutableDispatchUSMTest, InvalidArgIndex) { ASSERT_SUCCESS(clSetKernelArgMemPointerINTEL(kernel, 0, device_ptrs[0])); - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; ASSERT_SUCCESS(clCommandNDRangeKernelKHR( @@ -216,7 +216,7 @@ TEST_F(MutableDispatchUSMTest, InvalidArgIndex) { TEST_F(MutableDispatchUSMTest, InvalidArgValue) { ASSERT_SUCCESS(clSetKernelArgMemPointerINTEL(kernel, 0, device_ptrs[0])); - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; ASSERT_SUCCESS(clCommandNDRangeKernelKHR( @@ -298,7 +298,7 @@ TEST_P(MutableDispatchUpdateUSMArgs, NoOffset) { ASSERT_SUCCESS(error); // Record a mutable dispatch to the command buffer. - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; ASSERT_SUCCESS(clCommandNDRangeKernelKHR( @@ -388,7 +388,7 @@ TEST_P(MutableDispatchUpdateUSMArgs, Offset) { ASSERT_SUCCESS(error); // Record a mutable dispatch to the command buffer. - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; ASSERT_SUCCESS(clCommandNDRangeKernelKHR( @@ -467,7 +467,7 @@ TEST_F(MutableDispatchUSMTest, DISABLED_BlockingFree) { ASSERT_SUCCESS(clSetKernelArgMemPointerINTEL(kernel, 0, usm_ptr)); // Record a mutable dispatch to the command buffer. - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; ASSERT_SUCCESS(clCommandNDRangeKernelKHR( @@ -513,7 +513,7 @@ TEST_F(MutableDispatchUSMTest, DISABLED_UpdateBlockingFree) { ASSERT_SUCCESS(error); // Record a mutable dispatch to the command buffer. - cl_ndrange_kernel_command_properties_khr mutable_properties[3] = { + cl_command_properties_khr mutable_properties[3] = { CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR, CL_MUTABLE_DISPATCH_ARGUMENTS_KHR, 0}; ASSERT_SUCCESS(clCommandNDRangeKernelKHR( From 25bb7867839d964c9cc3979b7be0466d219ad789 Mon Sep 17 00:00:00 2001 From: Ewan Crawford Date: Thu, 5 Sep 2024 17:24:04 +0100 Subject: [PATCH 2/2] Set correct version --- source/cl/source/extension/source/khr_command_buffer.cpp | 2 +- .../source/khr_command_buffer_mutable_dispatch.cpp | 4 ++-- .../clGetMutableCommandInfoKHR.cpp | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/source/cl/source/extension/source/khr_command_buffer.cpp b/source/cl/source/extension/source/khr_command_buffer.cpp index d5a697f48..4ebb12859 100644 --- a/source/cl/source/extension/source/khr_command_buffer.cpp +++ b/source/cl/source/extension/source/khr_command_buffer.cpp @@ -43,7 +43,7 @@ extension::khr_command_buffer::khr_command_buffer() #else usage_category::DISABLED #endif - CA_CL_EXT_VERSION(0, 1, 0)) { + CA_CL_EXT_VERSION(0, 9, 5)) { } void *extension::khr_command_buffer::GetExtensionFunctionAddressForPlatform( diff --git a/source/cl/source/extension/source/khr_command_buffer_mutable_dispatch.cpp b/source/cl/source/extension/source/khr_command_buffer_mutable_dispatch.cpp index 21eb24e96..b52a96361 100644 --- a/source/cl/source/extension/source/khr_command_buffer_mutable_dispatch.cpp +++ b/source/cl/source/extension/source/khr_command_buffer_mutable_dispatch.cpp @@ -27,7 +27,7 @@ extension::khr_command_buffer_mutable_dispatch:: #else usage_category::DISABLED #endif - CA_CL_EXT_VERSION(0, 1, 0)) { + CA_CL_EXT_VERSION(0, 9, 3)) { } void *extension::khr_command_buffer_mutable_dispatch:: @@ -171,7 +171,7 @@ CL_API_ENTRY cl_int CL_API_CALL clGetMutableCommandInfoKHR( MUTABLE_COMMAND_ARRAY_INFO_CASE(CL_MUTABLE_DISPATCH_LOCAL_WORK_SIZE_KHR, command->local_size); - case CL_MUTABLE_DISPATCH_PROPERTIES_ARRAY_KHR: { + case CL_MUTABLE_COMMAND_PROPERTIES_ARRAY_KHR: { const auto &properties_list = command->properties_list; OCL_SET_IF_NOT_NULL( param_value_size_ret, diff --git a/source/cl/test/UnitCL/source/cl_khr_command_buffer_mutable_dispatch/clGetMutableCommandInfoKHR.cpp b/source/cl/test/UnitCL/source/cl_khr_command_buffer_mutable_dispatch/clGetMutableCommandInfoKHR.cpp index 8099cc856..6b963fb0b 100644 --- a/source/cl/test/UnitCL/source/cl_khr_command_buffer_mutable_dispatch/clGetMutableCommandInfoKHR.cpp +++ b/source/cl/test/UnitCL/source/cl_khr_command_buffer_mutable_dispatch/clGetMutableCommandInfoKHR.cpp @@ -119,14 +119,14 @@ TEST_F(MutableCommandInfoTest, MutableCommandCommandBuffer) { TEST_F(MutableCommandInfoTest, PropertiesSet) { size_t size; ASSERT_SUCCESS(clGetMutableCommandInfoKHR( - command_handle, CL_MUTABLE_DISPATCH_PROPERTIES_ARRAY_KHR, 0, nullptr, + command_handle, CL_MUTABLE_COMMAND_PROPERTIES_ARRAY_KHR, 0, nullptr, &size)); ASSERT_EQ(size, sizeof(cl_command_properties_khr) * mutable_properties.size()); std::array queried_properties; ASSERT_SUCCESS(clGetMutableCommandInfoKHR( - command_handle, CL_MUTABLE_DISPATCH_PROPERTIES_ARRAY_KHR, size, + command_handle, CL_MUTABLE_COMMAND_PROPERTIES_ARRAY_KHR, size, queried_properties.data(), nullptr)); ASSERT_EQ(mutable_properties, queried_properties); } @@ -139,7 +139,7 @@ TEST_F(MutableCommandInfoTest, NoPropertiesSet) { size_t size; EXPECT_SUCCESS(clGetMutableCommandInfoKHR( - no_properties_command_handle, CL_MUTABLE_DISPATCH_PROPERTIES_ARRAY_KHR, 0, + no_properties_command_handle, CL_MUTABLE_COMMAND_PROPERTIES_ARRAY_KHR, 0, nullptr, &size)); EXPECT_EQ(size, 0); }