From 3f452e6d907cc2da3ae54e2971060f319d970f61 Mon Sep 17 00:00:00 2001 From: Ben Ashbaugh Date: Wed, 26 Jun 2024 11:51:35 -0700 Subject: [PATCH] remove removed external memory and semaphore extensions (#295) * add include guards around external memory handle types * remove removed external memory and semaphore extensions * fix one more leftover dx fence code snip --- include/CL/opencl.hpp | 29 +++++++++-------------------- tests/test_openclhpp.cpp | 20 -------------------- 2 files changed, 9 insertions(+), 40 deletions(-) diff --git a/include/CL/opencl.hpp b/include/CL/opencl.hpp index c71c0093..3427f3e0 100644 --- a/include/CL/opencl.hpp +++ b/include/CL/opencl.hpp @@ -1561,9 +1561,6 @@ inline cl_int getInfoHelper(Func f, cl_uint name, T* param, int, typename T::cl_ F(cl_device_info, CL_DEVICE_SEMAPHORE_EXPORT_HANDLE_TYPES_KHR, cl::vector) \ F(cl_semaphore_info_khr, CL_SEMAPHORE_EXPORT_HANDLE_TYPES_KHR, cl::vector) \ -#define CL_HPP_PARAM_NAME_CL_KHR_EXTERNAL_SEMAPHORE_DX_FENCE_EXT(F) \ - F(cl_external_semaphore_handle_type_khr, CL_SEMAPHORE_HANDLE_D3D12_FENCE_KHR, void*) \ - #define CL_HPP_PARAM_NAME_CL_KHR_EXTERNAL_SEMAPHORE_OPAQUE_FD_EXT(F) \ F(cl_external_semaphore_handle_type_khr, CL_SEMAPHORE_HANDLE_OPAQUE_FD_KHR, int) \ @@ -1700,9 +1697,6 @@ CL_HPP_PARAM_NAME_CL_KHR_EXTERNAL_MEMORY_(CL_HPP_DECLARE_PARAM_TRAITS_) CL_HPP_PARAM_NAME_CL_KHR_EXTERNAL_SEMAPHORE_(CL_HPP_DECLARE_PARAM_TRAITS_) #endif // cl_khr_external_semaphore -#if defined(cl_khr_external_semaphore_dx_fence) -CL_HPP_PARAM_NAME_CL_KHR_EXTERNAL_SEMAPHORE_DX_FENCE_EXT(CL_HPP_DECLARE_PARAM_TRAITS_) -#endif // cl_khr_external_semaphore_dx_fence #if defined(cl_khr_external_semaphore_opaque_fd) CL_HPP_PARAM_NAME_CL_KHR_EXTERNAL_SEMAPHORE_OPAQUE_FD_EXT(CL_HPP_DECLARE_PARAM_TRAITS_) #endif // cl_khr_external_semaphore_opaque_fd @@ -7190,20 +7184,18 @@ inline Kernel::Kernel(const Program& program, const char* name, cl_int* err) enum class ExternalMemoryType : cl_external_memory_handle_type_khr { None = 0, - +#ifdef cl_khr_external_memory_opaque_fd OpaqueFd = CL_EXTERNAL_MEMORY_HANDLE_OPAQUE_FD_KHR, +#endif // cl_khr_external_memory_opaque_fd +#ifdef cl_khr_external_memory_win32 OpaqueWin32 = CL_EXTERNAL_MEMORY_HANDLE_OPAQUE_WIN32_KHR, OpaqueWin32Kmt = CL_EXTERNAL_MEMORY_HANDLE_OPAQUE_WIN32_KMT_KHR, - - D3D11Texture = CL_EXTERNAL_MEMORY_HANDLE_D3D11_TEXTURE_KHR, - D3D11TextureKmt = CL_EXTERNAL_MEMORY_HANDLE_D3D11_TEXTURE_KMT_KHR, - - D3D12Heap = CL_EXTERNAL_MEMORY_HANDLE_D3D12_HEAP_KHR, - D3D12Resource = CL_EXTERNAL_MEMORY_HANDLE_D3D12_RESOURCE_KHR, - +#endif // cl_khr_external_memory_win32 +#ifdef cl_khr_external_memory_dma_buf DmaBuf = CL_EXTERNAL_MEMORY_HANDLE_DMA_BUF_KHR, +#endif // cl_khr_external_memory_dma_buf }; -#endif +#endif // cl_khr_external_memory enum class QueueProperties : cl_command_queue_properties { @@ -10906,15 +10898,12 @@ namespace compatibility { enum ExternalSemaphoreType : cl_external_semaphore_handle_type_khr { None = 0, -#ifdef cl_khr_external_semaphore_dx_fence - D3D12Fence = CL_SEMAPHORE_HANDLE_D3D12_FENCE_KHR, -#endif #ifdef cl_khr_external_semaphore_opaque_fd OpaqueFd = CL_SEMAPHORE_HANDLE_OPAQUE_FD_KHR, -#endif +#endif // cl_khr_external_semaphore_opaque_fd #ifdef cl_khr_external_semaphore_sync_fd SyncFd = CL_SEMAPHORE_HANDLE_SYNC_FD_KHR, -#endif +#endif // cl_khr_external_semaphore_sync_fd #ifdef cl_khr_external_semaphore_win32 OpaqueWin32 = CL_SEMAPHORE_HANDLE_OPAQUE_WIN32_KHR, OpaqueWin32Kmt = CL_SEMAPHORE_HANDLE_OPAQUE_WIN32_KMT_KHR, diff --git a/tests/test_openclhpp.cpp b/tests/test_openclhpp.cpp index 66e934bf..636dc098 100644 --- a/tests/test_openclhpp.cpp +++ b/tests/test_openclhpp.cpp @@ -4594,20 +4594,6 @@ static cl_int clGetSemaphoreHandleForTypeKHR_GetHandles( (void) num_calls; switch (handle_type) { -#if defined(cl_khr_external_semaphore_dx_fence) - case CL_SEMAPHORE_HANDLE_D3D12_FENCE_KHR: - { - void* ret = make_external_semaphore_handle(handle_type); - if (handle_size == sizeof(ret) && handle_ptr) { - void** pHandle = static_cast(handle_ptr); - *pHandle = ret; - } - if (handle_size_ret) { - *handle_size_ret = sizeof(ret); - } - return CL_SUCCESS; - } -#endif #if defined(cl_khr_external_semaphore_win32) case CL_SEMAPHORE_HANDLE_OPAQUE_WIN32_KHR: case CL_SEMAPHORE_HANDLE_OPAQUE_WIN32_KMT_KHR: @@ -4668,12 +4654,6 @@ void testTemplateGetSemaphoreHandleForTypeKHR(void) clGetSemaphoreHandleForTypeKHR_StubWithCallback(clGetSemaphoreHandleForTypeKHR_GetHandles); cl::Semaphore semaphore; -#if defined(cl_khr_external_semaphore_dx_fence) - { - auto handle0 = semaphore.getHandleForTypeKHR(device); - TEST_ASSERT_EQUAL(handle0, make_external_semaphore_handle(cl::ExternalSemaphoreType::D3D12Fence)); - } -#endif #if defined(cl_khr_external_semaphore_opaque_fd) { auto fd0 = semaphore.getHandleForTypeKHR(device);