From 503864e5d756237886bfe9b313f274652e49d54e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Tue, 20 Jun 2023 13:55:02 +0200 Subject: [PATCH] Fix review comments. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Jastrzębski --- .../mutable_command_image_arguments.cpp | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/test_conformance/extensions/cl_khr_command_buffer/cl_khr_command_buffer_mutable_dispatch/mutable_command_image_arguments.cpp b/test_conformance/extensions/cl_khr_command_buffer/cl_khr_command_buffer_mutable_dispatch/mutable_command_image_arguments.cpp index 7ffcc53de2..4c2831291c 100644 --- a/test_conformance/extensions/cl_khr_command_buffer/cl_khr_command_buffer_mutable_dispatch/mutable_command_image_arguments.cpp +++ b/test_conformance/extensions/cl_khr_command_buffer/cl_khr_command_buffer_mutable_dispatch/mutable_command_image_arguments.cpp @@ -153,8 +153,8 @@ struct MutableDispatchImage1DArguments : public BasicMutableCommandBufferTest test_error(error, "clFinish failed."); clMemWrapper new_image = create_image_1d( - context, CL_MEM_READ_WRITE, &formats, image_desc.image_width, 0, - host_ptr, nullptr, &error); + context, CL_MEM_READ_WRITE | CL_MEM_COPY_HOST_PTR, &formats, + image_desc.image_width, 0, host_ptr, nullptr, &error); test_error(error, "create_image_2d failed"); cl_mutable_dispatch_arg_khr arg_0{ 0, sizeof(cl_mem), &new_image }; @@ -182,7 +182,11 @@ struct MutableDispatchImage1DArguments : public BasicMutableCommandBufferTest error = clUpdateMutableCommandsKHR(command_buffer, &mutable_config); test_error(error, "clUpdateMutableCommandsKHR failed"); - size_t origin[3] = { 0, 0, 0 }; + error = clEnqueueCommandBufferKHR(0, nullptr, command_buffer, 0, + nullptr, nullptr); + test_error(error, "clEnqueueCommandBufferKHR failed") + + size_t origin[3] = { 0, 0, 0 }; size_t region[3] = { image_desc.image_width, 1, 1 }; error = clEnqueueReadImage(queue, new_image, CL_TRUE, origin, region, 0, @@ -263,7 +267,6 @@ struct MutableDispatchImage2DArguments : public BasicMutableCommandBufferTest imageInfo.format = &formats; BufferOwningPtr imageValues; - std::vector outputData1(data_size); MTdataHolder d(gRandomSeed); generate_random_image_data(&imageInfo, imageValues, d); @@ -365,21 +368,25 @@ struct MutableDispatchImage2DArguments : public BasicMutableCommandBufferTest error = clUpdateMutableCommandsKHR(command_buffer, &mutable_config); test_error(error, "clUpdateMutableCommandsKHR failed"); + error = clEnqueueCommandBufferKHR(0, nullptr, command_buffer, 0, + nullptr, nullptr); + test_error(error, "clEnqueueCommandBufferKHR failed"); + size_t origin[3] = { 0, 0, 0 }; size_t region[3] = { image_desc.image_width, image_desc.image_height, 1 }; error = clEnqueueReadImage(queue, new_image, CL_TRUE, origin, region, 0, - 0, outputData1.data(), 0, nullptr, nullptr); + 0, outputData, 0, nullptr, nullptr); test_error(error, "clEnqueueReadImage failed"); for (size_t i = 0; i < imageInfo.width * imageInfo.height; ++i) { - if (imageValues[i] != outputData1[i]) + if (imageValues[i] != outputData[i]) { log_error("Data failed to verify: imageValues[%d]=%d != " "outputData[%d]=%d\n", - i, imageValues[i], i, outputData1[i]); + i, imageValues[i], i, outputData[i]); } return TEST_FAIL; }