Fix errors in test_vulkan (#2183)

This fixes three problems in `test_vulkan`:

1. One negative test is violating the OpenCL specification. A call to
`clEnqueue{Wait,Signal}SemaphoresKHR` with an invalid semaphore should
return `CL_INVALID_SEMAPHORE_KHR` and not `CL_INVALID_VALUE`.
>
[CL_INVALID_SEMAPHORE_KHR](https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html#CL_INVALID_SEMAPHORE_KHR)
if any of the semaphore objects specified by sema_objects is not valid.

2. When populating the list of supported external memory handle types
for Vulkan, the types are unconditionally added to the list, without
checking if the device supports it or not, this fix is namely for
`VULKAN_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD`.

3. If a device does not support an optional extension (that is required
for a test), the test should skip, not throw an exception and fail. A
test failure should be reserved for the cases where a device claims
support for an extension but then fails to execute the test correctly.

---------

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
This commit is contained in:
Ahmed Hesham
2025-01-28 18:08:24 +00:00
committed by GitHub
parent c6cfb6800f
commit 73dd3b9af8
9 changed files with 70 additions and 38 deletions

View File

@@ -208,7 +208,9 @@ int run_test_with_two_queue(
std::vector<VulkanFormat> vkFormatList = getSupportedVulkanFormatList();
const std::vector<VulkanExternalMemoryHandleType>
vkExternalMemoryHandleTypeList =
getSupportedVulkanExternalMemoryHandleTypeList();
getSupportedVulkanExternalMemoryHandleTypeList(
vkDevice.getPhysicalDevice());
char magicValue = 0;
VulkanBuffer vkParamsBuffer(vkDevice, sizeof(Params));
@@ -820,7 +822,8 @@ int run_test_with_one_queue(
std::vector<VulkanFormat> vkFormatList = getSupportedVulkanFormatList();
const std::vector<VulkanExternalMemoryHandleType>
vkExternalMemoryHandleTypeList =
getSupportedVulkanExternalMemoryHandleTypeList();
getSupportedVulkanExternalMemoryHandleTypeList(
vkDevice.getPhysicalDevice());
char magicValue = 0;
VulkanBuffer vkParamsBuffer(vkDevice, sizeof(Params));