mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
fix negative_create_command_buffer_not_supported_properties test (#2248)
fixes #2247 * For the `negative_create_command_buffer_not_supported_properties` test, the only property we can check for is simultaneous use. All other properties are part of other extensions and hence will generate `CL_INVALID_VALUE`, not `CL_INVALID_PROPERTY`. * Checks whether the `cl_khr_command_buffer_multi_device` extension is supported when using `CL_COMMAND_BUFFER_DEVICE_SIDE_SYNC_KHR`, instead of `device_side_enqueue_support`. * If the `cl_khr_command_buffer_multi_device` extension is NOT supported and the `CL_COMMAND_BUFFER_DEVICE_SIDE_SYNC_KHR` command buffer creation flag is used, the expected error code is `CL_INVALID_VALUE`, not `CL_INVALID_PROPERTY`.
This commit is contained in:
@@ -197,8 +197,6 @@ struct MultiFlagCreationTest : public BasicCommandBufferTest
|
||||
cl_int Run() override
|
||||
{
|
||||
cl_command_buffer_properties_khr flags = 0;
|
||||
size_t num_flags_set = 0;
|
||||
bool multi_flags_supported = true;
|
||||
cl_int error = CL_SUCCESS;
|
||||
|
||||
// First try to find multiple flags that are supported by the driver and
|
||||
@@ -206,30 +204,18 @@ struct MultiFlagCreationTest : public BasicCommandBufferTest
|
||||
if (simultaneous_use_support)
|
||||
{
|
||||
flags |= CL_COMMAND_BUFFER_SIMULTANEOUS_USE_KHR;
|
||||
num_flags_set++;
|
||||
}
|
||||
|
||||
if (device_side_enqueue_support)
|
||||
if (is_extension_available(
|
||||
device, CL_KHR_COMMAND_BUFFER_MULTI_DEVICE_EXTENSION_NAME))
|
||||
{
|
||||
flags |= CL_COMMAND_BUFFER_DEVICE_SIDE_SYNC_KHR;
|
||||
num_flags_set++;
|
||||
}
|
||||
|
||||
if (is_extension_available(
|
||||
device, CL_KHR_COMMAND_BUFFER_MUTABLE_DISPATCH_EXTENSION_NAME))
|
||||
{
|
||||
flags |= CL_COMMAND_BUFFER_MUTABLE_KHR;
|
||||
num_flags_set++;
|
||||
}
|
||||
|
||||
// If we can't find multiple supported flags, still set a bitfield but
|
||||
// expect CL_INVALID_PROPERTY to be returned on creation.
|
||||
if (num_flags_set < 2)
|
||||
{
|
||||
flags = CL_COMMAND_BUFFER_SIMULTANEOUS_USE_KHR
|
||||
| CL_COMMAND_BUFFER_DEVICE_SIDE_SYNC_KHR;
|
||||
|
||||
multi_flags_supported = false;
|
||||
}
|
||||
|
||||
cl_command_buffer_properties_khr props[] = {
|
||||
@@ -237,17 +223,7 @@ struct MultiFlagCreationTest : public BasicCommandBufferTest
|
||||
};
|
||||
|
||||
command_buffer = clCreateCommandBufferKHR(1, &queue, props, &error);
|
||||
if (multi_flags_supported)
|
||||
{
|
||||
test_error(error, "clCreateCommandBufferKHR failed");
|
||||
}
|
||||
else
|
||||
{
|
||||
test_failure_error_ret(
|
||||
error, CL_INVALID_PROPERTY,
|
||||
"clCreateCommandBufferKHR should return CL_INVALID_PROPERTY",
|
||||
TEST_FAIL);
|
||||
}
|
||||
test_error(error, "clCreateCommandBufferKHR failed");
|
||||
|
||||
return CL_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -137,7 +137,8 @@ struct CreateCommandBufferRepeatedProperties : public BasicCommandBufferTest
|
||||
rep_prop = CL_COMMAND_BUFFER_SIMULTANEOUS_USE_KHR;
|
||||
skip = false;
|
||||
}
|
||||
else if (device_side_enqueue_support)
|
||||
else if (is_extension_available(
|
||||
device, CL_KHR_COMMAND_BUFFER_MULTI_DEVICE_EXTENSION_NAME))
|
||||
{
|
||||
rep_prop = CL_COMMAND_BUFFER_DEVICE_SIDE_SYNC_KHR;
|
||||
skip = false;
|
||||
@@ -190,11 +191,6 @@ struct CreateCommandBufferNotSupportedProperties : public BasicCommandBufferTest
|
||||
unsupported_prop = CL_COMMAND_BUFFER_SIMULTANEOUS_USE_KHR;
|
||||
skip = false;
|
||||
}
|
||||
else if (!device_side_enqueue_support)
|
||||
{
|
||||
unsupported_prop = CL_COMMAND_BUFFER_DEVICE_SIDE_SYNC_KHR;
|
||||
skip = false;
|
||||
}
|
||||
|
||||
return skip;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user