From ab72b1ba072d6cbf4bd24801f62a6ab479be0d37 Mon Sep 17 00:00:00 2001 From: Ben Ashbaugh Date: Wed, 13 May 2026 17:03:17 -0700 Subject: [PATCH] remove use of the cl_khr_icd2.h header --- include/cl_khr_icd2.h | 51 +-------------------------------------- test/driver_stub/cl.c | 6 +---- test/driver_stub/cl_ext.c | 10 ++------ test/driver_stub/icd.c | 20 +++------------ 4 files changed, 7 insertions(+), 80 deletions(-) diff --git a/include/cl_khr_icd2.h b/include/cl_khr_icd2.h index 6a9a78a8..2cd71da9 100644 --- a/include/cl_khr_icd2.h +++ b/include/cl_khr_icd2.h @@ -16,53 +16,4 @@ * OpenCL is a trademark of Apple Inc. used under license by Khronos. */ -#include - -#if !defined(CL_PLATFORM_UNLOADABLE_KHR) -#define CL_PLATFORM_UNLOADABLE_KHR 0x0921 -#endif - -#if defined(CL_ENABLE_LAYERS) && !defined(CL_LAYER_PROPERTIES_LIST_END) -typedef cl_properties cl_layer_properties; - -#define CL_LAYER_PROPERTIES_LIST_END ((cl_layer_properties)0) - -typedef cl_int CL_API_CALL -clInitLayerWithProperties_t( - cl_uint num_entries, - const cl_icd_dispatch *target_dispatch, - cl_uint *num_entries_ret, - const cl_icd_dispatch **layer_dispatch_ret, - const cl_layer_properties *properties); - -typedef clInitLayerWithProperties_t *pfn_clInitLayerWithProperties; - -typedef cl_int CL_API_CALL -clDeinitLayer_t(void); - -typedef clDeinitLayer_t *pfn_clDeinitLayer; -#endif //defined(CL_ENABLE_LAYERS) && !defined(CL_LAYER_PROPERTIES_LIST_END) - -#if !defined(CL_ICD2_TAG_KHR) -#if INTPTR_MAX == INT32_MAX -#define CL_ICD2_TAG_KHR ((intptr_t)0x434C3331) -#else -#define CL_ICD2_TAG_KHR ((intptr_t)0x4F50454E434C3331) -#endif - -typedef void * CL_API_CALL -clIcdGetFunctionAddressForPlatformKHR_t( - cl_platform_id platform, - const char* func_name); - -typedef clIcdGetFunctionAddressForPlatformKHR_t * -clIcdGetFunctionAddressForPlatformKHR_fn; - -typedef cl_int CL_API_CALL -clIcdSetPlatformDispatchDataKHR_t( - cl_platform_id platform, - void *disp_data); - -typedef clIcdSetPlatformDispatchDataKHR_t * -clIcdSetPlatformDispatchDataKHR_fn; -#endif // !defined(CL_ICD2_TAG_KHR) +/* This is intentionally empty and left as a placeholder. */ diff --git a/test/driver_stub/cl.c b/test/driver_stub/cl.c index 9b615a59..5da62089 100644 --- a/test/driver_stub/cl.c +++ b/test/driver_stub/cl.c @@ -15,13 +15,9 @@ #include "rename_api.h" #include +#include #include #include "icd_structs.h" -#include "cl_khr_icd2.h" - -#define CL_PLATFORM_ICD_SUFFIX_KHR 0x0920 -CL_API_ENTRY cl_int CL_API_CALL -clIcdGetPlatformIDsKHR(cl_uint, cl_platform_id *, cl_uint *); struct _cl_platform_id { diff --git a/test/driver_stub/cl_ext.c b/test/driver_stub/cl_ext.c index b412f934..5f574e05 100644 --- a/test/driver_stub/cl_ext.c +++ b/test/driver_stub/cl_ext.c @@ -1,14 +1,8 @@ #include #define CL_USE_DEPRECATED_OPENCL_1_1_APIS -#include "CL/cl.h" -#include "CL/cl_ext.h" -#include "cl_khr_icd2.h" - -#if defined(CL_ENABLE_ICD2) -CL_API_ENTRY clIcdGetFunctionAddressForPlatformKHR_t clIcdGetFunctionAddressForPlatformKHR; -CL_API_ENTRY clIcdSetPlatformDispatchDataKHR_t clIcdSetPlatformDispatchDataKHR; -#endif +#include +#include struct driverStubextFunc_st { diff --git a/test/driver_stub/icd.c b/test/driver_stub/icd.c index 116efde6..397c182e 100644 --- a/test/driver_stub/icd.c +++ b/test/driver_stub/icd.c @@ -15,23 +15,9 @@ // themselves via the dispatch table. Include this before cl headers. #include "rename_api.h" -#include "CL/cl.h" -#include "CL/cl_gl.h" - -#if defined(CL_ENABLE_ICD2) -#include "cl_khr_icd2.h" -CL_API_ENTRY clIcdGetFunctionAddressForPlatformKHR_t clIcdGetFunctionAddressForPlatformKHR; -CL_API_ENTRY clIcdSetPlatformDispatchDataKHR_t clIcdSetPlatformDispatchDataKHR; -#endif - -/* - * Prototypes for deprecated functions no longer present in cl.h - */ -extern CL_API_ENTRY cl_int CL_API_CALL -clSetCommandQueueProperty(cl_command_queue /* command_queue */, - cl_command_queue_properties /* properties */, - cl_bool /* enable */, - cl_command_queue_properties * /* old_properties */); +#include +#include +#include #define ICD_DISPATCH_TABLE_ENTRY(fn) \ assert(dispatchTable->entryCount < 256); \