Skip to content

Commit

Permalink
Check command-buffer extension version for equality (#2215)
Browse files Browse the repository at this point in the history
As described in Issue
#2152 we currently
check the provisional extension version supported by a vendor is the
same or older than a test specified version. However, it was discussed
in the WG that this should be a check for equality to avoid hitting
issues when a implementation tests against an older version of the CTS
using a lower extension version, with API breaking changes having
occurred since.

The tests for the command-buffer family of extensions are the only
provisional KHR tests using this versioning check, so this PR updates
all those cases to equality.
  • Loading branch information
EwanC authored Jan 14, 2025
1 parent 4fd4215 commit 98d52d0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,10 @@ int MakeAndRunTest(cl_device_id device, cl_context context,
cl_version extension_version =
get_extension_version(device, "cl_khr_command_buffer");

if (extension_version < CL_MAKE_VERSION(0, 9, 5))
if (extension_version != CL_MAKE_VERSION(0, 9, 5))
{

log_info("cl_khr_command_buffer version 0.9.5 or later is required "
"to run "
log_info("cl_khr_command_buffer version 0.9.5 is required to run "
"the test, skipping.\n ");
return TEST_SKIPPED_ITSELF;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,24 @@ struct BasicMutableCommandBufferTest : BasicCommandBufferTest
"cl_khr_command_buffer_mutable_dispatch")
== true;

if (extension_avaliable) {
// API breaking changes occur at revision 0.9.2, check implementation
// matches tested API
Version device_version = get_device_cl_version(device);
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");

if (extension_version < CL_MAKE_VERSION(0, 9, 2)) {
extension_avaliable = false;
}
}
if (extension_avaliable)
{
Version device_version = get_device_cl_version(device);
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");

if (extension_version != CL_MAKE_VERSION(0, 9, 3))
{
log_info("cl_khr_command_buffer_mutable_dispatch version "
"0.9.3 is "
"required to run the test, skipping.\n ");
extension_avaliable = false;
}
}
}

cl_mutable_dispatch_fields_khr mutable_capabilities;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,10 @@ struct PropertiesArray : public InfoMutableCommandBufferTest
cl_version extension_version = get_extension_version(
device, "cl_khr_command_buffer_mutable_dispatch");

if (extension_version < CL_MAKE_VERSION(0, 9, 3))
if (extension_version != CL_MAKE_VERSION(0, 9, 3))
{
log_info("cl_khr_command_buffer_mutable_dispatch version 0.9.3 "
"is required to run the test, skipping.\n ");
return true;
}
}
Expand Down

0 comments on commit 98d52d0

Please sign in to comment.