Skip to content

Commit

Permalink
Added command buffer test with all mutable parameters dispatch (Khron…
Browse files Browse the repository at this point in the history
…osGroup#1905)

* Added command buffer with full mutable dispatch test

According to KhronosGroup#1481 issue description, point 2.1

* Corrected the test to handle all available mutable properties

According to KhronosGroup#1481 issue description, point 2.1
  • Loading branch information
shajder authored Mar 12, 2024
1 parent 6530ae4 commit ffb0265
Show file tree
Hide file tree
Showing 5 changed files with 521 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ set(${MODULE_NAME}_SOURCES
mutable_command_global_size.cpp
mutable_command_local_size.cpp
mutable_command_global_offset.cpp
mutable_command_full_dispatch.cpp
../basic_command_buffer.cpp
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ test_definition test_list[] = {
ADD_TEST(mutable_command_info_global_work_offset),
ADD_TEST(mutable_command_info_local_work_size),
ADD_TEST(mutable_command_info_global_work_size),
ADD_TEST(mutable_command_full_dispatch),
ADD_TEST(mutable_dispatch_image_1d_arguments),
ADD_TEST(mutable_dispatch_image_2d_arguments),
ADD_TEST(mutable_dispatch_out_of_order),
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 ffb0265

Please sign in to comment.