diff --git a/test_conformance/common/vulkan_wrapper/opencl_vulkan_wrapper.cpp b/test_conformance/common/vulkan_wrapper/opencl_vulkan_wrapper.cpp index 610af67e13..92dfbda315 100644 --- a/test_conformance/common/vulkan_wrapper/opencl_vulkan_wrapper.cpp +++ b/test_conformance/common/vulkan_wrapper/opencl_vulkan_wrapper.cpp @@ -550,7 +550,7 @@ clExternalMemory::clExternalMemory(const clExternalMemory &externalMemory) clExternalMemory::clExternalMemory( const VulkanDeviceMemory *deviceMemory, VulkanExternalMemoryHandleType externalMemoryHandleType, uint64_t size, - cl_context context, cl_device_id deviceId) + cl_context context, cl_device_id deviceId, cl_bool useNameForImport) { int err = 0; m_externalMemory = NULL; @@ -592,7 +592,7 @@ clExternalMemory::clExternalMemory( ASSERT(0); #else const std::wstring &name = deviceMemory->getName(); - if (name.size()) + if (name.size() && useNameForImport) { err = check_external_memory_handle_type( devList[0], CL_EXTERNAL_MEMORY_HANDLE_OPAQUE_WIN32_NAME_KHR); @@ -655,7 +655,8 @@ clExternalMemoryImage::clExternalMemoryImage( const VulkanDeviceMemory &deviceMemory, VulkanExternalMemoryHandleType externalMemoryHandleType, cl_context context, size_t totalImageMemSize, size_t imageWidth, size_t imageHeight, - size_t totalSize, const VulkanImage2D &image2D, cl_device_id deviceId) + size_t totalSize, const VulkanImage2D &image2D, cl_device_id deviceId, + cl_bool useNameForImport) { cl_int errcode_ret = 0; std::vector extMemProperties1; @@ -683,7 +684,7 @@ clExternalMemoryImage::clExternalMemoryImage( { log_info("Opaque NT handles are only supported on Windows\n"); const std::wstring &name = deviceMemory.getName(); - if (name.size()) + if (name.size() && useNameForImport) { errcode_ret = check_external_memory_handle_type( devList[0], CL_EXTERNAL_MEMORY_HANDLE_OPAQUE_WIN32_NAME_KHR); @@ -787,7 +788,7 @@ clExternalSemaphore::~clExternalSemaphore() = default; clExternalImportableSemaphore::clExternalImportableSemaphore( const VulkanSemaphore &semaphore, cl_context context, VulkanExternalSemaphoreHandleType externalSemaphoreHandleType, - cl_device_id deviceId) + cl_device_id deviceId, cl_bool useNameForImport) : m_deviceSemaphore(semaphore) { @@ -823,7 +824,7 @@ clExternalImportableSemaphore::clExternalImportableSemaphore( ASSERT(0); #else const std::wstring &name = semaphore.getName(); - if (name.size()) + if (name.size() && useNameForImport) { err = check_external_semaphore_handle_type( devList[0], CL_SEMAPHORE_HANDLE_OPAQUE_WIN32_NAME_KHR); diff --git a/test_conformance/common/vulkan_wrapper/opencl_vulkan_wrapper.hpp b/test_conformance/common/vulkan_wrapper/opencl_vulkan_wrapper.hpp index 16389c44c7..0e56d6b0c0 100644 --- a/test_conformance/common/vulkan_wrapper/opencl_vulkan_wrapper.hpp +++ b/test_conformance/common/vulkan_wrapper/opencl_vulkan_wrapper.hpp @@ -91,7 +91,8 @@ class clExternalMemory { clExternalMemory(); clExternalMemory(const VulkanDeviceMemory *deviceMemory, VulkanExternalMemoryHandleType externalMemoryHandleType, - uint64_t size, cl_context context, cl_device_id deviceId); + uint64_t size, cl_context context, cl_device_id deviceId, + cl_bool useNameForImport = CL_FALSE); virtual ~clExternalMemory(); cl_mem getExternalMemoryBuffer(); @@ -109,7 +110,7 @@ class clExternalMemoryImage { VulkanExternalMemoryHandleType externalMemoryHandleType, cl_context context, size_t totalImageMemSize, size_t imageWidth, size_t imageHeight, size_t totalSize, const VulkanImage2D &image2D, - cl_device_id deviceId); + cl_device_id deviceId, cl_bool useNameForImport = CL_FALSE); virtual ~clExternalMemoryImage(); cl_mem getExternalMemoryImage(); }; @@ -137,7 +138,7 @@ class clExternalImportableSemaphore : public virtual clExternalSemaphore { clExternalImportableSemaphore( const VulkanSemaphore &deviceSemaphore, cl_context context, VulkanExternalSemaphoreHandleType externalSemaphoreHandleType, - cl_device_id deviceId); + cl_device_id deviceId, cl_bool useNameForImport = CL_FALSE); ~clExternalImportableSemaphore() override; int wait(cl_command_queue command_queue) override; int signal(cl_command_queue command_queue) override;