-
Notifications
You must be signed in to change notification settings - Fork 94
Expand file tree
/
Copy pathFindOpenCLWrapper.cmake
More file actions
49 lines (46 loc) · 1.24 KB
/
FindOpenCLWrapper.cmake
File metadata and controls
49 lines (46 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
###############################################################################
# FIND module wrapper around finding OpenCL
# This Find module is also distributed alongside the occa package config file!
###############################################################################
# Try finding OpenCL. The user should set OpenCL_ROOT if needed.
find_package(OpenCL QUIET)
if(NOT OpenCL_FOUND)
# Otherwise, look for the headers and library in standard locations
find_path(OpenCL_INCLUDE_DIR
NAMES CL/cl.h OpenCL/cl.h
PATHS
ENV CUDA_PATH
ENV CUDAToolkit_ROOT
ENV ROCM_PATH
ENV NVHPC_ROOT
ENV SYCL_ROOT
/usr/local/cuda
/opt/rocm/opencl
/opt/intel/oneapi/compiler/latest/linux
PATH_SUFFIXES
include
include/sycl
)
find_library(OpenCL_LIBRARY
NAMES OpenCL libOpenCL
PATHS
ENV CUDA_PATH
ENV CUDAToolkit_ROOT
ENV ROCM_PATH
ENV NVHPC_ROOT
ENV SYCL_ROOT
/usr/local/cuda
/opt/rocm/opencl
/opt/intel/oneapi/compiler/latest/linux
PATH_SUFFIXES
lib
lib64
)
endif()
find_package(OpenCL)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
OpenCLWrapper
REQUIRED_VARS
OpenCL_FOUND
)