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,"clGetKernelSubGroupInfoKHR");
+  if(utestclGetKernelSubGroupInfoKHR == NULL) {
+    printf("Can't find clGetKernelSubGroupInfoKHR");
+    OCL_ASSERT(0);
+  }
   return 1;
 }
 
-- 
2.1.4


_______________________________________________
Beignet mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/beignet

Reply via email to