浏览代码

socl: check clGetExtensionFunctionAddressForPlatform is available

Nathalie Furmento 12 年之前
父节点
当前提交
01622c139c
共有 2 个文件被更改,包括 3 次插入1 次删除
  1. 1 0
      configure.ac
  2. 2 1
      socl/examples/basic/basic.c

+ 1 - 0
configure.ac

@@ -1400,6 +1400,7 @@ AM_CONDITIONAL([BUILD_SOCL], [test "x$build_socl" = "xyes"])
 AM_CONDITIONAL([STARPU_USE_SOCL], [test "x$build_socl" = "xyes"])
 
 if test "$build_socl" = "yes" ; then
+   AC_CHECK_FUNCS([clGetExtensionFunctionAddressForPlatform])
    if test -z "$SOCL_OCL_LIB_OPENCL" ; then
       run_socl_check=no
    else

+ 2 - 1
socl/examples/basic/basic.c

@@ -234,13 +234,14 @@ int main(int UNUSED(argc), char** UNUSED(argv)) {
    err = clReleaseContext(context);
    check(err, "clReleaseContext");
 
-
+#ifdef HAVE_CLGETEXTENSIONFUNCTIONADDRESSFORPLATFORM
    void (*clShutdown)(void) = clGetExtensionFunctionAddressForPlatform(platforms[platform_idx], "clShutdown");
 
    if (clShutdown != NULL) {
 	   printf("Calling clShutdown :)\n");
 	   clShutdown();
    }
+#endif
 
    return 0;
 }