mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Import OpenCL exported semaphore in Vulkan (#1898)
Except for SYNC_FD, current implementation doesn't import exported OpenCL semaphore in Vulkan and ends up doing signal and wait on essentially two unrelated semaphores (one created in OpenCL and one in Vulkan). Since OpenCL exports the semaphore, import that in Vulkan to perform signal/wait on the same underlying payload.
This commit is contained in:
@@ -140,10 +140,12 @@ int run_test_with_two_queue(
|
||||
}
|
||||
else
|
||||
{
|
||||
clVk2CLExternalSemaphore = new clExternalImportableSemaphore(
|
||||
vkVk2CLSemaphore, context, vkExternalSemaphoreHandleType, deviceId);
|
||||
clCl2VkExternalSemaphore = new clExternalExportableSemaphore(
|
||||
vkCl2VkSemaphore, context, vkExternalSemaphoreHandleType, deviceId);
|
||||
CREATE_OPENCL_SEMAPHORE(clVk2CLExternalSemaphore, vkVk2CLSemaphore,
|
||||
context, vkExternalSemaphoreHandleType,
|
||||
deviceId, false);
|
||||
CREATE_OPENCL_SEMAPHORE(clCl2VkExternalSemaphore, vkCl2VkSemaphore,
|
||||
context, vkExternalSemaphoreHandleType,
|
||||
deviceId, true);
|
||||
}
|
||||
|
||||
const uint32_t maxIter = innerIterations;
|
||||
@@ -469,10 +471,12 @@ int run_test_with_one_queue(
|
||||
}
|
||||
else
|
||||
{
|
||||
clVk2CLExternalSemaphore = new clExternalImportableSemaphore(
|
||||
vkVk2CLSemaphore, context, vkExternalSemaphoreHandleType, deviceId);
|
||||
clCl2VkExternalSemaphore = new clExternalExportableSemaphore(
|
||||
vkCl2VkSemaphore, context, vkExternalSemaphoreHandleType, deviceId);
|
||||
CREATE_OPENCL_SEMAPHORE(clVk2CLExternalSemaphore, vkVk2CLSemaphore,
|
||||
context, vkExternalSemaphoreHandleType,
|
||||
deviceId, false);
|
||||
CREATE_OPENCL_SEMAPHORE(clCl2VkExternalSemaphore, vkCl2VkSemaphore,
|
||||
context, vkExternalSemaphoreHandleType,
|
||||
deviceId, true);
|
||||
}
|
||||
|
||||
const uint32_t maxIter = innerIterations;
|
||||
@@ -770,10 +774,12 @@ int run_test_with_multi_import_same_ctx(
|
||||
}
|
||||
else
|
||||
{
|
||||
clVk2CLExternalSemaphore = new clExternalImportableSemaphore(
|
||||
vkVk2CLSemaphore, context, vkExternalSemaphoreHandleType, deviceId);
|
||||
clCl2VkExternalSemaphore = new clExternalExportableSemaphore(
|
||||
vkCl2VkSemaphore, context, vkExternalSemaphoreHandleType, deviceId);
|
||||
CREATE_OPENCL_SEMAPHORE(clVk2CLExternalSemaphore, vkVk2CLSemaphore,
|
||||
context, vkExternalSemaphoreHandleType,
|
||||
deviceId, false);
|
||||
CREATE_OPENCL_SEMAPHORE(clCl2VkExternalSemaphore, vkCl2VkSemaphore,
|
||||
context, vkExternalSemaphoreHandleType,
|
||||
deviceId, true);
|
||||
}
|
||||
|
||||
const uint32_t maxIter = innerIterations;
|
||||
@@ -1113,17 +1119,19 @@ int run_test_with_multi_import_diff_ctx(
|
||||
}
|
||||
else
|
||||
{
|
||||
clVk2CLExternalSemaphore = new clExternalImportableSemaphore(
|
||||
vkVk2CLSemaphore, context, vkExternalSemaphoreHandleType, deviceId);
|
||||
clCl2VkExternalSemaphore = new clExternalExportableSemaphore(
|
||||
vkCl2VkSemaphore, context, vkExternalSemaphoreHandleType, deviceId);
|
||||
CREATE_OPENCL_SEMAPHORE(clVk2CLExternalSemaphore, vkVk2CLSemaphore,
|
||||
context, vkExternalSemaphoreHandleType,
|
||||
deviceId, false);
|
||||
CREATE_OPENCL_SEMAPHORE(clCl2VkExternalSemaphore, vkCl2VkSemaphore,
|
||||
context, vkExternalSemaphoreHandleType,
|
||||
deviceId, false);
|
||||
|
||||
clVk2CLExternalSemaphore2 = new clExternalImportableSemaphore(
|
||||
vkVk2CLSemaphore, context2, vkExternalSemaphoreHandleType,
|
||||
deviceId);
|
||||
clCl2VkExternalSemaphore2 = new clExternalExportableSemaphore(
|
||||
vkCl2VkSemaphore, context2, vkExternalSemaphoreHandleType,
|
||||
deviceId);
|
||||
CREATE_OPENCL_SEMAPHORE(clVk2CLExternalSemaphore2, vkVk2CLSemaphore,
|
||||
context2, vkExternalSemaphoreHandleType,
|
||||
deviceId, false);
|
||||
CREATE_OPENCL_SEMAPHORE(clCl2VkExternalSemaphore2, vkCl2VkSemaphore,
|
||||
context2, vkExternalSemaphoreHandleType,
|
||||
deviceId, false);
|
||||
}
|
||||
|
||||
const uint32_t maxIter = innerIterations;
|
||||
|
||||
@@ -251,10 +251,10 @@ int run_test_with_two_queue(
|
||||
clExternalSemaphore *clVk2CLExternalSemaphore = NULL;
|
||||
clExternalSemaphore *clCl2VkExternalSemaphore = NULL;
|
||||
|
||||
clVk2CLExternalSemaphore = new clExternalImportableSemaphore(
|
||||
vkVk2CLSemaphore, context, vkExternalSemaphoreHandleType, deviceId);
|
||||
clCl2VkExternalSemaphore = new clExternalExportableSemaphore(
|
||||
vkCl2VkSemaphore, context, vkExternalSemaphoreHandleType, deviceId);
|
||||
CREATE_OPENCL_SEMAPHORE(clVk2CLExternalSemaphore, vkVk2CLSemaphore, context,
|
||||
vkExternalSemaphoreHandleType, deviceId, false);
|
||||
CREATE_OPENCL_SEMAPHORE(clCl2VkExternalSemaphore, vkCl2VkSemaphore, context,
|
||||
vkExternalSemaphoreHandleType, deviceId, true);
|
||||
|
||||
std::vector<VulkanDeviceMemory *> vkImage2DListDeviceMemory1;
|
||||
std::vector<VulkanDeviceMemory *> vkImage2DListDeviceMemory2;
|
||||
@@ -863,10 +863,10 @@ int run_test_with_one_queue(
|
||||
clExternalSemaphore *clVk2CLExternalSemaphore = NULL;
|
||||
clExternalSemaphore *clCl2VkExternalSemaphore = NULL;
|
||||
|
||||
clVk2CLExternalSemaphore = new clExternalImportableSemaphore(
|
||||
vkVk2CLSemaphore, context, vkExternalSemaphoreHandleType, deviceId);
|
||||
clCl2VkExternalSemaphore = new clExternalExportableSemaphore(
|
||||
vkCl2VkSemaphore, context, vkExternalSemaphoreHandleType, deviceId);
|
||||
CREATE_OPENCL_SEMAPHORE(clVk2CLExternalSemaphore, vkVk2CLSemaphore, context,
|
||||
vkExternalSemaphoreHandleType, deviceId, false);
|
||||
CREATE_OPENCL_SEMAPHORE(clCl2VkExternalSemaphore, vkCl2VkSemaphore, context,
|
||||
vkExternalSemaphoreHandleType, deviceId, true);
|
||||
|
||||
std::vector<VulkanDeviceMemory *> vkImage2DListDeviceMemory1;
|
||||
std::vector<VulkanDeviceMemory *> vkImage2DListDeviceMemory2;
|
||||
|
||||
Reference in New Issue
Block a user