Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 28 additions & 15 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,7 @@ ac_includes_default="\
ac_header_cxx_list=
ac_subst_vars='LTLIBOBJS
LIBOBJS
OPENCL_TARGET_VERSION
SDKPATH
CUDA_HOME
CLBLAS_PREFIX
Expand Down Expand Up @@ -4581,6 +4582,9 @@ CLBLAS_PREFIX=""
CUDA_HOME=""
SDKPATH=""

## Use common current version on non-macOS systems
OPENCL_TARGET_VERSION=300

## =============================================================================
## OpenCL Detection
## =============================================================================
Expand Down Expand Up @@ -4668,6 +4672,10 @@ printf "%s\n" "$as_me: WARNING: You may need to install Xcode Command Line Tools
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Or use CUDA if you have an NVIDIA GPU" >&5
printf "%s\n" "$as_me: WARNING: Or use CUDA if you have an NVIDIA GPU" >&2;}
fi

## Use minimum version to match OpenCL on macOS
OPENCL_TARGET_VERSION=120

else
## Linux/Unix: Check for CL/opencl.h header
ac_header= ac_cache=
Expand Down Expand Up @@ -5254,22 +5262,24 @@ fi
printf "%s\n" "$as_me: " >&6;}
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: GPU Backend Configuration Summary:" >&5
printf "%s\n" "$as_me: GPU Backend Configuration Summary:" >&6;}
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: Platform: ${RSysinfoName}" >&5
printf "%s\n" "$as_me: Platform: ${RSysinfoName}" >&6;}
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: C++ Standard: C++14" >&5
printf "%s\n" "$as_me: C++ Standard: C++14" >&6;}
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: OpenCL: ${HAVE_OPENCL}" >&5
printf "%s\n" "$as_me: OpenCL: ${HAVE_OPENCL}" >&6;}
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: Platform: ${RSysinfoName}" >&5
printf "%s\n" "$as_me: Platform: ${RSysinfoName}" >&6;}
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: C++ Standard: C++14" >&5
printf "%s\n" "$as_me: C++ Standard: C++14" >&6;}
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: OpenCL: ${HAVE_OPENCL}" >&5
printf "%s\n" "$as_me: OpenCL: ${HAVE_OPENCL}" >&6;}
if test "x${HAVE_OPENCL}" = x1; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: CLBlast: ${HAVE_CLBLAST}" >&5
printf "%s\n" "$as_me: CLBlast: ${HAVE_CLBLAST}" >&6;}
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: clBLAS: ${HAVE_CLBLAS}" >&5
printf "%s\n" "$as_me: clBLAS: ${HAVE_CLBLAS}" >&6;}
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: CUDA: ${HAVE_CUDA}" >&5
printf "%s\n" "$as_me: CUDA: ${HAVE_CUDA}" >&6;}
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: Default: ${DEFAULT_BACKEND}" >&5
printf "%s\n" "$as_me: Default: ${DEFAULT_BACKEND}" >&6;}
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: CLBlast: ${HAVE_CLBLAST}" >&5
printf "%s\n" "$as_me: CLBlast: ${HAVE_CLBLAST}" >&6;}
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: clBLAS: ${HAVE_CLBLAS}" >&5
printf "%s\n" "$as_me: clBLAS: ${HAVE_CLBLAS}" >&6;}
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: OpenCL Target: ${OPENCL_TARGET_VERSION}" >&5
printf "%s\n" "$as_me: OpenCL Target: ${OPENCL_TARGET_VERSION}" >&6;}
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: CUDA: ${HAVE_CUDA}" >&5
printf "%s\n" "$as_me: CUDA: ${HAVE_CUDA}" >&6;}
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: Default: ${DEFAULT_BACKEND}" >&5
printf "%s\n" "$as_me: Default: ${DEFAULT_BACKEND}" >&6;}
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: " >&5
printf "%s\n" "$as_me: " >&6;}

Expand Down Expand Up @@ -5352,6 +5362,9 @@ BANDICOOT_LIBS="${BANDICOOT_LIBS} ${LAPACK_BLAS_LIBS}"



## OpenCL target version


ac_config_files="$ac_config_files src/Makevars R/flags.R"

cat >confcache <<\_ACEOF
Expand Down
25 changes: 18 additions & 7 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ CLBLAS_PREFIX=""
CUDA_HOME=""
SDKPATH=""

## Use common current version on non-macOS systems
OPENCL_TARGET_VERSION=300

## =============================================================================
## OpenCL Detection
## =============================================================================
Expand Down Expand Up @@ -157,6 +160,10 @@ if test x"${is_macos}" = x"yes"; then
AC_MSG_WARN([You may need to install Xcode Command Line Tools: xcode-select --install])
AC_MSG_WARN([Or use CUDA if you have an NVIDIA GPU])
fi

## Use minimum version to match OpenCL on macOS
OPENCL_TARGET_VERSION=120

else
## Linux/Unix: Check for CL/opencl.h header
AC_CHECK_HEADER([CL/opencl.h],
Expand Down Expand Up @@ -382,15 +389,16 @@ fi

AC_MSG_NOTICE([])
AC_MSG_NOTICE([GPU Backend Configuration Summary:])
AC_MSG_NOTICE([ Platform: ${RSysinfoName}])
AC_MSG_NOTICE([ C++ Standard: C++14])
AC_MSG_NOTICE([ OpenCL: ${HAVE_OPENCL}])
AC_MSG_NOTICE([ Platform: ${RSysinfoName}])
AC_MSG_NOTICE([ C++ Standard: C++14])
AC_MSG_NOTICE([ OpenCL: ${HAVE_OPENCL}])
if test "x${HAVE_OPENCL}" = x1; then
AC_MSG_NOTICE([ CLBlast: ${HAVE_CLBLAST}])
AC_MSG_NOTICE([ clBLAS: ${HAVE_CLBLAS}])
AC_MSG_NOTICE([ CLBlast: ${HAVE_CLBLAST}])
AC_MSG_NOTICE([ clBLAS: ${HAVE_CLBLAS}])
AC_MSG_NOTICE([ OpenCL Target: ${OPENCL_TARGET_VERSION}])
fi
AC_MSG_NOTICE([ CUDA: ${HAVE_CUDA}])
AC_MSG_NOTICE([ Default: ${DEFAULT_BACKEND}])
AC_MSG_NOTICE([ CUDA: ${HAVE_CUDA}])
AC_MSG_NOTICE([ Default: ${DEFAULT_BACKEND}])
AC_MSG_NOTICE([])

## =============================================================================
Expand Down Expand Up @@ -467,5 +475,8 @@ AC_SUBST([CLBLAS_PREFIX])
AC_SUBST([CUDA_HOME])
AC_SUBST([SDKPATH])

## OpenCL target version
AC_SUBST([OPENCL_TARGET_VERSION])

AC_CONFIG_FILES([src/Makevars R/flags.R])
AC_OUTPUT
2 changes: 1 addition & 1 deletion src/Makevars.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## This file is processed by configure to generate Makevars
## It includes GPU backend configuration (OpenCL, CUDA) and other settings

PKG_CPPFLAGS = -I../inst/include
PKG_CPPFLAGS = -I../inst/include -DCL_TARGET_OPENCL_VERSION=@OPENCL_TARGET_VERSION@

## Compiler flags from configure
PKG_CXXFLAGS = @BANDICOOT_CXXFLAGS@ @OPENMP_CXXFLAGS@
Expand Down