[Beignet] [PATCH] Utests: use clGetExtensionFunctionAddressForPlatform

Yang, Rong R rong.r.yang at intel.com
Mon Oct 10 13:22:50 UTC 2016


Because clGetExtensionFunctionAddressForPlatform is available from OpenCL 1.2, I think it is better to add the opencl version check, just as clCreateImageFromLibvaIntel in the utest runtime_climage_from_boname.cpp.
Anyway, it is a refinement so I have merged it.

> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> Rebecca N. Palmer
> Sent: Saturday, October 8, 2016 21:26
> To: beignet at lists.freedesktop.org
> Subject: [Beignet] [PATCH] Utests: use
> clGetExtensionFunctionAddressForPlatform
> 
> This is required to find KHR extensions via ICD, as the loader needs to know
> which ICD to send the request to.
> 
> If the function is not found, fail the test instead of crashing.
> ---
>  utests/utest_helper.cpp | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/utests/utest_helper.cpp b/utests/utest_helper.cpp index
> d12dccf..d3fc069 100644
> --- a/utests/utest_helper.cpp
> +++ b/utests/utest_helper.cpp
> @@ -891,7 +891,11 @@ int cl_check_subgroups(void)
>      return 0;
>    }
>    if(utestclGetKernelSubGroupInfoKHR == NULL)
> -    utestclGetKernelSubGroupInfoKHR  = (clGetKernelSubGroupInfoKHR_cb*)
> clGetExtensionFunctionAddress("clGetKernelSubGroupInfoKHR");
> +    utestclGetKernelSubGroupInfoKHR  =
> (clGetKernelSubGroupInfoKHR_cb*)
> +
> clGetExtensionFunctionAddressForPlatform(platform,"clGetKernelSubGroup
> + InfoKHR");  if(utestclGetKernelSubGroupInfoKHR == NULL) {
> +    printf("Can't find clGetKernelSubGroupInfoKHR");
> +    OCL_ASSERT(0);
> +  }
>    return 1;
>  }
> 
> --
> 2.1.4
> 
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list