mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 22:19:02 +00:00
Add testing for sync_fd (#1747)
Modify the external semaphore extension test to use SYNC_FD, if available on the device. Deleted tests that are not compatible with blocking semaphores.
This commit is contained in:
committed by
GitHub
parent
e29d0fd3a1
commit
aa23f345c3
@@ -740,21 +740,42 @@ clExternalSemaphore::clExternalSemaphore(
|
||||
cl_int err = 0;
|
||||
cl_device_id devList[] = { deviceId, NULL };
|
||||
|
||||
#ifdef _WIN32
|
||||
if (!is_extension_available(devList[0], "cl_khr_external_semaphore_win32"))
|
||||
switch (externalSemaphoreHandleType)
|
||||
{
|
||||
throw std::runtime_error("Device does not support "
|
||||
"cl_khr_external_semaphore_win32 extension\n");
|
||||
case VULKAN_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD:
|
||||
if (!is_extension_available(devList[0],
|
||||
"cl_khr_external_semaphore_opaque_fd"))
|
||||
{
|
||||
throw std::runtime_error("Device does not support "
|
||||
"cl_khr_external_semaphore_opaque_fd "
|
||||
"extension \n");
|
||||
}
|
||||
break;
|
||||
case VULKAN_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_NT:
|
||||
case VULKAN_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT:
|
||||
case VULKAN_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_NT_KMT:
|
||||
if (!is_extension_available(devList[0],
|
||||
"cl_khr_external_semaphore_win32"))
|
||||
{
|
||||
throw std::runtime_error(
|
||||
"Device does not support "
|
||||
"cl_khr_external_semaphore_win32 extension\n");
|
||||
}
|
||||
break;
|
||||
case VULKAN_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD:
|
||||
if (!is_extension_available(devList[0],
|
||||
"cl_khr_external_semaphore_sync_fd"))
|
||||
{
|
||||
throw std::runtime_error(
|
||||
"Device does not support cl_khr_external_semaphore_sync_fd "
|
||||
"extension \n");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw std::runtime_error(
|
||||
"Unsupported external semaphore handle type\n");
|
||||
break;
|
||||
}
|
||||
#elif !defined(__APPLE__)
|
||||
if (!is_extension_available(devList[0],
|
||||
"cl_khr_external_semaphore_opaque_fd"))
|
||||
{
|
||||
throw std::runtime_error(
|
||||
"Device does not support cl_khr_external_semaphore_opaque_fd "
|
||||
"extension \n");
|
||||
}
|
||||
#endif
|
||||
|
||||
std::vector<cl_semaphore_properties_khr> sema_props{
|
||||
(cl_semaphore_properties_khr)CL_SEMAPHORE_TYPE_KHR,
|
||||
@@ -803,6 +824,16 @@ clExternalSemaphore::clExternalSemaphore(
|
||||
sema_props.push_back((cl_semaphore_properties_khr)handle);
|
||||
#endif
|
||||
break;
|
||||
case VULKAN_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD:
|
||||
err = check_external_semaphore_handle_type(
|
||||
devList[0], CL_SEMAPHORE_HANDLE_SYNC_FD_KHR);
|
||||
sema_props.push_back(static_cast<cl_semaphore_properties_khr>(
|
||||
CL_SEMAPHORE_EXPORT_HANDLE_TYPES_KHR));
|
||||
sema_props.push_back(static_cast<cl_semaphore_properties_khr>(
|
||||
CL_SEMAPHORE_HANDLE_SYNC_FD_KHR));
|
||||
sema_props.push_back(static_cast<cl_semaphore_properties_khr>(
|
||||
CL_SEMAPHORE_EXPORT_HANDLE_TYPES_LIST_END_KHR));
|
||||
break;
|
||||
default:
|
||||
ASSERT(0);
|
||||
log_error("Unsupported external memory handle type\n");
|
||||
|
||||
Reference in New Issue
Block a user