mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-25 16:29:03 +00:00
Clean up cl_khr_external_semaphore_dx_fence test (#2580)
Removes the duplicated code from the tests. Improves the Base test class.
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include "harness/deviceInfo.h"
|
||||
#include "harness/testHarness.h"
|
||||
#include "harness/typeWrappers.h"
|
||||
#include "harness/extensionHelpers.h"
|
||||
|
||||
struct SemaphoreBase
|
||||
{
|
||||
@@ -37,27 +38,15 @@ struct SemaphoreBase
|
||||
test_error(error, "clGetDeviceInfo for CL_DEVICE_PLATFORM failed");
|
||||
|
||||
// If it is supported get the addresses of all the APIs here.
|
||||
// clang-format off
|
||||
#define GET_EXTENSION_ADDRESS(FUNC) \
|
||||
FUNC = reinterpret_cast<FUNC##_fn>( \
|
||||
clGetExtensionFunctionAddressForPlatform(platform, #FUNC)); \
|
||||
if (FUNC == nullptr) \
|
||||
{ \
|
||||
log_error("ERROR: clGetExtensionFunctionAddressForPlatform failed" \
|
||||
" with " #FUNC "\n"); \
|
||||
return TEST_FAIL; \
|
||||
}
|
||||
// clang-format on
|
||||
GET_FUNCTION_EXTENSION_ADDRESS(device,
|
||||
clCreateSemaphoreWithPropertiesKHR);
|
||||
GET_FUNCTION_EXTENSION_ADDRESS(device, clEnqueueSignalSemaphoresKHR);
|
||||
GET_FUNCTION_EXTENSION_ADDRESS(device, clEnqueueWaitSemaphoresKHR);
|
||||
GET_FUNCTION_EXTENSION_ADDRESS(device, clReleaseSemaphoreKHR);
|
||||
GET_FUNCTION_EXTENSION_ADDRESS(device, clGetSemaphoreInfoKHR);
|
||||
GET_FUNCTION_EXTENSION_ADDRESS(device, clRetainSemaphoreKHR);
|
||||
GET_FUNCTION_EXTENSION_ADDRESS(device, clGetSemaphoreHandleForTypeKHR);
|
||||
|
||||
GET_EXTENSION_ADDRESS(clCreateSemaphoreWithPropertiesKHR);
|
||||
GET_EXTENSION_ADDRESS(clEnqueueSignalSemaphoresKHR);
|
||||
GET_EXTENSION_ADDRESS(clEnqueueWaitSemaphoresKHR);
|
||||
GET_EXTENSION_ADDRESS(clReleaseSemaphoreKHR);
|
||||
GET_EXTENSION_ADDRESS(clGetSemaphoreInfoKHR);
|
||||
GET_EXTENSION_ADDRESS(clRetainSemaphoreKHR);
|
||||
GET_EXTENSION_ADDRESS(clGetSemaphoreHandleForTypeKHR);
|
||||
|
||||
#undef GET_EXTENSION_ADDRESS
|
||||
return CL_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user