Skip to content

Commit

Permalink
Added minor correction
Browse files Browse the repository at this point in the history
  • Loading branch information
kamil-goras-mobica committed May 8, 2024
1 parent 89a9111 commit a89e6f2
Showing 1 changed file with 24 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,13 @@ struct CommandBufferCopySyncPointsNullOrNumZero : public BasicCommandBufferTest

cl_int Run() override
{
cl_int error = clCommandCopyImageKHR(command_buffer, nullptr, src_image,
dst_image, origin, origin, region,
1, nullptr, nullptr, nullptr);
cl_sync_point_khr invalid_point = 0;
std::vector<cl_sync_point_khr*> invalid_sync_points;
invalid_sync_points.push_back(&invalid_point);

cl_int error = clCommandCopyImageKHR(
command_buffer, nullptr, src_image, dst_image, origin, origin,
region, 1, *invalid_sync_points.data(), nullptr, nullptr);

test_failure_error_ret(error, CL_INVALID_SYNC_POINT_WAIT_LIST_KHR,
"clCommandCopyImageKHR should return "
Expand All @@ -203,51 +207,52 @@ struct CommandBufferCopySyncPointsNullOrNumZero : public BasicCommandBufferTest

error = clCommandCopyImageToBufferKHR(
command_buffer, nullptr, src_image, dst_image, origin, origin, 0, 1,
nullptr, nullptr, nullptr);
*invalid_sync_points.data(), nullptr, nullptr);

test_failure_error_ret(error, CL_INVALID_SYNC_POINT_WAIT_LIST_KHR,
"clCommandCopyImageKHR should return "
"CL_INVALID_SYNC_POINT_WAIT_LIST_KHR",
TEST_FAIL);

cl_sync_point_khr point = 1;
std::vector<cl_sync_point_khr> sync_points;
sync_points.push_back(point);

error = clCommandCopyImageKHR(command_buffer, nullptr, src_image,
dst_image, origin, origin, region, 0,
sync_points.data(), nullptr, nullptr);
dst_image, origin, origin, region, 1,
nullptr, nullptr, nullptr);

test_failure_error_ret(error, CL_INVALID_SYNC_POINT_WAIT_LIST_KHR,
"clCommandCopyImageKHR should return "
"CL_INVALID_SYNC_POINT_WAIT_LIST_KHR",
TEST_FAIL);

error = clCommandCopyImageToBufferKHR(
command_buffer, nullptr, src_image, dst_image, origin, origin, 0, 0,
sync_points.data(), nullptr, nullptr);
command_buffer, nullptr, src_image, dst_image, origin, origin, 0, 1,
nullptr, nullptr, nullptr);

test_failure_error_ret(error, CL_INVALID_SYNC_POINT_WAIT_LIST_KHR,
"clCommandCopyImageKHR should return "
"CL_INVALID_SYNC_POINT_WAIT_LIST_KHR",
TEST_FAIL);

cl_sync_point_khr* invalid_point = nullptr;
std::vector<cl_sync_point_khr*> invalid_sync_points;
invalid_sync_points.push_back(invalid_point);

error = clCommandCopyImageKHR(
command_buffer, nullptr, src_image, dst_image, origin, origin,
region, 1, *invalid_sync_points.data(), nullptr, nullptr);
cl_sync_point_khr point;
error = clCommandBarrierWithWaitListKHR(command_buffer, nullptr, 0,
nullptr, &point, nullptr);
test_error(error, "clCommandBarrierWithWaitListKHR failed");
std::vector<cl_sync_point_khr> sync_points;
sync_points.push_back(point);

error = clCommandCopyImageKHR(command_buffer, nullptr, src_image,
dst_image, origin, origin, region, 0,
sync_points.data(), nullptr, nullptr);

test_failure_error_ret(error, CL_INVALID_SYNC_POINT_WAIT_LIST_KHR,
"clCommandCopyImageKHR should return "
"CL_INVALID_SYNC_POINT_WAIT_LIST_KHR",
TEST_FAIL);

error = clCommandCopyImageToBufferKHR(
command_buffer, nullptr, src_image, dst_image, origin, origin, 0, 1,
*invalid_sync_points.data(), nullptr, nullptr);
command_buffer, nullptr, src_image, dst_image, origin, origin, 0, 0,
sync_points.data(), nullptr, nullptr);

test_failure_error_ret(error, CL_INVALID_SYNC_POINT_WAIT_LIST_KHR,
"clCommandCopyImageKHR should return "
Expand Down

0 comments on commit a89e6f2

Please sign in to comment.