Gentoo Archives: gentoo-commits

From: Craig Andrews <candrews@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/rocm-opencl-runtime/files/
Date: Thu, 02 Jan 2020 12:59:07
Message-Id: 1577969887.21411d61ef5f01ab8a3fa6a1623636a952c51413.candrews@gentoo
1 commit: 21411d61ef5f01ab8a3fa6a1623636a952c51413
2 Author: Craig Andrews <candrews <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jan 2 12:58:07 2020 +0000
4 Commit: Craig Andrews <candrews <AT> gentoo <DOT> org>
5 CommitDate: Thu Jan 2 12:58:07 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=21411d61
7
8 dev-libs/rocm-opencl-runtime: Remove unused patches
9
10 Package-Manager: Portage-2.3.84, Repoman-2.3.20
11 Signed-off-by: Craig Andrews <candrews <AT> gentoo.org>
12
13 ...pencl-runtime-2.6.0-unbundle-dependencies.patch | 1233 --------------------
14 ...ncl-runtime-2.8.0-change-install-location.patch | 146 ---
15 2 files changed, 1379 deletions(-)
16
17 diff --git a/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.6.0-unbundle-dependencies.patch b/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.6.0-unbundle-dependencies.patch
18 deleted file mode 100644
19 index 379dd11e9f9..00000000000
20 --- a/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.6.0-unbundle-dependencies.patch
21 +++ /dev/null
22 @@ -1,1233 +0,0 @@
23 -diff --git a/CMakeLists.txt b/CMakeLists.txt
24 -index ebdfc25..fb1c3eb 100644
25 ---- a/CMakeLists.txt
26 -+++ b/CMakeLists.txt
27 -@@ -21,6 +21,8 @@ endif()
28 -
29 - project(OpenCL-ROCm)
30 -
31 -+include (GNUInstallDirs)
32 -+
33 - # Add path for custom modules
34 - set(CMAKE_MODULE_PATH
35 - ${CMAKE_MODULE_PATH}
36 -@@ -38,38 +40,28 @@ set(CLANG_ENABLE_STATIC_ANALYZER OFF CACHE BOOL "")
37 - # override default option value in library and driver
38 - set(GENERIC_IS_ZERO ON CACHE BOOL ON FORCE)
39 -
40 --add_subdirectory(compiler/llvm EXCLUDE_FROM_ALL)
41 --
42 --find_package(LLVM REQUIRED CONFIG PATHS ${CMAKE_BINARY_DIR}/compiler/llvm NO_DEFAULT_PATH)
43 -+find_package(LLVM REQUIRED CONFIG PATHS ${LLVM_DIR} "/opt/rocm/llvm" NO_DEFAULT_PATH)
44 -
45 - list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
46 - include(AddLLVM)
47 -
48 - add_definitions(${LLVM_DEFINITIONS})
49 --# TODO: add find_package for Clang and lld, and also use LLVM/Clang variables got from their config
50 --include_directories(${CMAKE_SOURCE_DIR}/compiler/llvm/tools/clang/include)
51 --include_directories(${CMAKE_BINARY_DIR}/compiler/llvm/tools/clang/include)
52 --include_directories(${CMAKE_SOURCE_DIR}/compiler/llvm/tools/lld/include)
53 --
54 --# TODO: move AMDGPU.h header to include folder
55 --include_directories(${CMAKE_SOURCE_DIR}/compiler/llvm/lib/Target/AMDGPU)
56 --include_directories(${CMAKE_BINARY_DIR}/compiler/llvm/lib/Target/AMDGPU)
57 --
58 --if(${USE_COMGR_LIBRARY} MATCHES "yes")
59 -- set(COMGR_DYN_DLL "yes")
60 -- add_definitions(-DCOMGR_DYN_DLL="yes")
61 -- include_directories(${CMAKE_SOURCE_DIR}/compiler/llvm/include)
62 -- add_definitions(-DUSE_COMGR_LIBRARY)
63 --else()
64 -- add_subdirectory(compiler/driver EXCLUDE_FROM_ALL)
65 --endif()
66 -+set(USE_COMGR_LIBRARY "yes")
67 -+find_package(amd_comgr REQUIRED CONFIG)
68 -+add_definitions(-DUSE_COMGR_LIBRARY)
69 -+FOREACH(DIR ${LLVM_INCLUDE_DIRS})
70 -+ include_directories("${DIR}")
71 -+ include_directories("${DIR}/clang")
72 -+ include_directories("${DIR}/lld")
73 -+ # TODO: move AMDGPU.h header to include folder
74 -+ include_directories("${DIR}/llvm/Target/AMDGPU")
75 -+ENDFOREACH()
76 -
77 - set(BUILD_HC_LIB OFF CACHE BOOL "")
78 - set(ROCM_DEVICELIB_INCLUDE_TESTS OFF CACHE BOOL "")
79 - set(AMDGCN_TARGETS_LIB_LIST "AMDGCN_LIB_TARGETS")
80 - set(AMDGCN_TARGETS_LIB_DEPS "AMDGCN_DEP_TARGETS")
81 - set(AMDGPU_TARGET_TRIPLE "amdgcn-amd-amdhsa-amdgizcl")
82 --add_subdirectory(library/amdgcn EXCLUDE_FROM_ALL)
83 -
84 - add_subdirectory(compiler/lib/loaders/elf/utils/libelf)
85 -
86 -@@ -82,28 +74,6 @@ set(OPENCL_INCLUDE_DIRS
87 - ${CMAKE_SOURCE_DIR}/api/opencl/khronos/headers/opencl2.2)
88 -
89 - add_subdirectory(api/opencl/amdocl)
90 --add_subdirectory(api/opencl/khronos/icd)
91 --
92 --add_subdirectory(tools/clinfo)
93 --
94 --install(PROGRAMS $<TARGET_FILE:clang> $<TARGET_FILE:lld>
95 -- DESTINATION bin/x86_64
96 -- COMPONENT libraries)
97 --
98 --install(PROGRAMS $<TARGET_FILE:OpenCL>
99 -- DESTINATION lib/x86_64
100 -- COMPONENT applications)
101 --
102 --install(PROGRAMS $<TARGET_LINKER_FILE:OpenCL>
103 -- DESTINATION lib/x86_64
104 -- COMPONENT libraries)
105 --
106 --install(DIRECTORY
107 -- "${CMAKE_CURRENT_SOURCE_DIR}/api/opencl/khronos/headers/opencl2.2/CL"
108 -- DESTINATION include
109 -- COMPONENT libraries
110 -- USE_SOURCE_PERMISSIONS
111 -- PATTERN cl_egl.h EXCLUDE)
112 -
113 - foreach(AMDGCN_LIB_TARGET ${AMDGCN_LIB_TARGETS})
114 - get_target_property(lib_file_name ${AMDGCN_LIB_TARGET} ARCHIVE_OUTPUT_NAME)
115 -diff --git a/README.md b/README.md
116 -index a834965..e319be2 100644
117 ---- a/README.md
118 -+++ b/README.md
119 -@@ -7,13 +7,6 @@ Developer preview Version 2 of the new
120 - * Supports offline ahead of time compilation today; during the Beta phase we will add in-process/in-memory compilation.
121 -
122 -
123 --## GETTING REPO
124 --
125 --Repo is a git wrapper that manages a collection of git repositories. Install this tool and add it to the command search PATH:
126 --
127 -- curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
128 -- chmod a+x ~/bin/repo
129 --
130 - ## GETTING THE SOURCE CODE
131 -
132 - Main OpenCLâ„¢ Compatible Components:
133 -@@ -26,11 +19,6 @@ Main OpenCLâ„¢ Compatible Components:
134 - * https://github.com/RadeonOpenCompute/lld
135 - * https://github.com/KhronosGroup/OpenCL-ICD-Loader
136 -
137 --Download the git projects with the following commands:
138 --
139 -- ~/bin/repo init -u https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime.git -b master -m opencl.xml
140 -- ~/bin/repo sync
141 --
142 - ## INSTALL ROCm
143 -
144 - Follow the instructions at https://rocm.github.io/install.html to install ROCm.
145 -@@ -45,6 +33,11 @@ Copy the amdocl64.icd file to /etc/OpenCL/vendors
146 -
147 - To install additional dependencies:
148 -
149 -+* ROCm-OpenCL-Runtime
150 -+* ROCm-OpenCL-Driver
151 -+* ROC versions of LLVM, Clang, and lld
152 -+* ROCm-Device-Libs
153 -+* OpenCL-ICD-Loader
154 - * OCaml
155 - * findlib
156 - * A Python 2 environment or active virtualenv with the Microsoft Z3 package
157 -diff --git a/api/opencl/amdocl/CMakeLists.txt b/api/opencl/amdocl/CMakeLists.txt
158 -index 91bd42f..8606c98 100644
159 ---- a/api/opencl/amdocl/CMakeLists.txt
160 -+++ b/api/opencl/amdocl/CMakeLists.txt
161 -@@ -21,7 +21,6 @@ include_directories(${CMAKE_SOURCE_DIR}/api/opencl)
162 - include_directories(${CMAKE_SOURCE_DIR}/api/opencl/khronos)
163 - include_directories(${CMAKE_SOURCE_DIR}/api/opencl/khronos/headers)
164 - include_directories(${CMAKE_SOURCE_DIR}/api/opencl/khronos/headers/opencl2.2)
165 --include_directories(${CMAKE_SOURCE_DIR}/compiler/driver/src)
166 - include_directories(${CMAKE_SOURCE_DIR}/compiler/lib)
167 - include_directories(${CMAKE_SOURCE_DIR}/compiler/lib/include)
168 - include_directories(${CMAKE_SOURCE_DIR}/compiler/lib/backends/common)
169 -@@ -67,6 +66,9 @@ add_library(amdocl64 SHARED
170 - ${ADDITIONAL_LIBRARIES}
171 - )
172 -
173 --target_link_libraries(amdocl64 opencl_driver oclelf pthread dl ${ROCR_LIBRARIES})
174 -+target_link_libraries(amdocl64 opencl_driver oclelf pthread dl ${ROCR_LIBRARIES} LLVMBitWriter LLVMIRReader LLVMLinker LLVMMCParser amd_comgr)
175 -
176 --install(TARGETS amdocl64 LIBRARY DESTINATION lib/x86_64 COMPONENT applications)
177 -+install(TARGETS amdocl64 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT applications)
178 -+
179 -+file(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/amdocl64.icd" CONTENT "$<TARGET_FILE_NAME:amdocl64>")
180 -+install(FILES "${CMAKE_BINARY_DIR}/amdocl64.icd" DESTINATION "${CMAKE_INSTALL_FULL_SYSCONFDIR}/OpenCL/vendors/")
181 -diff --git a/api/opencl/amdocl/cl_execute.cpp b/api/opencl/amdocl/cl_execute.cpp
182 -index 0336353..ee799e6 100644
183 ---- a/api/opencl/amdocl/cl_execute.cpp
184 -+++ b/api/opencl/amdocl/cl_execute.cpp
185 -@@ -10,7 +10,7 @@
186 - #include "platform/program.hpp"
187 - #include "os/os.hpp"
188 -
189 --#include <icd/icd_dispatch.h>
190 -+#include <icd/loader/icd_dispatch.h>
191 -
192 - /*! \addtogroup API
193 - * @{
194 -diff --git a/api/opencl/amdocl/cl_icd.cpp b/api/opencl/amdocl/cl_icd.cpp
195 -index 71b886c..7e4e317 100644
196 ---- a/api/opencl/amdocl/cl_icd.cpp
197 -+++ b/api/opencl/amdocl/cl_icd.cpp
198 -@@ -10,7 +10,7 @@
199 - #include "cl_d3d11_amd.hpp"
200 - #endif //_WIN32
201 -
202 --#include <icd/icd_dispatch.h>
203 -+#include <icd/loader/icd_dispatch.h>
204 -
205 - #include <mutex>
206 -
207 -diff --git a/opencl.xml b/opencl.xml
208 -deleted file mode 100644
209 -index 4813651..0000000
210 ---- a/opencl.xml
211 -+++ /dev/null
212 -@@ -1,17 +0,0 @@
213 --<?xml version="1.0" encoding="UTF-8"?>
214 --<manifest>
215 -- <remote name="RadeonOpenCompute" fetch="https://github.com/RadeonOpenCompute/"/>
216 -- <remote name="KhronosGroup" fetch="https://github.com/KhronosGroup/"/>
217 --
218 -- <default remote="RadeonOpenCompute" revision="refs/tags/roc-2.6.0" sync-c="true" sync-j="4"/>
219 --
220 -- <project path="opencl" name="ROCm-OpenCL-Runtime"/>
221 -- <project path="opencl/compiler/driver" name="ROCm-OpenCL-Driver"/>
222 -- <project path="opencl/compiler/llvm" name="llvm" revision="refs/tags/roc-ocl-2.6.0"/>
223 -- <project path="opencl/compiler/llvm/tools/clang" name="clang"/>
224 -- <project path="opencl/compiler/llvm/tools/lld" name="lld" revision="refs/tags/roc-ocl-2.6.0"/>
225 --
226 -- <project path="opencl/library/amdgcn" name="ROCm-Device-Libs" revision="refs/tags/roc-ocl-2.6.0"/>
227 --
228 -- <project path="opencl/api/opencl/khronos/icd" name="OpenCL-ICD-Loader" remote="KhronosGroup" revision="7433f2acbf5bbc400f26494ff1dc895da6265bef"/>
229 --</manifest>
230 -diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt
231 -index 62e2bf7..5e4abae 100644
232 ---- a/runtime/CMakeLists.txt
233 -+++ b/runtime/CMakeLists.txt
234 -@@ -14,8 +14,6 @@ include_directories(${CMAKE_SOURCE_DIR}/api/opencl)
235 - include_directories(${CMAKE_SOURCE_DIR}/api/opencl/khronos)
236 - include_directories(${CMAKE_SOURCE_DIR}/api/opencl/khronos/headers)
237 - include_directories(${CMAKE_SOURCE_DIR}/api/opencl/khronos/headers/opencl2.2)
238 --include_directories(${CMAKE_SOURCE_DIR}/compiler/llvm/include)
239 --include_directories(${CMAKE_SOURCE_DIR}/compiler/driver/src)
240 - include_directories(${CMAKE_SOURCE_DIR}/compiler/lib)
241 - include_directories(${CMAKE_SOURCE_DIR}/compiler/lib/include)
242 - include_directories(${CMAKE_SOURCE_DIR}/compiler/lib/backends/common)
243 -@@ -36,6 +34,7 @@ add_library(oclruntime OBJECT
244 - utils/flags.cpp
245 - utils/debug.cpp
246 - device/appprofile.cpp
247 -+ device/comgrctx.cpp
248 - device/device.cpp
249 - device/hwdebug.cpp
250 - device/blitcl.cpp
251 -@@ -63,6 +62,8 @@ add_library(oclruntime OBJECT
252 - ${CMAKE_SOURCE_DIR}/compiler/tools/caching/cache.cpp
253 - )
254 - set_target_properties(oclruntime PROPERTIES POSITION_INDEPENDENT_CODE ON)
255 -+add_dependencies(oclruntime opencl1.2-c.amdgcn.inc_target)
256 -+add_dependencies(oclruntime opencl2.0-c.amdgcn.inc_target)
257 -
258 - set(AMDGCN_DEP_LIST)
259 - if(AMDGCN_TARGETS_LIB_DEPS)
260 -diff --git a/runtime/device/device.hpp b/runtime/device/device.hpp
261 -index 450cd69..8134fa2 100644
262 ---- a/runtime/device/device.hpp
263 -+++ b/runtime/device/device.hpp
264 -@@ -21,7 +21,7 @@
265 -
266 - #if defined(WITH_LIGHTNING_COMPILER) && !defined(USE_COMGR_LIBRARY)
267 - #include "caching/cache.hpp"
268 --#include "driver/AmdCompiler.h"
269 -+#include "AmdCompiler.h"
270 - #endif // defined(WITH_LIGHTNING_COMPILER) && ! defined(USE_COMGR_LIBRARY)
271 - #include "acl.h"
272 -
273 -diff --git a/runtime/device/devprogram.cpp b/runtime/device/devprogram.cpp
274 -index 22fb125..3d475b2 100644
275 ---- a/runtime/device/devprogram.cpp
276 -+++ b/runtime/device/devprogram.cpp
277 -@@ -14,7 +14,7 @@
278 -
279 - #if defined(WITH_LIGHTNING_COMPILER) || defined(USE_COMGR_LIBRARY)
280 - #ifndef USE_COMGR_LIBRARY
281 --#include "driver/AmdCompiler.h"
282 -+#include "AmdCompiler.h"
283 - #include "libraries.amdgcn.inc"
284 - #include "opencl1.2-c.amdgcn.inc"
285 - #include "opencl2.0-c.amdgcn.inc"
286 -diff --git a/runtime/device/devprogram.hpp b/runtime/device/devprogram.hpp
287 -index 67af239..8390e7d 100644
288 ---- a/runtime/device/devprogram.hpp
289 -+++ b/runtime/device/devprogram.hpp
290 -@@ -11,7 +11,7 @@
291 -
292 - #if defined(WITH_LIGHTNING_COMPILER) || defined(USE_COMGR_LIBRARY)
293 - #ifndef USE_COMGR_LIBRARY
294 --#include "driver/AmdCompiler.h"
295 -+#include "AmdCompiler.h"
296 - #else
297 - #include "amd_comgr.h"
298 - #endif
299 -diff --git a/runtime/device/rocm/CMakeLists.txt b/runtime/device/rocm/CMakeLists.txt
300 -index 4ce7c45..617bece 100644
301 ---- a/runtime/device/rocm/CMakeLists.txt
302 -+++ b/runtime/device/rocm/CMakeLists.txt
303 -@@ -1,3 +1,21 @@
304 -+find_package(Clang REQUIRED CONFIG)
305 -+
306 -+# FIXME: CLANG_CMAKE_DIR seems like the most stable way to find this, but
307 -+# really there is no way to reliably discover this header.
308 -+#
309 -+# We effectively back up to the Clang output directory (for the case of a build
310 -+# tree) or install prefix (for the case of an installed copy), and then search
311 -+# for a file named opencl-c.h anywhere below that. We take the first result in
312 -+# the case where there are multiple (e.g. if there is an installed copy nested
313 -+# in a build directory). This is a bit imprecise, but it covers cases like MSVC
314 -+# adding some additional configuration-specific subdirectories to the build
315 -+# tree but not to an installed copy.
316 -+file(GLOB_RECURSE OPENCL_C_H_LIST "${CLANG_CMAKE_DIR}/../../../*/opencl-c.h")
317 -+list(GET OPENCL_C_H_LIST 0 OPENCL_C_H)
318 -+if (NOT EXISTS "${OPENCL_C_H}" OR IS_DIRECTORY "${OPENCL_C_H}")
319 -+ message(FATAL_ERROR "Unable to locate opencl-c.h from the supplied Clang. The path '${CLANG_CMAKE_DIR}/../../../*' was searched.")
320 -+endif()
321 -+
322 - include(bc2h)
323 -
324 - set(INC_SUFFIX "amdgcn.inc")
325 -@@ -74,8 +92,8 @@ endforeach()
326 -
327 - # generating opencl*.inc files
328 - add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/opencl1.2-c.amdgcn.pch
329 -- COMMAND clang -cc1 -x cl-header -triple amdgcn-amd-amdhsa -Werror -O3 -DNDEBUG -cl-std=CL1.2 -emit-pch -o ${CMAKE_CURRENT_BINARY_DIR}/opencl1.2-c.amdgcn.pch < ${CMAKE_SOURCE_DIR}/compiler/llvm/tools/clang/lib/Headers/opencl-c.h
330 -- DEPENDS clang ${CMAKE_SOURCE_DIR}/compiler/llvm/tools/clang/lib/Headers/opencl-c.h
331 -+ COMMAND clang -cc1 -x cl-header -triple amdgcn-amd-amdhsa -Werror -O3 -DNDEBUG -cl-std=CL1.2 -emit-pch -o ${CMAKE_CURRENT_BINARY_DIR}/opencl1.2-c.amdgcn.pch < ${OPENCL_C_H}
332 -+ DEPENDS clang ${OPENCL_C_H}
333 - COMMENT "Generating opencl1.2-c.amdgcn.pch"
334 - )
335 - add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/opencl1.2-c.amdgcn.inc
336 -@@ -88,8 +106,8 @@ add_custom_target(opencl1.2-c.amdgcn.inc_target ALL DEPENDS ${CMAKE_CURRENT_BINA
337 - add_dependencies(oclrocm opencl1.2-c.amdgcn.inc_target)
338 -
339 - add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/opencl2.0-c.amdgcn.pch
340 -- COMMAND clang -cc1 -x cl-header -triple amdgcn-amd-amdhsa -Werror -O3 -DNDEBUG -cl-std=CL2.0 -emit-pch -o ${CMAKE_CURRENT_BINARY_DIR}/opencl2.0-c.amdgcn.pch < ${CMAKE_SOURCE_DIR}/compiler/llvm/tools/clang/lib/Headers/opencl-c.h
341 -- DEPENDS clang ${CMAKE_SOURCE_DIR}/compiler/llvm/tools/clang/lib/Headers/opencl-c.h
342 -+ COMMAND clang -cc1 -x cl-header -triple amdgcn-amd-amdhsa -Werror -O3 -DNDEBUG -cl-std=CL2.0 -emit-pch -o ${CMAKE_CURRENT_BINARY_DIR}/opencl2.0-c.amdgcn.pch < ${OPENCL_C_H}
343 -+ DEPENDS clang ${OPENCL_C_H}
344 - COMMENT "Generating opencl2.0-c.amdgcn.pch"
345 - )
346 - add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/opencl2.0-c.amdgcn.inc
347 -diff --git a/runtime/device/rocm/rocdevice.cpp b/runtime/device/rocm/rocdevice.cpp
348 -index 8b9901b..2648459 100644
349 ---- a/runtime/device/rocm/rocdevice.cpp
350 -+++ b/runtime/device/rocm/rocdevice.cpp
351 -@@ -20,7 +20,7 @@
352 - #include "device/rocm/rocvirtual.hpp"
353 - #include "device/rocm/rocprogram.hpp"
354 - #if defined(WITH_LIGHTNING_COMPILER) && ! defined(USE_COMGR_LIBRARY)
355 --#include "driver/AmdCompiler.h"
356 -+#include "AmdCompiler.h"
357 - #endif // defined(WITH_LIGHTNING_COMPILER) && ! defined(USE_COMGR_LIBRARY)
358 - #include "device/rocm/rocmemory.hpp"
359 - #include "device/rocm/rocglinterop.hpp"
360 -diff --git a/runtime/device/rocm/rockernel.cpp b/runtime/device/rocm/rockernel.cpp
361 -index 8a28acc..7d5b62d 100644
362 ---- a/runtime/device/rocm/rockernel.cpp
363 -+++ b/runtime/device/rocm/rockernel.cpp
364 -@@ -11,7 +11,7 @@
365 -
366 - #if defined(WITH_LIGHTNING_COMPILER) || defined(USE_COMGR_LIBRARY)
367 - #ifndef USE_COMGR_LIBRARY
368 --#include "driver/AmdCompiler.h"
369 -+#include "AmdCompiler.h"
370 - #endif
371 - #include "llvm/Support/AMDGPUMetadata.h"
372 -
373 -diff --git a/runtime/device/rocm/rocprogram.cpp b/runtime/device/rocm/rocprogram.cpp
374 -index 191e58c..58d82e6 100644
375 ---- a/runtime/device/rocm/rocprogram.cpp
376 -+++ b/runtime/device/rocm/rocprogram.cpp
377 -@@ -11,7 +11,7 @@
378 - #include <gelf.h>
379 - #include "libraries.amdgcn.inc"
380 - #ifndef USE_COMGR_LIBRARY
381 --#include "driver/AmdCompiler.h"
382 -+#include "AmdCompiler.h"
383 - #endif
384 - #endif // defined(WITH_LIGHTNING_COMPILER) || defined(USE_COMGR_LIBRARY)
385 -
386 -diff --git a/runtime/platform/object.hpp b/runtime/platform/object.hpp
387 -index 8ab1b68..b33a9e3 100644
388 ---- a/runtime/platform/object.hpp
389 -+++ b/runtime/platform/object.hpp
390 -@@ -9,7 +9,7 @@
391 - #include "os/alloc.hpp"
392 - #include "thread/monitor.hpp"
393 - #include "utils/util.hpp"
394 --#include <icd/icd_dispatch.h>
395 -+#include <icd/loader/icd_dispatch.h>
396 -
397 -
398 - #define KHR_CL_TYPES_DO(F) \
399 -diff --git a/tools/clinfo/CMakeLists.txt b/tools/clinfo/CMakeLists.txt
400 -deleted file mode 100644
401 -index 974a46f..0000000
402 ---- a/tools/clinfo/CMakeLists.txt
403 -+++ /dev/null
404 -@@ -1,13 +0,0 @@
405 --set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
406 --
407 --set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
408 --
409 --include_directories(${OPENCL_INCLUDE_DIRS})
410 --
411 --add_definitions(-DHAVE_CL2_HPP)
412 --
413 --add_executable(clinfo clinfo.cpp)
414 --
415 --target_link_libraries(clinfo OpenCL)
416 --
417 --install(TARGETS clinfo DESTINATION bin)
418 -diff --git a/tools/clinfo/clinfo.cpp b/tools/clinfo/clinfo.cpp
419 -deleted file mode 100644
420 -index c5afb7f..0000000
421 ---- a/tools/clinfo/clinfo.cpp
422 -+++ /dev/null
423 -@@ -1,832 +0,0 @@
424 --/* ============================================================
425 --
426 --Copyright (c) 2010 Advanced Micro Devices, Inc. All rights reserved.
427 --
428 --Redistribution and use of this material is permitted under the following
429 --conditions:
430 --
431 --Redistributions must retain the above copyright notice and all terms of this
432 --license.
433 --
434 --In no event shall anyone redistributing or accessing or using this material
435 --commence or participate in any arbitration or legal action relating to this
436 --material against Advanced Micro Devices, Inc. or any copyright holders or
437 --contributors. The foregoing shall survive any expiration or termination of
438 --this license or any agreement or access or use related to this material.
439 --
440 --ANY BREACH OF ANY TERM OF THIS LICENSE SHALL RESULT IN THE IMMEDIATE REVOCATION
441 --OF ALL RIGHTS TO REDISTRIBUTE, ACCESS OR USE THIS MATERIAL.
442 --
443 --THIS MATERIAL IS PROVIDED BY ADVANCED MICRO DEVICES, INC. AND ANY COPYRIGHT
444 --HOLDERS AND CONTRIBUTORS "AS IS" IN ITS CURRENT CONDITION AND WITHOUT ANY
445 --REPRESENTATIONS, GUARANTEE, OR WARRANTY OF ANY KIND OR IN ANY WAY RELATED TO
446 --SUPPORT, INDEMNITY, ERROR FREE OR UNINTERRUPTED OPERA TION, OR THAT IT IS FREE
447 --FROM DEFECTS OR VIRUSES. ALL OBLIGATIONS ARE HEREBY DISCLAIMED - WHETHER
448 --EXPRESS, IMPLIED, OR STATUTORY - INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED
449 --WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
450 --ACCURACY, COMPLETENESS, OPERABILITY, QUALITY OF SERVICE, OR NON-INFRINGEMENT.
451 --IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. OR ANY COPYRIGHT HOLDERS OR
452 --CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, PUNITIVE,
453 --EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
454 --OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, REVENUE, DATA, OR PROFITS; OR
455 --BUSINESS INTERRUPTION) HOWEVER CAUSED OR BASED ON ANY THEORY OF LIABILITY
456 --ARISING IN ANY WAY RELATED TO THIS MATERIAL, EVEN IF ADVISED OF THE POSSIBILITY
457 --OF SUCH DAMAGE. THE ENTIRE AND AGGREGATE LIABILITY OF ADVANCED MICRO DEVICES,
458 --INC. AND ANY COPYRIGHT HOLDERS AND CONTRIBUTORS SHALL NOT EXCEED TEN DOLLARS
459 --(US $10.00). ANYONE REDISTRIBUTING OR ACCESSING OR USING THIS MATERIAL ACCEPTS
460 --THIS ALLOCATION OF RISK AND AGREES TO RELEASE ADVANCED MICRO DEVICES, INC. AND
461 --ANY COPYRIGHT HOLDERS AND CONTRIBUTORS FROM ANY AND ALL LIABILITIES,
462 --OBLIGATIONS, CLAIMS, OR DEMANDS IN EXCESS OF TEN DOLLARS (US $10.00). THE
463 --FOREGOING ARE ESSENTIAL TERMS OF THIS LICENSE AND, IF ANY OF THESE TERMS ARE
464 --CONSTRUED AS UNENFORCEABLE, FAIL IN ESSENTIAL PURPOSE, OR BECOME VOID OR
465 --DETRIMENTAL TO ADVANCED MICRO DEVICES, INC. OR ANY COPYRIGHT HOLDERS OR
466 --CONTRIBUTORS FOR ANY REASON, THEN ALL RIGHTS TO REDISTRIBUTE, ACCESS OR USE
467 --THIS MATERIAL SHALL TERMINATE IMMEDIATELY. MOREOVER, THE FOREGOING SHALL
468 --SURVIVE ANY EXPIRATION OR TERMINATION OF THIS LICENSE OR ANY AGREEMENT OR
469 --ACCESS OR USE RELATED TO THIS MATERIAL.
470 --
471 --NOTICE IS HEREBY PROVIDED, AND BY REDISTRIBUTING OR ACCESSING OR USING THIS
472 --MATERIAL SUCH NOTICE IS ACKNOWLEDGED, THAT THIS MATERIAL MAY BE SUBJECT TO
473 --RESTRICTIONS UNDER THE LAWS AND REGULATIONS OF THE UNITED STATES OR OTHER
474 --COUNTRIES, WHICH INCLUDE BUT ARE NOT LIMITED TO, U.S. EXPORT CONTROL LAWS SUCH
475 --AS THE EXPORT ADMINISTRATION REGULATIONS AND NATIONAL SECURITY CONTROLS AS
476 --DEFINED THEREUNDER, AS WELL AS STATE DEPARTMENT CONTROLS UNDER THE U.S.
477 --MUNITIONS LIST. THIS MATERIAL MAY NOT BE USED, RELEASED, TRANSFERRED, IMPORTED,
478 --EXPORTED AND/OR RE-EXPORTED IN ANY MANNER PROHIBITED UNDER ANY APPLICABLE LAWS,
479 --INCLUDING U.S. EXPORT CONTROL LAWS REGARDING SPECIFICALLY DESIGNATED PERSONS,
480 --COUNTRIES AND NATIONALS OF COUNTRIES SUBJECT TO NATIONAL SECURITY CONTROLS.
481 --MOREOVER, THE FOREGOING SHALL SURVIVE ANY EXPIRATION OR TERMINATION OF ANY
482 --LICENSE OR AGREEMENT OR ACCESS OR USE RELATED TO THIS MATERIAL.
483 --
484 --NOTICE REGARDING THE U.S. GOVERNMENT AND DOD AGENCIES: This material is
485 --provided with "RESTRICTED RIGHTS" and/or "LIMITED RIGHTS" as applicable to
486 --computer software and technical data, respectively. Use, duplication,
487 --distribution or disclosure by the U.S. Government and/or DOD agencies is
488 --subject to the full extent of restrictions in all applicable regulations,
489 --including those found at FAR52.227 and DFARS252.227 et seq. and any successor
490 --regulations thereof. Use of this material by the U.S. Government and/or DOD
491 --agencies is acknowledgment of the proprietary rights of any copyright holders
492 --and contributors, including those of Advanced Micro Devices, Inc., as well as
493 --the provisions of FAR52.227-14 through 23 regarding privately developed and/or
494 --commercial computer software.
495 --
496 --This license forms the entire agreement regarding the subject matter hereof and
497 --supersedes all proposals and prior discussions and writings between the parties
498 --with respect thereto. This license does not affect any ownership, rights, title,
499 --or interest in, or relating to, this material. No terms of this license can be
500 --modified or waived, and no breach of this license can be excused, unless done
501 --so in a writing signed by all affected parties. Each term of this license is
502 --separately enforceable. If any term of this license is determined to be or
503 --becomes unenforceable or illegal, such term shall be reformed to the minimum
504 --extent necessary in order for this license to remain in effect in accordance
505 --with its terms as modified by such reformation. This license shall be governed
506 --by and construed in accordance with the laws of the State of Texas without
507 --regard to rules on conflicts of law of any state or jurisdiction or the United
508 --Nations Convention on the International Sale of Goods. All disputes arising out
509 --of this license shall be subject to the jurisdiction of the federal and state
510 --courts in Austin, Texas, and all defenses are hereby waived concerning personal
511 --jurisdiction and venue of these courts.
512 --
513 --============================================================ */
514 --
515 --#include <iostream>
516 --#include <map>
517 --#include <set>
518 --#include <algorithm>
519 --#include <string>
520 --#include <cstdlib>
521 --#include <cstdio>
522 --#if !defined(_WIN32)
523 --#include <errno.h>
524 --#endif
525 --
526 --#ifdef _MSC_VER
527 --#pragma warning(disable: 4290)
528 --#endif
529 --
530 --#if defined(HAVE_CL2_HPP)
531 --#define CL_HPP_ENABLE_EXCEPTIONS
532 --#define CL_HPP_MINIMUM_OPENCL_VERSION 120
533 --#define CL_HPP_TARGET_OPENCL_VERSION 200
534 --#define CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY
535 --#include "CL/cl2.hpp"
536 --#else // !HAVE_CL2_HPP
537 --#define __CL_ENABLE_EXCEPTIONS
538 --#define __MAX_DEFAULT_VECTOR_SIZE 50
539 --#define CL_USE_DEPRECATED_OPENCL_1_1_APIS
540 --#define CL_USE_DEPRECATED_OPENCL_2_0_APIS
541 --#include "cl.hpp"
542 --#endif // !HAVE_CL2_HPP
543 --
544 --bool verbose = false;
545 --
546 --/// Returns EXIT_SUCCESS on success, EXIT_FAILURE on failure.
547 --int
548 --main(int argc, char** argv)
549 --{
550 -- /* Error flag */
551 -- cl_int err;
552 --
553 -- //parse input
554 -- for(int i = 1; i < argc; i++){
555 -- if ((strcmp(argv[i], "-v") == 0) ||
556 -- (strcmp(argv[i], "--verbose") == 0)){
557 -- verbose = true;
558 -- } else if ((strcmp(argv[i], "-h") == 0) ||
559 -- (strcmp(argv[i], "--help") == 0)){
560 -- std::cout << "Usage is: " << argv[0] << " [-v|--verbose]" << std::endl;
561 -- return EXIT_FAILURE;
562 -- }
563 -- }
564 --
565 -- // Platform info
566 -- std::vector<cl::Platform> platforms;
567 --
568 -- try {
569 -- err = cl::Platform::get(&platforms);
570 --
571 -- // Iteratate over platforms
572 -- std::cout << "Number of platforms:\t\t\t\t "
573 -- << platforms.size()
574 -- << std::endl;
575 -- for (std::vector<cl::Platform>::iterator i = platforms.begin();
576 -- i != platforms.end();
577 -- ++i) {
578 -- const cl::Platform& platform = *i;
579 --
580 -- std::cout << " Platform Profile:\t\t\t\t "
581 -- << platform.getInfo<CL_PLATFORM_PROFILE>().c_str()
582 -- << std::endl;
583 -- std::cout << " Platform Version:\t\t\t\t "
584 -- << platform.getInfo<CL_PLATFORM_VERSION>().c_str()
585 -- << std::endl;
586 -- std::cout << " Platform Name:\t\t\t\t "
587 -- << platform.getInfo<CL_PLATFORM_NAME>().c_str()
588 -- << std::endl;
589 -- std::cout << " Platform Vendor:\t\t\t\t "
590 -- << platform.getInfo<CL_PLATFORM_VENDOR>().c_str() << std::endl;
591 -- if (platform.getInfo<CL_PLATFORM_EXTENSIONS>().size() > 0) {
592 -- std::cout << " Platform Extensions:\t\t\t\t "
593 -- << platform.getInfo<CL_PLATFORM_EXTENSIONS>().c_str()
594 -- << std::endl;
595 -- }
596 -- }
597 --
598 -- std::cout << std::endl << std:: endl;
599 -- // Now Iteratate over each platform and its devices
600 -- for (std::vector<cl::Platform>::iterator p = platforms.begin();
601 -- p != platforms.end();
602 -- ++p) {
603 -- const cl::Platform& platform = *p;
604 -- std::cout << " Platform Name:\t\t\t\t "
605 -- << platform.getInfo<CL_PLATFORM_NAME>().c_str()
606 -- << std::endl;
607 --
608 -- std::vector<cl::Device> devices;
609 -- platform.getDevices(CL_DEVICE_TYPE_ALL, &devices);
610 --
611 -- // Get OpenCL version
612 -- std::string platformVersionStr = platform.getInfo<CL_PLATFORM_VERSION>();
613 -- std::string openclVerstionStr(platformVersionStr.c_str());
614 -- size_t vStart = openclVerstionStr.find(" ", 0);
615 -- size_t vEnd = openclVerstionStr.find(" ", vStart + 1);
616 -- std::string vStrVal = openclVerstionStr.substr(vStart + 1, vEnd - vStart - 1);
617 --
618 -- std::cout << "Number of devices:\t\t\t\t " << devices.size() << std::endl;
619 -- for (std::vector<cl::Device>::iterator i = devices.begin();
620 -- i != devices.end();
621 -- ++i) {
622 -- const cl::Device& device = *i;
623 -- /* Get device name */
624 -- std::string deviceName = device.getInfo<CL_DEVICE_NAME>();
625 -- cl_device_type dtype = device.getInfo<CL_DEVICE_TYPE>();
626 --
627 -- /* Get CAL driver version in int */
628 -- std::string driverVersion = device.getInfo<CL_DRIVER_VERSION>();
629 -- std::string calVersion(driverVersion.c_str());
630 -- calVersion = calVersion.substr(calVersion.find_last_of(".") + 1);
631 -- int version = atoi(calVersion.c_str());
632 --
633 -- std::cout << " Device Type:\t\t\t\t\t " ;
634 -- switch (dtype) {
635 -- case CL_DEVICE_TYPE_ACCELERATOR:
636 -- std::cout << "CL_DEVICE_TYPE_ACCRLERATOR" << std::endl;
637 -- break;
638 -- case CL_DEVICE_TYPE_CPU:
639 -- std::cout << "CL_DEVICE_TYPE_CPU" << std::endl;
640 -- break;
641 -- case CL_DEVICE_TYPE_DEFAULT:
642 -- std::cout << "CL_DEVICE_TYPE_DEFAULT" << std::endl;
643 -- break;
644 -- case CL_DEVICE_TYPE_GPU:
645 -- std::cout << "CL_DEVICE_TYPE_GPU" << std::endl;
646 -- break;
647 -- }
648 --
649 -- std::cout << " Vendor ID:\t\t\t\t\t "
650 -- << std::hex
651 -- << device.getInfo<CL_DEVICE_VENDOR_ID>()
652 -- << "h"
653 -- << std::dec
654 -- << std::endl;
655 --
656 -- bool isAMDPlatform = (strcmp(platform.getInfo<CL_PLATFORM_NAME>().c_str(), "AMD Accelerated Parallel Processing") == 0) ? true : false;
657 -- if (isAMDPlatform)
658 -- {
659 -- std::string boardName;
660 -- device.getInfo(CL_DEVICE_BOARD_NAME_AMD, &boardName);
661 -- std::cout << " Board name:\t\t\t\t\t "
662 -- << boardName.c_str()
663 -- << std::endl;
664 --
665 -- cl_device_topology_amd topology;
666 -- err = device.getInfo(CL_DEVICE_TOPOLOGY_AMD, &topology);
667 -- if (topology.raw.type == CL_DEVICE_TOPOLOGY_TYPE_PCIE_AMD) {
668 -- std::cout << " Device Topology:\t\t\t\t "
669 -- << "PCI[ B#" << (int)topology.pcie.bus
670 -- << ", D#" << (int)topology.pcie.device
671 -- << ", F#" << (int)topology.pcie.function
672 -- << " ]" << std::endl;
673 -- }
674 -- }
675 --
676 -- std::cout << " Max compute units:\t\t\t\t "
677 -- << device.getInfo<CL_DEVICE_MAX_COMPUTE_UNITS>()
678 -- << std::endl;
679 --
680 -- std::cout << " Max work items dimensions:\t\t\t "
681 -- << device.getInfo<CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS>()
682 -- << std::endl;
683 --
684 -- std::vector< ::size_t> witems =
685 -- device.getInfo<CL_DEVICE_MAX_WORK_ITEM_SIZES>();
686 -- for (unsigned int x = 0;
687 -- x < device.getInfo<CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS>();
688 -- x++) {
689 -- std::cout << " Max work items["
690 -- << x << "]:\t\t\t\t "
691 -- << witems[x]
692 -- << std::endl;
693 -- }
694 --
695 -- std::cout << " Max work group size:\t\t\t\t "
696 -- << device.getInfo<CL_DEVICE_MAX_WORK_GROUP_SIZE>()
697 -- << std::endl;
698 --
699 -- std::cout << " Preferred vector width char:\t\t\t "
700 -- << device.getInfo<CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR>()
701 -- << std::endl;
702 --
703 -- std::cout << " Preferred vector width short:\t\t\t "
704 -- << device.getInfo<CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT>()
705 -- << std::endl;
706 --
707 -- std::cout << " Preferred vector width int:\t\t\t "
708 -- << device.getInfo<CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT>()
709 -- << std::endl;
710 --
711 -- std::cout << " Preferred vector width long:\t\t\t "
712 -- << device.getInfo<CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG>()
713 -- << std::endl;
714 --
715 -- std::cout << " Preferred vector width float:\t\t\t "
716 -- << device.getInfo<CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT>()
717 -- << std::endl;
718 --
719 -- std::cout << " Preferred vector width double:\t\t "
720 -- << device.getInfo<CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE>()
721 -- << std::endl;
722 --
723 --#ifdef CL_VERSION_1_1
724 -- if(vStrVal.compare("1.0") > 0)
725 -- {
726 -- std::cout << " Native vector width char:\t\t\t "
727 -- << device.getInfo<CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR>()
728 -- << std::endl;
729 --
730 -- std::cout << " Native vector width short:\t\t\t "
731 -- << device.getInfo<CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT>()
732 -- << std::endl;
733 --
734 -- std::cout << " Native vector width int:\t\t\t "
735 -- << device.getInfo<CL_DEVICE_NATIVE_VECTOR_WIDTH_INT>()
736 -- << std::endl;
737 --
738 -- std::cout << " Native vector width long:\t\t\t "
739 -- << device.getInfo<CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG>()
740 -- << std::endl;
741 --
742 -- std::cout << " Native vector width float:\t\t\t "
743 -- << device.getInfo<CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT>()
744 -- << std::endl;
745 --
746 -- std::cout << " Native vector width double:\t\t\t "
747 -- << device.getInfo<CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE>()
748 -- << std::endl;
749 -- }
750 --#endif // CL_VERSION_1_1
751 -- std::cout << " Max clock frequency:\t\t\t\t "
752 -- << device.getInfo<CL_DEVICE_MAX_CLOCK_FREQUENCY>()
753 -- << "Mhz"
754 -- << std::endl;
755 --
756 -- std::cout << " Address bits:\t\t\t\t\t "
757 -- << device.getInfo<CL_DEVICE_ADDRESS_BITS>()
758 -- << std::endl;
759 --
760 -- std::cout << " Max memory allocation:\t\t\t "
761 -- << device.getInfo<CL_DEVICE_MAX_MEM_ALLOC_SIZE>()
762 -- << std::endl;
763 --
764 -- std::cout << " Image support:\t\t\t\t "
765 -- << (device.getInfo<CL_DEVICE_IMAGE_SUPPORT>() ? "Yes" : "No")
766 -- << std::endl;
767 --
768 -- if (device.getInfo<CL_DEVICE_IMAGE_SUPPORT>())
769 -- {
770 --
771 -- std::cout << " Max number of images read arguments:\t\t "
772 -- << device.getInfo<CL_DEVICE_MAX_READ_IMAGE_ARGS>()
773 -- << std::endl;
774 --
775 -- std::cout << " Max number of images write arguments:\t\t "
776 -- << device.getInfo<CL_DEVICE_MAX_WRITE_IMAGE_ARGS>()
777 -- << std::endl;
778 --
779 -- std::cout << " Max image 2D width:\t\t\t\t "
780 -- << device.getInfo<CL_DEVICE_IMAGE2D_MAX_WIDTH>()
781 -- << std::endl;
782 --
783 -- std::cout << " Max image 2D height:\t\t\t\t "
784 -- << device.getInfo<CL_DEVICE_IMAGE2D_MAX_HEIGHT>()
785 -- << std::endl;
786 --
787 -- std::cout << " Max image 3D width:\t\t\t\t "
788 -- << device.getInfo<CL_DEVICE_IMAGE3D_MAX_WIDTH>()
789 -- << std::endl;
790 --
791 -- std::cout << " Max image 3D height:\t\t\t\t "
792 -- << device.getInfo<CL_DEVICE_IMAGE3D_MAX_HEIGHT>()
793 -- << std::endl;
794 --
795 -- std::cout << " Max image 3D depth:\t\t\t\t "
796 -- << device.getInfo<CL_DEVICE_IMAGE3D_MAX_DEPTH>()
797 -- << std::endl;
798 --
799 -- std::cout << " Max samplers within kernel:\t\t\t "
800 -- << device.getInfo<CL_DEVICE_MAX_SAMPLERS>()
801 -- << std::endl;
802 --
803 -- if (verbose)
804 -- {
805 -- std::cout << " Image formats supported:" << std::endl;
806 -- std::vector<cl::ImageFormat> formats;
807 --
808 -- cl_context_properties cps[3] = { CL_CONTEXT_PLATFORM, (cl_context_properties)(*p)(), 0 };
809 -- std::vector<cl::Device> device;
810 -- device.push_back(*i);
811 -- cl::Context context(device, cps, NULL, NULL, &err);
812 --
813 -- std::map<int,std::string> channelOrder;
814 -- channelOrder[CL_R] = "CL_R";
815 -- channelOrder[CL_A] = "CL_A";
816 -- channelOrder[CL_RG] = "CL_RG";
817 -- channelOrder[CL_RA] = "CL_RA";
818 -- channelOrder[CL_RGB] = "CL_RGB";
819 -- channelOrder[CL_RGBA] = "CL_RGBA";
820 -- channelOrder[CL_BGRA] = "CL_BGRA";
821 -- channelOrder[CL_ARGB] = "CL_ARGB";
822 -- channelOrder[CL_INTENSITY] = "CL_INTENSITY";
823 -- channelOrder[CL_LUMINANCE] = "CL_LUMINANCE";
824 -- channelOrder[CL_Rx] = "CL_Rx";
825 -- channelOrder[CL_RGx] = "CL_RGx";
826 -- channelOrder[CL_RGBx] = "CL_RGBx";
827 --
828 -- std::map<int,std::pair<std::string, std::string> > channelType;
829 -- channelType[CL_SNORM_INT8] = std::make_pair("snorm", "int8");
830 -- channelType[CL_SNORM_INT16] = std::make_pair("snorm", "int16");
831 -- channelType[CL_UNORM_INT8] = std::make_pair("unorm", "int8");
832 -- channelType[CL_UNORM_INT16] = std::make_pair("unorm", "int16");
833 -- channelType[CL_UNORM_SHORT_565] = std::make_pair("unorm", "short_565");
834 -- channelType[CL_UNORM_SHORT_555] = std::make_pair("unorm", "short_555");
835 -- channelType[CL_UNORM_INT_101010] = std::make_pair("unorm", "int_101010");
836 -- channelType[CL_SIGNED_INT8] = std::make_pair("signed", "int8");
837 -- channelType[CL_SIGNED_INT16] = std::make_pair("signed", "int16");
838 -- channelType[CL_SIGNED_INT32] = std::make_pair("signed", "int32");
839 -- channelType[CL_UNSIGNED_INT8] = std::make_pair("unsigned", "int8");
840 -- channelType[CL_UNSIGNED_INT16] = std::make_pair("unsigned", "int16");
841 -- channelType[CL_UNSIGNED_INT32] = std::make_pair("unsigned", "int32");
842 -- channelType[CL_HALF_FLOAT] = std::make_pair("half_float", "");
843 -- channelType[CL_FLOAT] = std::make_pair("float", "");
844 --
845 -- std::vector<std::pair<int, std::string> > imageDimensions;
846 -- imageDimensions.push_back(std::make_pair(CL_MEM_OBJECT_IMAGE2D, std::string("2D ")));
847 -- imageDimensions.push_back(std::make_pair(CL_MEM_OBJECT_IMAGE3D, std::string("3D ")));
848 -- for(std::vector<std::pair<int, std::string> >::iterator id = imageDimensions.begin();
849 -- id != imageDimensions.end();
850 -- id++){
851 --
852 -- struct imageAccessStruct {
853 -- std::string name;
854 -- int access;
855 -- std::vector<cl::ImageFormat> formats;
856 -- } imageAccess[] = {{std::string("Read-Write/Read-Only/Write-Only"), CL_MEM_READ_WRITE, std::vector<cl::ImageFormat>()},
857 -- {std::string("Read-Only"), CL_MEM_READ_ONLY, std::vector<cl::ImageFormat>()},
858 -- {std::string("Write-Only"), CL_MEM_WRITE_ONLY, std::vector<cl::ImageFormat>()}};
859 --
860 -- for(size_t ia=0; ia < sizeof(imageAccess)/sizeof(imageAccessStruct); ia++){
861 -- context.getSupportedImageFormats(imageAccess[ia].access, (*id).first, &(imageAccess[ia].formats));
862 -- bool printTopHeader = true;
863 -- for (std::map<int,std::string>::iterator o = channelOrder.begin();
864 -- o != channelOrder.end();
865 -- o++)
866 -- {
867 -- bool printHeader = true;
868 --
869 -- for (std::vector<cl::ImageFormat>::iterator it = imageAccess[ia].formats.begin();
870 -- it != imageAccess[ia].formats.end();
871 -- ++it)
872 -- {
873 -- if ( (*o).first == (int)(*it).image_channel_order)
874 -- {
875 -- bool printedAlready = false;
876 -- //see if this was already print in RW/RO/WO
877 -- if (ia !=0)
878 -- {
879 -- for (std::vector<cl::ImageFormat>::iterator searchIt = imageAccess[0].formats.begin();
880 -- searchIt != imageAccess[0].formats.end();
881 -- searchIt++)
882 -- {
883 -- if ( ((*searchIt).image_channel_data_type == (*it).image_channel_data_type) &&
884 -- ((*searchIt).image_channel_order == (*it).image_channel_order))
885 -- {
886 -- printedAlready = true;
887 -- break;
888 -- }
889 -- }
890 -- }
891 -- if (printedAlready)
892 -- {
893 -- continue;
894 -- }
895 -- if (printTopHeader)
896 -- {
897 -- std::cout << " " << (*id).second << imageAccess[ia].name << std::endl;
898 -- printTopHeader = false;
899 -- }
900 -- if (printHeader)
901 -- {
902 -- std::cout << " " << (*o).second << ": ";
903 -- printHeader = false;
904 -- }
905 -- std::cout << channelType[(*it).image_channel_data_type].first;
906 -- if (channelType[(*it).image_channel_data_type].second != "")
907 -- {
908 -- std::cout << "-"
909 -- << channelType[(*it).image_channel_data_type].second;
910 -- }
911 -- if (it != (imageAccess[ia].formats.end() - 1))
912 -- {
913 -- std::cout << " ";
914 -- }
915 -- }
916 -- }
917 -- if (printHeader == false)
918 -- {
919 -- std::cout << std::endl;
920 -- }
921 -- }
922 -- }
923 -- }
924 -- }
925 -- }
926 --
927 -- std::cout << " Max size of kernel argument:\t\t\t "
928 -- << device.getInfo<CL_DEVICE_MAX_PARAMETER_SIZE>()
929 -- << std::endl;
930 --
931 -- std::cout << " Alignment (bits) of base address:\t\t "
932 -- << device.getInfo<CL_DEVICE_MEM_BASE_ADDR_ALIGN>()
933 -- << std::endl;
934 --
935 -- std::cout << " Minimum alignment (bytes) for any datatype:\t "
936 -- << device.getInfo<CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE>()
937 -- << std::endl;
938 --
939 -- std::cout << " Single precision floating point capability" << std::endl;
940 -- std::cout << " Denorms:\t\t\t\t\t "
941 -- << (device.getInfo<CL_DEVICE_SINGLE_FP_CONFIG>() &
942 -- CL_FP_DENORM ? "Yes" : "No")
943 -- << std::endl;
944 -- std::cout << " Quiet NaNs:\t\t\t\t\t "
945 -- << (device.getInfo<CL_DEVICE_SINGLE_FP_CONFIG>() &
946 -- CL_FP_INF_NAN ? "Yes" : "No")
947 -- << std::endl;
948 -- std::cout << " Round to nearest even:\t\t\t "
949 -- << (device.getInfo<CL_DEVICE_SINGLE_FP_CONFIG>() &
950 -- CL_FP_ROUND_TO_NEAREST ? "Yes" : "No")
951 -- << std::endl;
952 -- std::cout << " Round to zero:\t\t\t\t "
953 -- << (device.getInfo<CL_DEVICE_SINGLE_FP_CONFIG>() &
954 -- CL_FP_ROUND_TO_ZERO ? "Yes" : "No")
955 -- << std::endl;
956 -- std::cout << " Round to +ve and infinity:\t\t\t "
957 -- << (device.getInfo<CL_DEVICE_SINGLE_FP_CONFIG>() &
958 -- CL_FP_ROUND_TO_INF ? "Yes" : "No")
959 -- << std::endl;
960 -- std::cout << " IEEE754-2008 fused multiply-add:\t\t "
961 -- << (device.getInfo<CL_DEVICE_SINGLE_FP_CONFIG>() &
962 -- CL_FP_FMA ? "Yes" : "No")
963 -- << std::endl;
964 --
965 -- std::cout << " Cache type:\t\t\t\t\t " ;
966 -- switch (device.getInfo<CL_DEVICE_GLOBAL_MEM_CACHE_TYPE>()) {
967 -- case CL_NONE:
968 -- std::cout << "None" << std::endl;
969 -- break;
970 -- case CL_READ_ONLY_CACHE:
971 -- std::cout << "Read only" << std::endl;
972 -- break;
973 -- case CL_READ_WRITE_CACHE:
974 -- std::cout << "Read/Write" << std::endl;
975 -- break;
976 -- }
977 --
978 -- std::cout << " Cache line size:\t\t\t\t "
979 -- << device.getInfo<CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE>()
980 -- << std::endl;
981 --
982 -- std::cout << " Cache size:\t\t\t\t\t "
983 -- << device.getInfo<CL_DEVICE_GLOBAL_MEM_CACHE_SIZE>()
984 -- << std::endl;
985 --
986 -- std::cout << " Global memory size:\t\t\t\t "
987 -- << device.getInfo<CL_DEVICE_GLOBAL_MEM_SIZE>()
988 -- << std::endl;
989 --
990 -- std::cout << " Constant buffer size:\t\t\t\t "
991 -- << device.getInfo<CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE>()
992 -- << std::endl;
993 --
994 -- std::cout << " Max number of constant args:\t\t\t "
995 -- << device.getInfo<CL_DEVICE_MAX_CONSTANT_ARGS>()
996 -- << std::endl;
997 --
998 -- std::cout << " Local memory type:\t\t\t\t " ;
999 -- switch (device.getInfo<CL_DEVICE_LOCAL_MEM_TYPE>()) {
1000 -- case CL_LOCAL:
1001 -- std::cout << "Scratchpad" << std::endl;
1002 -- break;
1003 -- case CL_GLOBAL:
1004 -- std::cout << "Global" << std::endl;
1005 -- break;
1006 -- }
1007 --
1008 --
1009 -- std::cout << " Local memory size:\t\t\t\t "
1010 -- << device.getInfo<CL_DEVICE_LOCAL_MEM_SIZE>()
1011 -- << std::endl;
1012 --
1013 --#if defined(CL_VERSION_2_0)
1014 -- if(vStrVal.compare("2") > 0)
1015 -- {
1016 -- std::cout << " Max pipe arguments:\t\t\t\t "
1017 -- << device.getInfo<CL_DEVICE_MAX_PIPE_ARGS>()
1018 -- << std::endl;
1019 --
1020 -- std::cout << " Max pipe active reservations:\t\t\t "
1021 -- << device.getInfo<CL_DEVICE_PIPE_MAX_ACTIVE_RESERVATIONS>()
1022 -- << std::endl;
1023 --
1024 -- std::cout << " Max pipe packet size:\t\t\t\t "
1025 -- << device.getInfo<CL_DEVICE_PIPE_MAX_PACKET_SIZE>()
1026 -- << std::endl;
1027 --
1028 -- std::cout << " Max global variable size:\t\t\t "
1029 -- << device.getInfo<CL_DEVICE_MAX_GLOBAL_VARIABLE_SIZE>()
1030 -- << std::endl;
1031 --
1032 -- std::cout << " Max global variable preferred total size:\t "
1033 -- << device.getInfo<CL_DEVICE_GLOBAL_VARIABLE_PREFERRED_TOTAL_SIZE>()
1034 -- << std::endl;
1035 --
1036 -- std::cout << " Max read/write image args:\t\t\t "
1037 -- << device.getInfo<CL_DEVICE_MAX_READ_WRITE_IMAGE_ARGS>()
1038 -- << std::endl;
1039 --
1040 -- std::cout << " Max on device events:\t\t\t\t "
1041 -- << device.getInfo<CL_DEVICE_MAX_ON_DEVICE_EVENTS>()
1042 -- << std::endl;
1043 --
1044 -- std::cout << " Queue on device max size:\t\t\t "
1045 -- << device.getInfo<CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE>()
1046 -- << std::endl;
1047 --
1048 -- std::cout << " Max on device queues:\t\t\t\t "
1049 -- << device.getInfo<CL_DEVICE_MAX_ON_DEVICE_QUEUES>()
1050 -- << std::endl;
1051 --
1052 -- std::cout << " Queue on device preferred size:\t\t "
1053 -- << device.getInfo<CL_DEVICE_QUEUE_ON_DEVICE_PREFERRED_SIZE>()
1054 -- << std::endl;
1055 --
1056 -- std::cout << " SVM capabilities:\t\t\t\t " << std::endl;
1057 -- std::cout << " Coarse grain buffer:\t\t\t "
1058 -- << (device.getInfo<CL_DEVICE_SVM_CAPABILITIES>() &
1059 -- CL_DEVICE_SVM_COARSE_GRAIN_BUFFER ? "Yes" : "No")
1060 -- << std::endl;
1061 -- std::cout << " Fine grain buffer:\t\t\t\t "
1062 -- << (device.getInfo<CL_DEVICE_SVM_CAPABILITIES>() &
1063 -- CL_DEVICE_SVM_FINE_GRAIN_BUFFER ? "Yes" : "No")
1064 -- << std::endl;
1065 -- std::cout << " Fine grain system:\t\t\t\t "
1066 -- << (device.getInfo<CL_DEVICE_SVM_CAPABILITIES>() &
1067 -- CL_DEVICE_SVM_FINE_GRAIN_SYSTEM ? "Yes" : "No")
1068 -- << std::endl;
1069 -- std::cout << " Atomics:\t\t\t\t\t "
1070 -- << (device.getInfo<CL_DEVICE_SVM_CAPABILITIES>() &
1071 -- CL_DEVICE_SVM_ATOMICS ? "Yes" : "No")
1072 -- << std::endl;
1073 --
1074 -- std::cout << " Preferred platform atomic alignment:\t\t "
1075 -- << device.getInfo<CL_DEVICE_PREFERRED_PLATFORM_ATOMIC_ALIGNMENT>()
1076 -- << std::endl;
1077 --
1078 -- std::cout << " Preferred global atomic alignment:\t\t "
1079 -- << device.getInfo<CL_DEVICE_PREFERRED_GLOBAL_ATOMIC_ALIGNMENT>()
1080 -- << std::endl;
1081 --
1082 -- std::cout << " Preferred local atomic alignment:\t\t "
1083 -- << device.getInfo<CL_DEVICE_PREFERRED_LOCAL_ATOMIC_ALIGNMENT>()
1084 -- << std::endl;
1085 -- }
1086 --#endif // CL_VERSION_2_0
1087 --
1088 --#if defined(CL_VERSION_1_1) && !defined(ATI_ARCH_ARM)
1089 -- if(vStrVal.compare("1.0") > 0)
1090 -- {
1091 -- cl_context_properties cps[3] = { CL_CONTEXT_PLATFORM, (cl_context_properties)(*p)(), 0 };
1092 --
1093 -- std::vector<cl::Device> device;
1094 -- device.push_back(*i);
1095 --
1096 -- cl::Context context(device, cps, NULL, NULL, &err);
1097 -- if (err != CL_SUCCESS) {
1098 -- std::cerr << "Context::Context() failed (" << err << ")\n";
1099 -- return EXIT_FAILURE;
1100 -- }
1101 -- std::string kernelStr("__kernel void hello(){ size_t i = get_global_id(0); size_t j = get_global_id(1);}");
1102 -- cl::Program::Sources sources(1, std::make_pair(kernelStr.data(), kernelStr.size()));
1103 --
1104 -- cl::Program program = cl::Program(context, sources, &err);
1105 -- if (err != CL_SUCCESS) {
1106 -- std::cerr << "Program::Program() failed (" << err << ")\n";
1107 -- return EXIT_FAILURE;
1108 -- }
1109 --
1110 -- err = program.build(device);
1111 -- if (err != CL_SUCCESS) {
1112 --
1113 -- if(err == CL_BUILD_PROGRAM_FAILURE)
1114 -- {
1115 -- std::string str = program.getBuildInfo<CL_PROGRAM_BUILD_LOG>((*i));
1116 --
1117 -- std::cout << " \n\t\t\tBUILD LOG\n";
1118 -- std::cout << " ************************************************\n";
1119 -- std::cout << str.c_str() << std::endl;
1120 -- std::cout << " ************************************************\n";
1121 -- }
1122 --
1123 -- std::cerr << "Program::build() failed (" << err << ")\n";
1124 -- return EXIT_FAILURE;
1125 -- }
1126 --
1127 -- cl::Kernel kernel(program, "hello", &err);
1128 -- if (err != CL_SUCCESS) {
1129 -- std::cerr << "Kernel::Kernel() failed (" << err << ")\n";
1130 -- return EXIT_FAILURE;
1131 -- }
1132 --
1133 -- std::cout << " Kernel Preferred work group size multiple:\t "
1134 -- << kernel.getWorkGroupInfo<CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE>((*i), &err)
1135 -- << std::endl;
1136 -- }
1137 --
1138 --#endif // CL_VERSION_1_1
1139 --
1140 -- std::cout << " Error correction support:\t\t\t "
1141 -- << device.getInfo<CL_DEVICE_ERROR_CORRECTION_SUPPORT>()
1142 -- << std::endl;
1143 --#ifdef CL_VERSION_1_1
1144 -- if(vStrVal.compare("1.0") > 0)
1145 -- {
1146 -- std::cout << " Unified memory for Host and Device:\t\t "
1147 -- << device.getInfo<CL_DEVICE_HOST_UNIFIED_MEMORY>()
1148 -- << std::endl;
1149 -- }
1150 --#endif // CL_VERSION_1_1
1151 -- std::cout << " Profiling timer resolution:\t\t\t "
1152 -- << device.getInfo<CL_DEVICE_PROFILING_TIMER_RESOLUTION>()
1153 -- << std::endl;
1154 --
1155 -- std::cout << " Device endianess:\t\t\t\t "
1156 -- << (device.getInfo<CL_DEVICE_ENDIAN_LITTLE>() ? "Little" : "Big")
1157 -- << std::endl;
1158 --
1159 -- std::cout << " Available:\t\t\t\t\t "
1160 -- << (device.getInfo<CL_DEVICE_AVAILABLE>() ? "Yes" : "No")
1161 -- << std::endl;
1162 --
1163 -- std::cout << " Compiler available:\t\t\t\t "
1164 -- << (device.getInfo<CL_DEVICE_COMPILER_AVAILABLE>() ? "Yes" : "No")
1165 -- << std::endl;
1166 --
1167 -- std::cout << " Execution capabilities:\t\t\t\t " << std::endl;
1168 -- std::cout << " Execute OpenCL kernels:\t\t\t "
1169 -- << (device.getInfo<CL_DEVICE_EXECUTION_CAPABILITIES>() &
1170 -- CL_EXEC_KERNEL ? "Yes" : "No")
1171 -- << std::endl;
1172 -- std::cout << " Execute native function:\t\t\t "
1173 -- << (device.getInfo<CL_DEVICE_EXECUTION_CAPABILITIES>() &
1174 -- CL_EXEC_NATIVE_KERNEL ? "Yes" : "No")
1175 -- << std::endl;
1176 --
1177 -- std::cout << " Queue on Host properties:\t\t\t\t " << std::endl;
1178 -- std::cout << " Out-of-Order:\t\t\t\t "
1179 -- << (device.getInfo<CL_DEVICE_QUEUE_ON_HOST_PROPERTIES>() &
1180 -- CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE ? "Yes" : "No")
1181 -- << std::endl;
1182 -- std::cout << " Profiling :\t\t\t\t\t "
1183 -- << (device.getInfo<CL_DEVICE_QUEUE_ON_HOST_PROPERTIES>() &
1184 -- CL_QUEUE_PROFILING_ENABLE ? "Yes" : "No")
1185 -- << std::endl;
1186 --
1187 --#ifdef CL_VERSION_2_0
1188 -- if(vStrVal.compare("2") > 0)
1189 -- {
1190 -- std::cout << " Queue on Device properties:\t\t\t\t " << std::endl;
1191 -- std::cout << " Out-of-Order:\t\t\t\t "
1192 -- << (device.getInfo<CL_DEVICE_QUEUE_ON_DEVICE_PROPERTIES>() &
1193 -- CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE ? "Yes" : "No")
1194 -- << std::endl;
1195 -- std::cout << " Profiling :\t\t\t\t\t "
1196 -- << (device.getInfo<CL_DEVICE_QUEUE_ON_DEVICE_PROPERTIES>() &
1197 -- CL_QUEUE_PROFILING_ENABLE ? "Yes" : "No")
1198 -- << std::endl;
1199 -- }
1200 --#endif
1201 --
1202 -- std::cout << " Platform ID:\t\t\t\t\t "
1203 -- << device.getInfo<CL_DEVICE_PLATFORM>()
1204 -- << std::endl;
1205 --
1206 -- std::cout << " Name:\t\t\t\t\t\t "
1207 -- << device.getInfo<CL_DEVICE_NAME>().c_str()
1208 -- << std::endl;
1209 --
1210 -- std::cout << " Vendor:\t\t\t\t\t "
1211 -- << device.getInfo<CL_DEVICE_VENDOR>().c_str()
1212 -- << std::endl;
1213 --#ifdef CL_VERSION_1_1
1214 -- if(vStrVal.compare("1.0") > 0)
1215 -- {
1216 -- std::cout << " Device OpenCL C version:\t\t\t "
1217 -- << device.getInfo<CL_DEVICE_OPENCL_C_VERSION>().c_str()
1218 -- << std::endl;
1219 -- }
1220 --#endif // CL_VERSION_1_1
1221 -- std::cout << " Driver version:\t\t\t\t "
1222 -- << device.getInfo<CL_DRIVER_VERSION>().c_str()
1223 -- << std::endl;
1224 --
1225 -- std::cout << " Profile:\t\t\t\t\t "
1226 -- << device.getInfo<CL_DEVICE_PROFILE>().c_str()
1227 -- << std::endl;
1228 --
1229 -- std::cout << " Version:\t\t\t\t\t "
1230 -- << device.getInfo<CL_DEVICE_VERSION>().c_str()
1231 -- << std::endl;
1232 --
1233 --
1234 -- std::cout << " Extensions:\t\t\t\t\t "
1235 -- << device.getInfo<CL_DEVICE_EXTENSIONS>().c_str()
1236 -- << std::endl;
1237 --
1238 -- std::cout << std::endl << std::endl;
1239 -- }
1240 -- }
1241 -- }
1242 -- catch (cl::Error err)
1243 -- {
1244 -- std::cerr
1245 -- << "ERROR: "
1246 -- << err.what()
1247 -- << "("
1248 -- << err.err()
1249 -- << ")"
1250 -- << std::endl;
1251 -- return EXIT_FAILURE;
1252 -- }
1253 --
1254 -- return EXIT_SUCCESS;
1255 --}
1256
1257 diff --git a/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-change-install-location.patch b/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-change-install-location.patch
1258 deleted file mode 100644
1259 index 0679da4d639..00000000000
1260 --- a/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-change-install-location.patch
1261 +++ /dev/null
1262 @@ -1,146 +0,0 @@
1263 -diff --git a/CMakeLists.txt b/CMakeLists.txt
1264 -index 83575a3..a0526d1 100644
1265 ---- a/CMakeLists.txt
1266 -+++ b/CMakeLists.txt
1267 -@@ -28,12 +28,26 @@ endif()
1268 -
1269 - project(OpenCL-ROCm)
1270 -
1271 -+include (GNUInstallDirs)
1272 -+
1273 - set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
1274 - set(OPENCL_ICD_LOADER_HEADERS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/api/opencl/khronos/headers/opencl2.2" CACHE PATH "")
1275 -
1276 - find_package(ROCT REQUIRED)
1277 - find_package(ROCR REQUIRED)
1278 -
1279 -+find_package(LLVM REQUIRED CONFIG PATHS ${LLVM_DIR} "/opt/rocm/llvm" NO_DEFAULT_PATH)
1280 -+set(USE_COMGR_LIBRARY "yes")
1281 -+find_package(amd_comgr REQUIRED CONFIG)
1282 -+add_definitions(-DUSE_COMGR_LIBRARY)
1283 -+FOREACH(DIR ${LLVM_INCLUDE_DIRS})
1284 -+ include_directories("${DIR}")
1285 -+ include_directories("${DIR}/clang")
1286 -+ include_directories("${DIR}/lld")
1287 -+ # TODO: move AMDGPU.h header to include folder
1288 -+ include_directories("${DIR}/llvm/Target/AMDGPU")
1289 -+ENDFOREACH()
1290 -+
1291 - # FIXME: Remove following if block after enabling COMGR by default
1292 - if (${USE_COMGR_LIBRARY} STREQUAL "no")
1293 - set(LLVM_INCLUDE_TESTS OFF CACHE BOOL "")
1294 -@@ -46,29 +60,19 @@ if (${USE_COMGR_LIBRARY} STREQUAL "no")
1295 - # override default option value in library and driver
1296 - set(GENERIC_IS_ZERO ON CACHE BOOL ON FORCE)
1297 -
1298 -- add_subdirectory(compiler/llvm EXCLUDE_FROM_ALL)
1299 --
1300 -- find_package(LLVM REQUIRED CONFIG PATHS ${CMAKE_BINARY_DIR}/compiler/llvm NO_DEFAULT_PATH)
1301 -+ find_package(LLVM REQUIRED CONFIG PATHS ${LLVM_DIR} "/opt/rocm/llvm" NO_DEFAULT_PATH)
1302 -
1303 - list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
1304 - include(AddLLVM)
1305 -
1306 - add_definitions(${LLVM_DEFINITIONS})
1307 -- # TODO: add find_package for Clang and lld, and also use LLVM/Clang variables got from their config
1308 -- include_directories(${CMAKE_SOURCE_DIR}/compiler/llvm/tools/clang/include)
1309 -- include_directories(${CMAKE_BINARY_DIR}/compiler/llvm/tools/clang/include)
1310 -- include_directories(${CMAKE_SOURCE_DIR}/compiler/llvm/tools/lld/include)
1311 --
1312 -- # TODO: move AMDGPU.h header to include folder
1313 -- include_directories(${CMAKE_SOURCE_DIR}/compiler/llvm/lib/Target/AMDGPU)
1314 -- include_directories(${CMAKE_BINARY_DIR}/compiler/llvm/lib/Target/AMDGPU)
1315 -
1316 - set(BUILD_HC_LIB OFF CACHE BOOL "")
1317 - set(ROCM_DEVICELIB_INCLUDE_TESTS OFF CACHE BOOL "")
1318 - set(AMDGCN_TARGETS_LIB_LIST "AMDGCN_LIB_TARGETS")
1319 - set(AMDGCN_TARGETS_LIB_DEPS "AMDGCN_DEP_TARGETS")
1320 - set(AMDGPU_TARGET_TRIPLE "amdgcn-amd-amdhsa")
1321 -- add_subdirectory(library/amdgcn EXCLUDE_FROM_ALL)
1322 -+
1323 - add_subdirectory(compiler/driver EXCLUDE_FROM_ALL)
1324 -
1325 - install(PROGRAMS $<TARGET_FILE:clang> $<TARGET_FILE:lld>
1326 -@@ -84,51 +88,51 @@ if (${USE_COMGR_LIBRARY} STREQUAL "no")
1327 - endforeach()
1328 - endif() # if (${USE_COMGR_LIBRARY} STREQUAL "no")
1329 -
1330 --if(${USE_COMGR_LIBRARY} MATCHES "yes")
1331 -- set(COMGR_DYN_DLL "yes")
1332 -- add_definitions(-DCOMGR_DYN_DLL)
1333 -- add_definitions(-DUSE_COMGR_LIBRARY)
1334 -- if( ${BUILD_HIP} MATCHES "yes")
1335 -- add_subdirectory(api/hip)
1336 -- endif()
1337 --endif()
1338 -+#if(${USE_COMGR_LIBRARY} MATCHES "yes")
1339 -+# set(COMGR_DYN_DLL "yes")
1340 -+# add_definitions(-DCOMGR_DYN_DLL)
1341 -+# add_definitions(-DUSE_COMGR_LIBRARY)
1342 -+# if( ${BUILD_HIP} MATCHES "yes")
1343 -+# add_subdirectory(api/hip)
1344 -+# endif()
1345 -+#endif()
1346 -
1347 - add_subdirectory(api/opencl/amdocl)
1348 - add_subdirectory(compiler/lib/loaders/elf/utils/libelf)
1349 - add_subdirectory(runtime)
1350 --add_subdirectory(tools/clinfo)
1351 -+#add_subdirectory(tools/clinfo)
1352 -
1353 - set(BUILD_SHARED_LIBS "Build shared libs" ON)
1354 --add_subdirectory(api/opencl/khronos/icd)
1355 -+#add_subdirectory(api/opencl/khronos/icd)
1356 -
1357 - ###--- Packaging ------------------------------------------------------------###
1358 -
1359 - # MAIN package
1360 --install(PROGRAMS $<TARGET_FILE:clinfo>
1361 -- DESTINATION bin/x86_64
1362 -- COMPONENT MAIN)
1363 -+#install(PROGRAMS $<TARGET_FILE:clinfo>
1364 -+# DESTINATION bin/x86_64
1365 -+# COMPONENT MAIN)
1366 - install(PROGRAMS $<TARGET_FILE:amdocl64>
1367 -- DESTINATION lib/x86_64
1368 -- COMPONENT MAIN)
1369 --install(PROGRAMS $<TARGET_FILE:OpenCL>
1370 -- DESTINATION lib/x86_64
1371 -- COMPONENT MAIN)
1372 --install(PROGRAMS $<TARGET_SONAME_FILE:OpenCL>
1373 -- DESTINATION lib/x86_64
1374 -+ DESTINATION lib64
1375 - COMPONENT MAIN)
1376 -+#install(PROGRAMS $<TARGET_FILE:OpenCL>
1377 -+# DESTINATION lib/x86_64
1378 -+# COMPONENT MAIN)
1379 -+#install(PROGRAMS $<TARGET_SONAME_FILE:OpenCL>
1380 -+# DESTINATION lib/x86_64
1381 -+# COMPONENT MAIN)
1382 -
1383 - # DEV package
1384 --install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/api/opencl/khronos/headers/opencl2.2/CL"
1385 -- DESTINATION include
1386 -- COMPONENT DEV
1387 -- USE_SOURCE_PERMISSIONS
1388 -- PATTERN cl_d3d10.h EXCLUDE
1389 -- PATTERN cl_d3d11.h EXCLUDE
1390 -- PATTERN cl_dx9_media_sharing.h EXCLUDE
1391 -- PATTERN cl_egl.h EXCLUDE)
1392 --install(PROGRAMS $<TARGET_LINKER_FILE:OpenCL>
1393 -- DESTINATION lib/x86_64
1394 -- COMPONENT DEV)
1395 -+#install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/api/opencl/khronos/headers/opencl2.2/CL"
1396 -+# DESTINATION include
1397 -+# COMPONENT DEV
1398 -+# USE_SOURCE_PERMISSIONS
1399 -+# PATTERN cl_d3d10.h EXCLUDE
1400 -+# PATTERN cl_d3d11.h EXCLUDE
1401 -+# PATTERN cl_dx9_media_sharing.h EXCLUDE
1402 -+# PATTERN cl_egl.h EXCLUDE)
1403 -+#install(PROGRAMS $<TARGET_LINKER_FILE:OpenCL>
1404 -+# DESTINATION lib/x86_64
1405 -+# COMPONENT DEV)
1406 -
1407 - # Generic CPACK variables
1408 - set(CPACK_GENERATOR "DEB;RPM" CACHE STRING "Default packaging generators")