summaryrefslogtreecommitdiff
blob: fc9bacee50200166ad97276115f1b6afad3df5d1 (plain)
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
From 98df37fc36b6276c26532e86e89be7e389745f4e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Torsten=20Ke=C3=9Fler?= <t.kessler@posteo.de>
Date: Sun, 19 Jul 2020 11:58:24 +0200
Subject: [PATCH] Fix search for OpenCL include dirs

---
 CMakeLists.txt | 26 +++++++++-----------------
 1 file changed, 9 insertions(+), 17 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 122277ee..02ca4644 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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}.")