Report external sharing tests as skipped instead of failed when not supported (#2277)

Throwing an exception in the constructor for VulkanTestBase was always
reported as an error.

Signed-off-by: Kévin Petit <kpet@free.fr>
This commit is contained in:
Kévin Petit
2025-02-18 18:52:44 +00:00
committed by GitHub
parent 46dcf18a18
commit 24597e0145

View File

@@ -43,15 +43,6 @@ struct VulkanTestBase
vkDevice.reset( vkDevice.reset(
new VulkanDevice(getAssociatedVulkanPhysicalDevice(device))); new VulkanDevice(getAssociatedVulkanPhysicalDevice(device)));
if (!(is_extension_available(device, "cl_khr_external_memory")
&& is_extension_available(device, "cl_khr_external_semaphore")))
{
log_info("Device does not support cl_khr_external_memory "
"or cl_khr_external_semaphore\n");
log_info(" TEST SKIPPED\n");
throw std::runtime_error("VulkanTestBase not supported");
}
cl_platform_id platform; cl_platform_id platform;
cl_int error = clGetDeviceInfo(device, CL_DEVICE_PLATFORM, cl_int error = clGetDeviceInfo(device, CL_DEVICE_PLATFORM,
sizeof(cl_platform_id), &platform, NULL); sizeof(cl_platform_id), &platform, NULL);
@@ -101,6 +92,15 @@ template <class T>
int MakeAndRunTest(cl_device_id device, cl_context context, int MakeAndRunTest(cl_device_id device, cl_context context,
cl_command_queue queue, cl_int nelems) cl_command_queue queue, cl_int nelems)
{ {
if (!(is_extension_available(device, "cl_khr_external_memory")
&& is_extension_available(device, "cl_khr_external_semaphore")))
{
log_info("Device does not support cl_khr_external_memory "
"or cl_khr_external_semaphore\n");
log_info(" TEST SKIPPED\n");
return TEST_SKIPPED_ITSELF;
}
if (!checkVkSupport()) if (!checkVkSupport())
{ {
log_info("Vulkan supported GPU not found \n"); log_info("Vulkan supported GPU not found \n");