Skip to content

Commit

Permalink
Added new tests for simultaneous use with mutable dispatch
Browse files Browse the repository at this point in the history
-cross queue simultaneous use
-in-order queue with simultaneous use

According to issue description KhronosGroup#1481
  • Loading branch information
shajder committed Mar 11, 2024
1 parent 1f0fa08 commit c0636b5
Show file tree
Hide file tree
Showing 5 changed files with 293 additions and 94 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set(${MODULE_NAME}_SOURCES
mutable_command_info.cpp
mutable_command_image_arguments.cpp
mutable_command_arguments.cpp
mutable_command_out_of_order.cpp
mutable_command_simultaneous.cpp
mutable_command_global_size.cpp
mutable_command_local_size.cpp
mutable_command_global_offset.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ test_definition test_list[] = {
ADD_TEST(mutable_dispatch_image_2d_arguments),
ADD_TEST(mutable_dispatch_out_of_order),
ADD_TEST(mutable_dispatch_simultaneous_out_of_order),
ADD_TEST(mutable_dispatch_simultaneous_in_order),
ADD_TEST(mutable_dispatch_simultaneous_cross_queue),
ADD_TEST(mutable_dispatch_global_size),
ADD_TEST(mutable_dispatch_local_size),
ADD_TEST(mutable_dispatch_global_offset),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,28 @@ struct BasicMutableCommandBufferTest : BasicCommandBufferTest
: BasicCommandBufferTest(device, context, queue)
{}

virtual cl_int SetUpKernel() override
{
cl_int error = CL_SUCCESS;
clProgramWrapper program = clCreateProgramWithSource(
context, 1, &kernelString, nullptr, &error);
test_error(error, "Unable to create program");

error = clBuildProgram(program, 1, &device, nullptr, nullptr, nullptr);
test_error(error, "Unable to build program");

kernel = clCreateKernel(program, "empty", &error);
test_error(error, "Unable to create kernel");

return CL_SUCCESS;
}

virtual cl_int SetUpKernelArgs() override
{
/* Left blank intentionally */
return CL_SUCCESS;
}

virtual cl_int SetUp(int elements) override
{
BasicCommandBufferTest::SetUp(elements);
Expand All @@ -42,16 +64,6 @@ struct BasicMutableCommandBufferTest : BasicCommandBufferTest
command_buffer = clCreateCommandBufferKHR(1, &queue, props, &error);
test_error(error, "Unable to create command buffer");

clProgramWrapper program = clCreateProgramWithSource(
context, 1, &kernelString, nullptr, &error);
test_error(error, "Unable to create program");

error = clBuildProgram(program, 1, &device, nullptr, nullptr, nullptr);
test_error(error, "Unable to build program");

kernel = clCreateKernel(program, "empty", &error);
test_error(error, "Unable to create kernel");

return error;
}

Expand Down
Loading

0 comments on commit c0636b5

Please sign in to comment.