Skip to content

Commit

Permalink
cl_khr_command_buffer_mutable_dispatch & negative_command_buffer test…
Browse files Browse the repository at this point in the history
…s: fix Skip logic
  • Loading branch information
franz committed Oct 26, 2024
1 parent fd357b4 commit ac736ac
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ struct PropertiesArray : public InfoMutableCommandBufferTest
if ((device_version >= Version(3, 0))
|| is_extension_available(device, "cl_khr_extended_versioning"))
{

cl_version extension_version = get_extension_version(
device, "cl_khr_command_buffer_mutable_dispatch");

Expand All @@ -134,6 +133,16 @@ struct PropertiesArray : public InfoMutableCommandBufferTest
return true;
}
}

cl_mutable_dispatch_fields_khr mutable_capabilities;
cl_int error = clGetDeviceInfo(
device, CL_DEVICE_MUTABLE_DISPATCH_CAPABILITIES_KHR,
sizeof(mutable_capabilities), &mutable_capabilities, nullptr);
test_error(error, "clGetDeviceInfo failed");

if ((mutable_capabilities & CL_MUTABLE_DISPATCH_ARGUMENTS_KHR) == 0)
return true;

return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ struct CommandBufferBarrierMutableHandleNotNull : public BasicCommandBufferTest
{
using BasicCommandBufferTest::BasicCommandBufferTest;

bool Skip() override
{
if (BasicCommandBufferTest::Skip())
return true;
return is_extension_available(device,
"cl_khr_command_buffer_mutable_dispatch");
}

cl_int Run() override
{
cl_mutable_command_khr mutable_handle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,14 @@ struct CommandBufferCopyImageMutableHandleNotNull : public CommandCopyBaseTest
{
using CommandCopyBaseTest::CommandCopyBaseTest;

bool Skip() override
{
if (CommandCopyBaseTest::Skip())
return true;
return is_extension_available(device,
"cl_khr_command_buffer_mutable_dispatch");
}

cl_int Run() override
{
cl_mutable_command_khr mutable_handle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,14 @@ struct CommandBufferCommandFillBufferMutableHandleNotNull
{
using CommandFillBaseTest::CommandFillBaseTest;

bool Skip() override
{
if (CommandFillBaseTest::Skip())
return true;
return is_extension_available(device,
"cl_khr_command_buffer_mutable_dispatch");
}

cl_int Run() override
{
cl_mutable_command_khr mutable_handle;
Expand All @@ -440,6 +448,14 @@ struct CommandBufferCommandFillImageMutableHandleNotNull
{
using CommandFillBaseTest::CommandFillBaseTest;

bool Skip() override
{
if (CommandFillBaseTest::Skip())
return true;
return is_extension_available(device,
"cl_khr_command_buffer_mutable_dispatch");
}

cl_int Run() override
{
cl_mutable_command_khr mutable_handle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,15 @@ struct CommandBufferCommandSVMMutableHandleNotNull
{
using BasicSVMCommandBufferTest::BasicSVMCommandBufferTest;

bool Skip() override
{
if (BasicSVMCommandBufferTest::Skip())
return true;
return is_extension_available(device,
"cl_khr_command_buffer_mutable_dispatch");
}


cl_int Run() override
{
cl_mutable_command_khr mutable_handle;
Expand Down

0 comments on commit ac736ac

Please sign in to comment.