clGetExtensionFunctionAddressForPlatform(cl_platform_id platform,
const char * function_name) CL_API_SUFFIX__VERSION_1_2
{
+ KHR_ICD_VALIDATE_HANDLE_RETURN_ERROR(function_name, NULL);
+
// make sure the ICD is initialized
khrIcdInitialize();
/* cl_khr_sub_groups */
CL_COMMON_EXTENSION_ENTRYPOINT_ADD(clGetKernelSubGroupInfoKHR);
+ #undef CL_COMMON_EXTENSION_ENTRYPOINT_ADD
+
// This is not an ICD-aware extension, so call into the implementation
// to get the extension function address.
CL_API_ENTRY void * CL_API_CALL
clGetExtensionFunctionAddress(const char *function_name) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED
{
- size_t function_name_length = strlen(function_name);
+ size_t function_name_length = 0;
KHRicdVendor* vendor = NULL;
+ KHR_ICD_VALIDATE_HANDLE_RETURN_ERROR(function_name, NULL);
+
// make sure the ICD is initialized
khrIcdInitialize();
+ function_name_length = strlen(function_name);
// return any ICD-aware extensions
/* cl_khr_sub_groups */
CL_COMMON_EXTENSION_ENTRYPOINT_ADD(clGetKernelSubGroupInfoKHR);
+ #undef CL_COMMON_EXTENSION_ENTRYPOINT_ADD
+
// fall back to vendor extension detection
for (vendor = khrIcdVendors; vendor; vendor = vendor->next)
{