Skip to content
Snippets Groups Projects
Commit 133721cc authored by fireice-uk's avatar fireice-uk Committed by GitHub
Browse files

Merge pull request #63 from psychocrypt/fix-selectWrongOpenCL

prefere AMD OpenCL over NVIDIA, Intel
parents 7030f1b3 227aee84
No related branches found
No related tags found
No related merge requests found
......@@ -180,6 +180,38 @@ list(APPEND CMAKE_PREFIX_PATH "$ENV{CMAKE_PREFIX_PATH}")
option(OpenCL_ENABLE "Enable or disable OpenCL spport (AMD GPU support)" ON)
if(OpenCL_ENABLE)
# try to find AMD OpenCL before NVIDIA OpenCL
find_path(OpenCL_INCLUDE_DIR
NAMES
CL/cl.h
OpenCL/cl.h
NO_DEFAULT_PATH
PATHS
ENV "OpenCL_ROOT"
ENV AMDAPPSDKROOT
ENV ATISTREAMSDKROOT
ENV "PROGRAMFILES(X86)"
PATH_SUFFIXES
include
OpenCL/common/inc
"AMD APP/include")
find_library(OpenCL_LIBRARY
NAMES
OpenCL
OpenCL.lib
NO_DEFAULT_PATH
PATHS
ENV "OpenCL_ROOT"
ENV AMDAPPSDKROOT
ENV ATISTREAMSDKROOT
ENV "PROGRAMFILES(X86)"
PATH_SUFFIXES
"AMD APP/lib/x86_64"
lib/x86_64
lib/x64
OpenCL/common/lib/x64)
# find package will use the previews searched path variables
find_package(OpenCL)
if(OpenCL_FOUND)
include_directories(SYSTEM ${OpenCL_INCLUDE_DIRS})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment