From a54079dc4ed63663dc919dbcab569169fe29d4d0 Mon Sep 17 00:00:00 2001 From: Wolf Date: Tue, 7 Apr 2015 09:18:36 -0500 Subject: [PATCH] Added build-time check for OpenCL 2.0, which may be used to check if SGMiner was linked against APP SDK 3.0 Beta or later. Note that the runtime platform driver AND the OpenCL device must also support OpenCL 2.0 - a build-time check alone is not sufficient - but this allows implementation of OpenCL 2.0 features without forcing all users to link against the (currently) relatively new APP SDK 3.0 Beta. You MUST REGENERATE THE BUILD SCRIPTS AFTER MERGING. --- configure.ac | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/configure.ac b/configure.ac index 09cfef876..764031ecb 100644 --- a/configure.ac +++ b/configure.ac @@ -156,6 +156,20 @@ AC_LINK_IFELSE( OPENCL_FLAGS= OPENCL_LIBS= found_opencl=0]) + +if test "$found_opencl" = 1; then +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + #ifdef __APPLE_CC__ + #include + #else + #include + #endif +]], +[[return clCreateCommandQueueWithProperties(NULL, NULL, NULL, NULL); ]])], +[AC_DEFINE([HAS_OCL2], [1], [OpenCL library supports version 2.0 or later])], +[]) +fi + LIBS=$SAVED_LIBS CFLAGS=$SAVED_CFLAGS