summaryrefslogtreecommitdiff
path: root/dev-libs/rocm-opencl-runtime
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-10-13 22:19:36 +0100
committerV3n3RiX <venerix@redcorelinux.org>2019-10-14 23:22:23 +0100
commit4b19be30aa626b327c885dae62c559ec0e9fb935 (patch)
tree76e74807bc479502e13866b581b6bf86734ec634 /dev-libs/rocm-opencl-runtime
parent30d6f67c98d149508509d5e86f176d558793acc0 (diff)
gentoo resync : 13.10.2019
Diffstat (limited to 'dev-libs/rocm-opencl-runtime')
-rw-r--r--dev-libs/rocm-opencl-runtime/Manifest10
-rw-r--r--dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-amdocl64icd.patch13
-rw-r--r--dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-change-AMDCompilerh.patch79
-rw-r--r--dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-change-install-location.patch146
-rw-r--r--dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-change-opencl.patch70
-rw-r--r--dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-update-README.patch41
-rw-r--r--dev-libs/rocm-opencl-runtime/rocm-opencl-runtime-2.8.0.ebuild57
-rw-r--r--dev-libs/rocm-opencl-runtime/rocm-opencl-runtime-2.9.0.ebuild57
8 files changed, 473 insertions, 0 deletions
diff --git a/dev-libs/rocm-opencl-runtime/Manifest b/dev-libs/rocm-opencl-runtime/Manifest
index a75041444363..fe5f95990e61 100644
--- a/dev-libs/rocm-opencl-runtime/Manifest
+++ b/dev-libs/rocm-opencl-runtime/Manifest
@@ -1,5 +1,15 @@
AUX rocm-opencl-runtime-2.6.0-unbundle-dependencies.patch 56337 BLAKE2B bfb8265b4c901d9c71c8bacae34e43f9e951be3b7c2feb0eb76d9ceb62535a8924882c9383b7e7abf71f8aa6d22da9c78f46b9d7ba5c10e9127f05b922e85187 SHA512 660b4fd2d0d0a1aee5a3683806b5f2491bfb551101c569a297b4fd32ded507787e98cd3fea85e9f9ad4476324da407a5d527bc967e43582fc8edf9eac5caa614
+AUX rocm-opencl-runtime-2.8.0-amdocl64icd.patch 582 BLAKE2B 28e97a03f6696503b1ddc3d1720d3aa9f4e807b2e5fd01771e81f3bda61350cc580e961a90ed07499a8625ea6178e34e15f117115719a6bf04046c758eb95f46 SHA512 938abe8eadcef1d703c797f1716c5588dbe0267d5bb1e3eeb0e46b5fc52f6976751348f402332d07f3c56007e64dac672112170fc33c13cb4314a2a299735142
+AUX rocm-opencl-runtime-2.8.0-change-AMDCompilerh.patch 2778 BLAKE2B 5fe2c74631db679788767a4488d2157660e0c1c1e4291165e1d0c52c29c8d976ff5b2f691ff128ec49778d0cc2855bcfc73c3dfc0ed831d3fac114445e272408 SHA512 8c34c570957b5f25f9347b50baf47342f84f6a398e77f7b9d007d2861947b70dace27ae016c23a7959a6d936fdbe24980acc1a253a7bcaff95eea11283c89901
+AUX rocm-opencl-runtime-2.8.0-change-install-location.patch 5344 BLAKE2B f634d0d3c7f3d54e6fc30ba1228575e6ba95fda21ca63bcf4745d3d9ac8ec6eb6b0a02aab4f7ca7d5e50db61ed567073dadf84d028f5f77314cba4b57b2db480 SHA512 d5bf8459e1ceed074042664ce66608de8806b274ad12f4d1dd3487b0eb82a34295ad85c490d93d3392b82be98fe7077f78320825015df76c5d9f87a3a28e1e55
+AUX rocm-opencl-runtime-2.8.0-change-opencl.patch 3886 BLAKE2B e9833c8486757214876aba32f52722189497e5a1975cd6f7a4d64388a9cd52bfcf114625906b671cf73de052e42101ab3be7a43562c2983fe9e2ccfece3b83c8 SHA512 ae49608277493259d1348c8bce912b4d489a9edb16b0e6460336f4468530460362b2e95ac85c57543edfb8ed57b93e01f73a9b3e9012a8a333eba9eb52d80d8f
+AUX rocm-opencl-runtime-2.8.0-update-README.patch 1263 BLAKE2B f6fb48bc8ea55480c157d0963b859b47acd914adc77a1ba2780b058f50dbe820100355ec2f73badc6e0618c0b2fb39285b6589587efcf2ded1b9cce62354ec7c SHA512 4351eb77a2d5f7cdf8e014965428624b35a2314edb63f65a34f5939fab9975733b3cfa4f70a8bee2e1c3368c6ed6bbbd568a941ed370b5a9a07cc347795577df
+DIST OpenCL-ICD-Loader-6c03f8b58fafd9dd693eaac826749a5cfad515f8.tar.gz 63248 BLAKE2B 7c311d98e5a209d01f1f1dbad7471ceb3de66e10f7cee48686ed176efcde1e7ba48ea12bdbf2af61d5f72e5b8eda69b2fae6829d265a8b88ad46c4ec4995d8d4 SHA512 5033d6fb0ef2515e56b0d9c31baf6fe02e90613989c417fbde20efd79e0ac2841df1a98ff799e60cc469b79244cdc756d15950df6c9baead7d31febe7cad0418
DIST OpenCL-ICD-Loader-bc9728edf8cace79cf33bf75560be88fc2432dc4.tar.gz 62858 BLAKE2B 931fb7ade12debda99512d8b9fbfb987f47e3b68568863e480de406f842a014d39f0321c44420fb8b68b8757d49cc02cadf82e767c9d2b71e53bdb8e9763cace SHA512 2ab9035fbc0a80a529d1b2f454b0b9a263b6eff601121750e81e2e32581f06189566cdcf201ab741ff3f1491ead825a7858000901f8042af67b1304be622e9fa
DIST rocm-opencl-runtime-2.6.0.tar.gz 986155 BLAKE2B 43469ec3a368e2ee9716a38d08df48c28165a233bd80de54f286011df25782a197e252e8e41ffa8f59eecf93d6beae5434497e8d4b648676252d32a0859ba59a SHA512 bbbbd29bf23f93440135786600cca28a806714bb207b7ad0947d26471fa38470820e7801acc84380000d43d55ff2ec1d95cee9e64b500628b6a3b026744c67df
+DIST rocm-opencl-runtime-2.8.0.tar.gz 976851 BLAKE2B 4191c2f027f615a8ba7a38d30364549df509e6bd432e5bfe3d30d40fb6bade15b58fe824b5aa9704e5d93421f28e1067d283738fa85e7ec59a444f5be25c963c SHA512 6c070d3e2f455d96f028f614f0562c0b8983b457c6295c398d6d4574133d4a7384573caa1f32e39550887861aa09aa19c9e34fc8bbae6ddc41ae395969d33540
+DIST rocm-opencl-runtime-2.9.0.tar.gz 980980 BLAKE2B b72c9659ca8ac6b12d0c5c8c204a2a481c9e057e1b6aa80e24b57e141538c345025bfe74143ee2450bb013ff1b45a314538965fdc071a6e925967368baabfb94 SHA512 9d9742da94d4dd7326e6f64042418726f8fcaa05b3a02b6a7760b2f17067747a2a5f37183a4245697211ceb21e4fa0870dfeca9970b4fd3794985311d6ff7d0f
EBUILD rocm-opencl-runtime-2.6.0-r1.ebuild 1483 BLAKE2B 7271f4b536f08c31031d4e4a38a5b9741cbd7d24799c508205dd3c9f39905173426aac248528864c41de8598bc798c55999c2c1c79d44c7ec84909dc0090a892 SHA512 81180ca79e5d5d4b3b1518f3e7a1947ff57abfb50c71006511a08f15e1d94761496eb8e8c36b76a8493bc2ac1ac43ea836c8663e1130c03b4df638d012aed49c
+EBUILD rocm-opencl-runtime-2.8.0.ebuild 1758 BLAKE2B 2dfefc99a572eed6ba4283aa11afd45716145000599967d43e77dfb6b61fb0c61a801d44f4d389b4f69a84928f1328adbe0c0cced46f3ad73ce8f2947963ebc0 SHA512 ba6ecbe7d355c4494bc68a0c1dbb4760147cb4c8ae43977055635a1f5e4d83054aef90f784db55b14af32af709077902a8a90bf776fb6b8d0949ff1db944a87a
+EBUILD rocm-opencl-runtime-2.9.0.ebuild 1793 BLAKE2B 9b3909bced5bfbf8bbd352eb07b461ed56537738ab78aa6ea3c2636d8249fce0666ae15014732b3bdeac87a307aeaa0ddaf7d3f1b5811d46dd3f8b2f06aa8148 SHA512 87b6780b899bb1642855e6191d632746e037e9424260c57a5577cad279cf6510ba370107664315971a30459b7b2cb10abce936d3ebbb2e2d30deec41ba5dc1e1
MISC metadata.xml 489 BLAKE2B d989103f6ed0e6a7406558565a5d0453046f640fbef964eb84e51fc911dac4bcc57bc3f1c5222bb5f6d2fb6d10a7f83b4172161070029b0d537b475ef8473f04 SHA512 3bfb9c1ed4cd559aefaf7a74567daf0952359a9fa3e703f1dfaac48d9bb7a25d134afe16e7509c28dff8a5cdabe09870d8f541898756c028b5c5996577956f0a
diff --git a/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-amdocl64icd.patch b/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-amdocl64icd.patch
new file mode 100644
index 000000000000..f399f360c9cf
--- /dev/null
+++ b/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-amdocl64icd.patch
@@ -0,0 +1,13 @@
+diff --git a/api/opencl/amdocl/CMakeLists.txt b/api/opencl/amdocl/CMakeLists.txt
+index 8ea8517..d1223ed 100644
+--- a/api/opencl/amdocl/CMakeLists.txt
++++ b/api/opencl/amdocl/CMakeLists.txt
+@@ -82,3 +82,7 @@ if(${USE_COMGR_LIBRARY} MATCHES "yes")
+ else()
+ target_link_libraries(amdocl64 opencl_driver oclelf pthread dl ${ROCT_LIBRARIES} ${ROCR_LIBRARIES})
+ endif()
++
++file(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/amdocl64.icd" CONTENT "$<TARGET_FILE_NAME:amdocl64>")
++install(FILES "${CMAKE_BINARY_DIR}/amdocl64.icd" DESTINATION "${CMAKE_INSTALL_FULL_SYSCONFDIR}/OpenCL/vendors/")
++
+
diff --git a/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-change-AMDCompilerh.patch b/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-change-AMDCompilerh.patch
new file mode 100644
index 000000000000..796277e46723
--- /dev/null
+++ b/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-change-AMDCompilerh.patch
@@ -0,0 +1,79 @@
+diff --git a/runtime/device/device.hpp b/runtime/device/device.hpp
+index 9eb45b2..a721463 100644
+--- a/runtime/device/device.hpp
++++ b/runtime/device/device.hpp
+@@ -21,7 +21,7 @@
+
+ #if defined(WITH_LIGHTNING_COMPILER) && !defined(USE_COMGR_LIBRARY)
+ #include "caching/cache.hpp"
+-#include "driver/AmdCompiler.h"
++#include "AmdCompiler.h"
+ #endif // defined(WITH_LIGHTNING_COMPILER) && ! defined(USE_COMGR_LIBRARY)
+ #include "acl.h"
+
+diff --git a/runtime/device/devprogram.cpp b/runtime/device/devprogram.cpp
+index 587e950..dc233f3 100644
+--- a/runtime/device/devprogram.cpp
++++ b/runtime/device/devprogram.cpp
+@@ -14,7 +14,7 @@
+
+ #if defined(WITH_LIGHTNING_COMPILER) || defined(USE_COMGR_LIBRARY)
+ #ifndef USE_COMGR_LIBRARY
+-#include "driver/AmdCompiler.h"
++#include "AmdCompiler.h"
+ #include "libraries.amdgcn.inc"
+ #include "opencl1.2-c.amdgcn.inc"
+ #include "opencl2.0-c.amdgcn.inc"
+diff --git a/runtime/device/devprogram.hpp b/runtime/device/devprogram.hpp
+index 68de7ba..8b91ba2 100644
+--- a/runtime/device/devprogram.hpp
++++ b/runtime/device/devprogram.hpp
+@@ -11,7 +11,7 @@
+
+ #if defined(WITH_LIGHTNING_COMPILER) || defined(USE_COMGR_LIBRARY)
+ #ifndef USE_COMGR_LIBRARY
+-#include "driver/AmdCompiler.h"
++#include "AmdCompiler.h"
+ #else
+ #include "amd_comgr.h"
+ #endif
+diff --git a/runtime/device/rocm/rocdevice.cpp b/runtime/device/rocm/rocdevice.cpp
+index 4cba9d7..7ab30ed 100644
+--- a/runtime/device/rocm/rocdevice.cpp
++++ b/runtime/device/rocm/rocdevice.cpp
+@@ -20,7 +20,7 @@
+ #include "device/rocm/rocvirtual.hpp"
+ #include "device/rocm/rocprogram.hpp"
+ #if defined(WITH_LIGHTNING_COMPILER) && ! defined(USE_COMGR_LIBRARY)
+-#include "driver/AmdCompiler.h"
++#include "AmdCompiler.h"
+ #endif // defined(WITH_LIGHTNING_COMPILER) && ! defined(USE_COMGR_LIBRARY)
+ #include "device/rocm/rocmemory.hpp"
+ #include "device/rocm/rocglinterop.hpp"
+diff --git a/runtime/device/rocm/rockernel.cpp b/runtime/device/rocm/rockernel.cpp
+index 8a28acc..7d5b62d 100644
+--- a/runtime/device/rocm/rockernel.cpp
++++ b/runtime/device/rocm/rockernel.cpp
+@@ -11,7 +11,7 @@
+
+ #if defined(WITH_LIGHTNING_COMPILER) || defined(USE_COMGR_LIBRARY)
+ #ifndef USE_COMGR_LIBRARY
+-#include "driver/AmdCompiler.h"
++#include "AmdCompiler.h"
+ #endif
+ #include "llvm/Support/AMDGPUMetadata.h"
+
+diff --git a/runtime/device/rocm/rocprogram.cpp b/runtime/device/rocm/rocprogram.cpp
+index 0155dc2..613d00d 100644
+--- a/runtime/device/rocm/rocprogram.cpp
++++ b/runtime/device/rocm/rocprogram.cpp
+@@ -10,7 +10,7 @@
+ #if defined(WITH_LIGHTNING_COMPILER) || defined(USE_COMGR_LIBRARY)
+ #include <gelf.h>
+ #ifndef USE_COMGR_LIBRARY
+-#include "driver/AmdCompiler.h"
++#include "AmdCompiler.h"
+ #include "libraries.amdgcn.inc"
+ #endif
+ #endif // defined(WITH_LIGHTNING_COMPILER) || defined(USE_COMGR_LIBRARY)
+
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
new file mode 100644
index 000000000000..0679da4d639a
--- /dev/null
+++ b/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-change-install-location.patch
@@ -0,0 +1,146 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 83575a3..a0526d1 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -28,12 +28,26 @@ endif()
+
+ project(OpenCL-ROCm)
+
++include (GNUInstallDirs)
++
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
+ set(OPENCL_ICD_LOADER_HEADERS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/api/opencl/khronos/headers/opencl2.2" CACHE PATH "")
+
+ find_package(ROCT REQUIRED)
+ find_package(ROCR REQUIRED)
+
++find_package(LLVM REQUIRED CONFIG PATHS ${LLVM_DIR} "/opt/rocm/llvm" NO_DEFAULT_PATH)
++set(USE_COMGR_LIBRARY "yes")
++find_package(amd_comgr REQUIRED CONFIG)
++add_definitions(-DUSE_COMGR_LIBRARY)
++FOREACH(DIR ${LLVM_INCLUDE_DIRS})
++ include_directories("${DIR}")
++ include_directories("${DIR}/clang")
++ include_directories("${DIR}/lld")
++ # TODO: move AMDGPU.h header to include folder
++ include_directories("${DIR}/llvm/Target/AMDGPU")
++ENDFOREACH()
++
+ # FIXME: Remove following if block after enabling COMGR by default
+ if (${USE_COMGR_LIBRARY} STREQUAL "no")
+ set(LLVM_INCLUDE_TESTS OFF CACHE BOOL "")
+@@ -46,29 +60,19 @@ if (${USE_COMGR_LIBRARY} STREQUAL "no")
+ # override default option value in library and driver
+ set(GENERIC_IS_ZERO ON CACHE BOOL ON FORCE)
+
+- add_subdirectory(compiler/llvm EXCLUDE_FROM_ALL)
+-
+- find_package(LLVM REQUIRED CONFIG PATHS ${CMAKE_BINARY_DIR}/compiler/llvm NO_DEFAULT_PATH)
++ find_package(LLVM REQUIRED CONFIG PATHS ${LLVM_DIR} "/opt/rocm/llvm" NO_DEFAULT_PATH)
+
+ list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
+ include(AddLLVM)
+
+ add_definitions(${LLVM_DEFINITIONS})
+- # TODO: add find_package for Clang and lld, and also use LLVM/Clang variables got from their config
+- include_directories(${CMAKE_SOURCE_DIR}/compiler/llvm/tools/clang/include)
+- include_directories(${CMAKE_BINARY_DIR}/compiler/llvm/tools/clang/include)
+- include_directories(${CMAKE_SOURCE_DIR}/compiler/llvm/tools/lld/include)
+-
+- # TODO: move AMDGPU.h header to include folder
+- include_directories(${CMAKE_SOURCE_DIR}/compiler/llvm/lib/Target/AMDGPU)
+- include_directories(${CMAKE_BINARY_DIR}/compiler/llvm/lib/Target/AMDGPU)
+
+ set(BUILD_HC_LIB OFF CACHE BOOL "")
+ set(ROCM_DEVICELIB_INCLUDE_TESTS OFF CACHE BOOL "")
+ set(AMDGCN_TARGETS_LIB_LIST "AMDGCN_LIB_TARGETS")
+ set(AMDGCN_TARGETS_LIB_DEPS "AMDGCN_DEP_TARGETS")
+ set(AMDGPU_TARGET_TRIPLE "amdgcn-amd-amdhsa")
+- add_subdirectory(library/amdgcn EXCLUDE_FROM_ALL)
++
+ add_subdirectory(compiler/driver EXCLUDE_FROM_ALL)
+
+ install(PROGRAMS $<TARGET_FILE:clang> $<TARGET_FILE:lld>
+@@ -84,51 +88,51 @@ if (${USE_COMGR_LIBRARY} STREQUAL "no")
+ endforeach()
+ endif() # if (${USE_COMGR_LIBRARY} STREQUAL "no")
+
+-if(${USE_COMGR_LIBRARY} MATCHES "yes")
+- set(COMGR_DYN_DLL "yes")
+- add_definitions(-DCOMGR_DYN_DLL)
+- add_definitions(-DUSE_COMGR_LIBRARY)
+- if( ${BUILD_HIP} MATCHES "yes")
+- add_subdirectory(api/hip)
+- endif()
+-endif()
++#if(${USE_COMGR_LIBRARY} MATCHES "yes")
++# set(COMGR_DYN_DLL "yes")
++# add_definitions(-DCOMGR_DYN_DLL)
++# add_definitions(-DUSE_COMGR_LIBRARY)
++# if( ${BUILD_HIP} MATCHES "yes")
++# add_subdirectory(api/hip)
++# endif()
++#endif()
+
+ add_subdirectory(api/opencl/amdocl)
+ add_subdirectory(compiler/lib/loaders/elf/utils/libelf)
+ add_subdirectory(runtime)
+-add_subdirectory(tools/clinfo)
++#add_subdirectory(tools/clinfo)
+
+ set(BUILD_SHARED_LIBS "Build shared libs" ON)
+-add_subdirectory(api/opencl/khronos/icd)
++#add_subdirectory(api/opencl/khronos/icd)
+
+ ###--- Packaging ------------------------------------------------------------###
+
+ # MAIN package
+-install(PROGRAMS $<TARGET_FILE:clinfo>
+- DESTINATION bin/x86_64
+- COMPONENT MAIN)
++#install(PROGRAMS $<TARGET_FILE:clinfo>
++# DESTINATION bin/x86_64
++# COMPONENT MAIN)
+ install(PROGRAMS $<TARGET_FILE:amdocl64>
+- DESTINATION lib/x86_64
+- COMPONENT MAIN)
+-install(PROGRAMS $<TARGET_FILE:OpenCL>
+- DESTINATION lib/x86_64
+- COMPONENT MAIN)
+-install(PROGRAMS $<TARGET_SONAME_FILE:OpenCL>
+- DESTINATION lib/x86_64
++ DESTINATION lib64
+ COMPONENT MAIN)
++#install(PROGRAMS $<TARGET_FILE:OpenCL>
++# DESTINATION lib/x86_64
++# COMPONENT MAIN)
++#install(PROGRAMS $<TARGET_SONAME_FILE:OpenCL>
++# DESTINATION lib/x86_64
++# COMPONENT MAIN)
+
+ # DEV package
+-install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/api/opencl/khronos/headers/opencl2.2/CL"
+- DESTINATION include
+- COMPONENT DEV
+- USE_SOURCE_PERMISSIONS
+- PATTERN cl_d3d10.h EXCLUDE
+- PATTERN cl_d3d11.h EXCLUDE
+- PATTERN cl_dx9_media_sharing.h EXCLUDE
+- PATTERN cl_egl.h EXCLUDE)
+-install(PROGRAMS $<TARGET_LINKER_FILE:OpenCL>
+- DESTINATION lib/x86_64
+- COMPONENT DEV)
++#install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/api/opencl/khronos/headers/opencl2.2/CL"
++# DESTINATION include
++# COMPONENT DEV
++# USE_SOURCE_PERMISSIONS
++# PATTERN cl_d3d10.h EXCLUDE
++# PATTERN cl_d3d11.h EXCLUDE
++# PATTERN cl_dx9_media_sharing.h EXCLUDE
++# PATTERN cl_egl.h EXCLUDE)
++#install(PROGRAMS $<TARGET_LINKER_FILE:OpenCL>
++# DESTINATION lib/x86_64
++# COMPONENT DEV)
+
+ # Generic CPACK variables
+ set(CPACK_GENERATOR "DEB;RPM" CACHE STRING "Default packaging generators")
diff --git a/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-change-opencl.patch b/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-change-opencl.patch
new file mode 100644
index 000000000000..cd6695e2d4f6
--- /dev/null
+++ b/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-change-opencl.patch
@@ -0,0 +1,70 @@
+diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt
+index 2c9dfd6..863b4bf 100644
+--- a/runtime/CMakeLists.txt
++++ b/runtime/CMakeLists.txt
+@@ -23,7 +23,6 @@ if (${USE_COMGR_LIBRARY} STREQUAL "no")
+ include_directories(${CMAKE_SOURCE_DIR}/compiler/llvm/include)
+ endif() # if (${USE_COMGR_LIBRARY} STREQUAL "no")
+
+-include_directories(${CMAKE_SOURCE_DIR}/compiler/driver/src)
+ include_directories(${CMAKE_SOURCE_DIR}/compiler/lib)
+ include_directories(${CMAKE_SOURCE_DIR}/compiler/lib/include)
+ include_directories(${CMAKE_SOURCE_DIR}/compiler/lib/backends/common)
+@@ -79,6 +78,8 @@ add_library(oclruntime OBJECT
+ ${COMGR_CPP}
+ )
+ set_target_properties(oclruntime PROPERTIES POSITION_INDEPENDENT_CODE ON)
++#add_dependencies(oclruntime opencl1.2-c.amdgcn.inc_target)
++#add_dependencies(oclruntime opencl2.0-c.amdgcn.inc_target)
+
+ set(AMDGCN_DEP_LIST)
+ if(AMDGCN_TARGETS_LIB_DEPS)
+diff --git a/runtime/device/rocm/CMakeLists.txt b/runtime/device/rocm/CMakeLists.txt
+index 5870b65..39166f3 100644
+--- a/runtime/device/rocm/CMakeLists.txt
++++ b/runtime/device/rocm/CMakeLists.txt
+@@ -1,3 +1,21 @@
++find_package(Clang REQUIRED CONFIG)
++
++# FIXME: CLANG_CMAKE_DIR seems like the most stable way to find this, but
++# really there is no way to reliably discover this header.
++#
++# We effectively back up to the Clang output directory (for the case of a build
++# tree) or install prefix (for the case of an installed copy), and then search
++# for a file named opencl-c.h anywhere below that. We take the first result in
++# the case where there are multiple (e.g. if there is an installed copy nested
++# in a build directory). This is a bit imprecise, but it covers cases like MSVC
++# adding some additional configuration-specific subdirectories to the build
++# tree but not to an installed copy.
++file(GLOB_RECURSE OPENCL_C_H_LIST "${CLANG_CMAKE_DIR}/../../../*/opencl-c.h")
++list(GET OPENCL_C_H_LIST 0 OPENCL_C_H)
++if (NOT EXISTS "${OPENCL_C_H}" OR IS_DIRECTORY "${OPENCL_C_H}")
++ message(FATAL_ERROR "Unable to locate opencl-c.h from the supplied Clang. The path '${CLANG_CMAKE_DIR}/../../../*' was searched.")
++endif()
++
+ include(bc2h)
+
+ set(INC_SUFFIX "amdgcn.inc")
+@@ -82,8 +100,8 @@ if (${USE_COMGR_LIBRARY} STREQUAL "no")
+
+ # generating opencl*.inc files
+ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/opencl1.2-c.amdgcn.pch
+- 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
+- DEPENDS clang ${CMAKE_SOURCE_DIR}/compiler/llvm/tools/clang/lib/Headers/opencl-c.h
++ 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}
++ DEPENDS clang ${OPENCL_C_H}
+ COMMENT "Generating opencl1.2-c.amdgcn.pch"
+ )
+ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/opencl1.2-c.amdgcn.inc
+@@ -96,8 +114,8 @@ if (${USE_COMGR_LIBRARY} STREQUAL "no")
+ add_dependencies(oclrocm opencl1.2-c.amdgcn.inc_target)
+
+ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/opencl2.0-c.amdgcn.pch
+- 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
+- DEPENDS clang ${CMAKE_SOURCE_DIR}/compiler/llvm/tools/clang/lib/Headers/opencl-c.h
++ 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}
++ DEPENDS clang ${OPENCL_C_H}
+ COMMENT "Generating opencl2.0-c.amdgcn.pch"
+ )
+ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/opencl2.0-c.amdgcn.inc
+
diff --git a/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-update-README.patch b/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-update-README.patch
new file mode 100644
index 000000000000..741faf20ca78
--- /dev/null
+++ b/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-2.8.0-update-README.patch
@@ -0,0 +1,41 @@
+diff --git a/README.md b/README.md
+index a834965..7fea026 100644
+--- a/README.md
++++ b/README.md
+@@ -8,12 +8,6 @@ Developer preview Version 2 of the new
+
+
+ ## GETTING REPO
+-
+-Repo is a git wrapper that manages a collection of git repositories. Install this tool and add it to the command search PATH:
+-
+- curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
+- chmod a+x ~/bin/repo
+-
+ ## GETTING THE SOURCE CODE
+
+ Main OpenCLâ„¢ Compatible Components:
+@@ -26,11 +20,6 @@ Main OpenCLâ„¢ Compatible Components:
+ * https://github.com/RadeonOpenCompute/lld
+ * https://github.com/KhronosGroup/OpenCL-ICD-Loader
+
+-Download the git projects with the following commands:
+-
+- ~/bin/repo init -u https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime.git -b master -m opencl.xml
+- ~/bin/repo sync
+-
+ ## INSTALL ROCm
+
+ Follow the instructions at https://rocm.github.io/install.html to install ROCm.
+@@ -45,6 +34,11 @@ Copy the amdocl64.icd file to /etc/OpenCL/vendors
+
+ To install additional dependencies:
+
++* ROCm-OpenCL-Runtime
++* ROCm-OpenCL-Driver
++* ROC versions of LLVM, Clang, and lld
++* ROCm-Device-Libs
++* OpenCL-ICD-Loade
+ * OCaml
+ * findlib
+ * A Python 2 environment or active virtualenv with the Microsoft Z3 package
diff --git a/dev-libs/rocm-opencl-runtime/rocm-opencl-runtime-2.8.0.ebuild b/dev-libs/rocm-opencl-runtime/rocm-opencl-runtime-2.8.0.ebuild
new file mode 100644
index 000000000000..b576f463c545
--- /dev/null
+++ b/dev-libs/rocm-opencl-runtime/rocm-opencl-runtime-2.8.0.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake-utils
+
+OPENCL_ICD_COMMIT="6c03f8b58fafd9dd693eaac826749a5cfad515f8"
+SRC_URI="https://github.com/KhronosGroup/OpenCL-ICD-Loader/archive/${OPENCL_ICD_COMMIT}.tar.gz -> OpenCL-ICD-Loader-${OPENCL_ICD_COMMIT}.tar.gz"
+if [[ ${PV} == *9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/"
+ inherit git-r3
+else
+ SRC_URI+=" https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/archive/roc-${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64"
+ S="${WORKDIR}/ROCm-OpenCL-Runtime-roc-${PV}"
+fi
+
+DESCRIPTION="Radeon Open Compute OpenCL Compatible Runtime"
+HOMEPAGE="https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime"
+
+LICENSE="Apache-2.0 MIT"
+SLOT="0/$(ver_cut 1-2)"
+
+RDEPEND=">=dev-libs/rocr-runtime-${PV}
+ >=dev-libs/rocm-comgr-${PV}
+ >=dev-libs/rocm-device-libs-${PV}
+ >=dev-libs/rocm-opencl-driver-${PV}
+ dev-libs/ocl-icd[khronos-headers]"
+DEPEND="${RDEPEND}
+ dev-lang/ocaml
+ dev-ml/findlib"
+
+PATCHES=(
+ "${FILESDIR}/${P}-change-install-location.patch"
+ "${FILESDIR}/${P}-change-AMDCompilerh.patch"
+ "${FILESDIR}/${P}-change-opencl.patch"
+ "${FILESDIR}/${P}-update-README.patch"
+ "${FILESDIR}/${P}-amdocl64icd.patch"
+)
+
+src_prepare() {
+ mkdir -p "${S}"/api/opencl/khronos/ || die
+ mv "${WORKDIR}/OpenCL-ICD-Loader-${OPENCL_ICD_COMMIT}" "${S}"/api/opencl/khronos/icd || die
+ [ -d tools/clinfo ] && rm -rf tools/clinfo || die
+ cmake-utils_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DUSE_COMGR_LIBRARY=yes
+ -DLLVM_DIR="${EPREFIX}/usr/lib/llvm/roc/"
+ -DClang_DIR="${EPREFIX}/usr/lib/llvm/roc/lib/cmake/clang/"
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/"
+ )
+ cmake-utils_src_configure
+}
diff --git a/dev-libs/rocm-opencl-runtime/rocm-opencl-runtime-2.9.0.ebuild b/dev-libs/rocm-opencl-runtime/rocm-opencl-runtime-2.9.0.ebuild
new file mode 100644
index 000000000000..f62a0a3951c2
--- /dev/null
+++ b/dev-libs/rocm-opencl-runtime/rocm-opencl-runtime-2.9.0.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake-utils
+
+OPENCL_ICD_COMMIT="6c03f8b58fafd9dd693eaac826749a5cfad515f8"
+SRC_URI="https://github.com/KhronosGroup/OpenCL-ICD-Loader/archive/${OPENCL_ICD_COMMIT}.tar.gz -> OpenCL-ICD-Loader-${OPENCL_ICD_COMMIT}.tar.gz"
+if [[ ${PV} == *9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/"
+ inherit git-r3
+else
+ SRC_URI+=" https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/archive/roc-${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64"
+ S="${WORKDIR}/ROCm-OpenCL-Runtime-roc-${PV}"
+fi
+
+DESCRIPTION="Radeon Open Compute OpenCL Compatible Runtime"
+HOMEPAGE="https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime"
+
+LICENSE="Apache-2.0 MIT"
+SLOT="0/$(ver_cut 1-2)"
+
+RDEPEND=">=dev-libs/rocr-runtime-${PV}
+ >=dev-libs/rocm-comgr-${PV}
+ >=dev-libs/rocm-device-libs-${PV}
+ >=dev-libs/rocm-opencl-driver-${PV}
+ dev-libs/ocl-icd[khronos-headers]"
+DEPEND="${RDEPEND}
+ dev-lang/ocaml
+ dev-ml/findlib"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-2.8.0-change-install-location.patch"
+ "${FILESDIR}/${PN}-2.8.0-change-AMDCompilerh.patch"
+ "${FILESDIR}/${PN}-2.8.0-change-opencl.patch"
+ "${FILESDIR}/${PN}-2.8.0-update-README.patch"
+ "${FILESDIR}/${PN}-2.8.0-amdocl64icd.patch"
+)
+
+src_prepare() {
+ mkdir -p "${S}"/api/opencl/khronos/ || die
+ mv "${WORKDIR}/OpenCL-ICD-Loader-${OPENCL_ICD_COMMIT}" "${S}"/api/opencl/khronos/icd || die
+ [ -d tools/clinfo ] && rm -rf tools/clinfo || die
+ cmake-utils_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DUSE_COMGR_LIBRARY=yes
+ -DLLVM_DIR="${EPREFIX}/usr/lib/llvm/roc/"
+ -DClang_DIR="${EPREFIX}/usr/lib/llvm/roc/lib/cmake/clang/"
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/"
+ )
+ cmake-utils_src_configure
+}