Skip to content
This repository was archived by the owner on Jan 26, 2024. It is now read-only.

Fix search for OpenCL include dirs #16

Open
wants to merge 1 commit into
base: roc-3.6.x
Choose a base branch
from
Open
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
26 changes: 9 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,26 +53,18 @@ find_package(amd_comgr REQUIRED CONFIG
)
message(STATUS "Code Object Manager found at ${amd_comgr_DIR}.")

# FIXME: Use find_package(OpenCL)
find_library( OpenCL REQUIRED CONFIG
PATHS
/opt/rocm
find_path(OPENCL_INCLUDE_DIR
NAMES OpenCL/cl.h CL/cl.h
PATH_SUFFIXES include opencl/include inc include/x86_64 include/x64
PATHS ${OPENCL_DIR}
DOC "OpenCL include header OpenCL/cl.h or CL/cl.h"
)

if( NOT OPENCL_DIR )
find_path(OPENCL_INCLUDE_DIR
NAMES OpenCL/cl.h CL/cl.h
PATH_SUFFIXES include opencl/include inc include/x86_64 include/x64
PATHS /opt/rocm
DOC "OpenCL include header OpenCL/cl.h or CL/cl.h"
)

if( NOT OPENCL_INCLUDE_DIR )
unset(OPENCL_INCLUDE_DIR CACHE)
set(OPENCL_INCLUDE_DIR "" CACHE PATH "" FORCE )
endif()
message(STATUS "Opencl found at ${OPENCL_INCLUDE_DIR}.")
if( NOT OPENCL_INCLUDE_DIR )
unset(OPENCL_INCLUDE_DIR CACHE)
set(OPENCL_INCLUDE_DIR "" CACHE PATH "" FORCE )
endif()
message(STATUS "Opencl found at ${OPENCL_INCLUDE_DIR}.")



Expand Down