[Beignet] [PATCH] Utests: use clGetExtensionFunctionAddressForPlatform

Rebecca N. Palmer rebecca_palmer at zoho.com
Sat Oct 8 13:26:05 UTC 2016


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




More information about the Beignet mailing list