summaryrefslogtreecommitdiff
path: root/dev-libs/rocm-device-libs
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-06-27 07:59:40 +0100
committerV3n3RiX <venerix@koprulu.sector>2024-06-27 07:59:40 +0100
commitd2ed973482fdd800013658e83a61709b29e0a80f (patch)
tree57ea7666a57b5a05a4c8866e4915e90b4a6e7c94 /dev-libs/rocm-device-libs
parent9f6a82a85d400d6ae7de04c43cee88dbc6bc4da0 (diff)
gentoo auto-resync : 27:06:2024 - 07:59:39
Diffstat (limited to 'dev-libs/rocm-device-libs')
-rw-r--r--dev-libs/rocm-device-libs/Manifest14
-rw-r--r--dev-libs/rocm-device-libs/files/rocm-device-libs-5.5.0-test-bitcode-dir.patch37
-rw-r--r--dev-libs/rocm-device-libs/files/rocm-device-libs-5.5.1-remove-gfx700-tests.patch34
-rw-r--r--dev-libs/rocm-device-libs/files/rocm-device-libs-6.0.0-add-gws-attribute.patch22
-rw-r--r--dev-libs/rocm-device-libs/files/rocm-device-libs-6.1.0-fix-llvm-link.patch28
-rw-r--r--dev-libs/rocm-device-libs/files/rocm-device-libs-6.1.0-fix-test-failures.patch64
-rw-r--r--dev-libs/rocm-device-libs/files/rocm-device-libs-6.1.0-fix-test-failures2.patch44
-rw-r--r--dev-libs/rocm-device-libs/metadata.xml6
-rw-r--r--dev-libs/rocm-device-libs/rocm-device-libs-5.7.1.ebuild9
-rw-r--r--dev-libs/rocm-device-libs/rocm-device-libs-6.0.0.ebuild51
-rw-r--r--dev-libs/rocm-device-libs/rocm-device-libs-6.1.1.ebuild83
11 files changed, 335 insertions, 57 deletions
diff --git a/dev-libs/rocm-device-libs/Manifest b/dev-libs/rocm-device-libs/Manifest
index b0997dfcbeeb..09eeb44805e7 100644
--- a/dev-libs/rocm-device-libs/Manifest
+++ b/dev-libs/rocm-device-libs/Manifest
@@ -1,17 +1,23 @@
AUX rocm-device-libs-5.1.3-llvm-link.patch 694 BLAKE2B a67a1207bb23ceaa304f2fd59000a14a8bd232fd6eaf3510370f148b0bd18630ec4309a3d2ee2c5b8045114841a0548e840601abb153fb4adfc1209dd16b0509 SHA512 75f6fb5f3aab7f7951d110b9097a1521adb261f286b5e04867fd2753bbfcc29987440fd929c9dac0ac90fde98616ce7693c2b5041d4d07c437087ee17303a22e
AUX rocm-device-libs-5.1.3-test-bitcode-dir.patch 1181 BLAKE2B 0358dfc81ed98acd2a2bb399b7d8aa72c2a0bf20da3c45ad02d5e1c46df7f98bc18efe28867725e0fc1df041c1f1147bc25a2a5aa67b18f53d859dbf66aa71c7 SHA512 a0ffdda4ab42978f3b09bab424f91267bfc267f751d489aaee9c6eb3979ae5efd8130129e4b476fdcfbc73b779d9aad79fda60a8f7a64e8a5b35516d8fe6979f
AUX rocm-device-libs-5.4.3-Revert-Update-counters-for-gfx11.patch 6801 BLAKE2B ae3be5c1d8a7a84e8ddee2471628804365dd1d9b1ae3aa981b5e47015b82c115d5da5ea6fedcacc3ccf11c768af8130375493fdbcc9a53567e633cc57e7e750e SHA512 c28a08253025b150523282231c64e5d310206e6e406efdc2a0f39ce69b2f1663fed6991e27b2124eb3434c51efb8d172eceb752f366bc2aab7b3eb63ad9dfa35
+AUX rocm-device-libs-5.5.0-test-bitcode-dir.patch 1838 BLAKE2B f1fa6e0b69b5e4e6634cb92c7b9ad1f9621a1b639d27d8e4d15ceeeb79ba58cfc8a7bb17f354995d8e4e88b5a74aa09354b0b986c6e802b1d4eb58ba3905f1e5 SHA512 115b5ec119400e6cbc6293d3819bb1dbd67455c60ed7b8c63443603a1748c954e558d3ffcabe76c232f742ce52d6df9b3c647ce1289a78226fd1507e6497793d
AUX rocm-device-libs-5.5.1-fix-llvm-link.patch 681 BLAKE2B 1f28e1c92295caec2b50d576830ba896b82c92fe93db9243e4f397c9fde2de090e3f7f8c13ec8a0371d95978807642b433f4dc8b1644595da7f7576fe6b12a35 SHA512 6205cdb17692b4ebbce9f6a0e910c50ed9bd628d1863716f98e87857002399a3edbec3b9c50291c453262d0c169ed62ada5889fb1c735af04fd97623514e1fb2
+AUX rocm-device-libs-5.5.1-remove-gfx700-tests.patch 975 BLAKE2B 7b35ce4d8db4374e532bb3b77cb26d944d36b992b4649351de75084d5914a91becb17159328c9dd325043a1add1418b64b14be9e8e93a009140668cbbf8e7b88 SHA512 08e473c0067e2567d7ccb85eb8e333653e150a9fbca87b51d47f552baec60952a9a9fcbf1b26ad54f3560d8c87eede04f2b6801812f2f080ee61b3600bfa2fee
+AUX rocm-device-libs-6.0.0-add-gws-attribute.patch 581 BLAKE2B 40a8b66e44109a0d32c69ee76078c6ae8e45c52b1c3b8fb510040d8c616fbb552c0bfe77d5406a4a632cc0aca112292df2a720a5aba6fde63ad6853af613b565 SHA512 36b8851722e1fdc20de4ebc5875111017c0c80ba34263526f1228d3eb8fbb80ff6b458fecd665be9121a7c083f827343833481c53b221050446486139efdee40
+AUX rocm-device-libs-6.1.0-fix-llvm-link.patch 1089 BLAKE2B c14aa8fe06d351ba5ec75ae78a4fdd6a8c06bc4a2fff64214f2c28e538d33a07ad986743b5f7278fbaf771841766a368f44a0da17815461891fc09de81346842 SHA512 7ff795ff0db46331c001e5bb7cc7c0e671038f41596d0c3ed6da817146d169d9577c238cb2ecca3998e8a21fff0840e81760f3dd549dfaf1dbcb89ef8d9340a7
+AUX rocm-device-libs-6.1.0-fix-test-failures.patch 3232 BLAKE2B ae76a41e48192bc5cc940a7769b9f264cda742eab52870eeba730403440aa52580dde5d3c735e79e261c6d0b7a5ddac96dc590e547f7fbe1a3f369d08ab38229 SHA512 10905ddca80c6013561849920382f9716ad7d72080241a84aca568dd4ae43845e22627d309f6423f994f068dd64af1db52d64896aa66a79e4c803c093d44dcda
+AUX rocm-device-libs-6.1.0-fix-test-failures2.patch 1492 BLAKE2B a75aa720c1573111280c6fc07c2f5fef4b152116081b6c9eb25844efa9412680c6301f6e3150bd0334265ff76db38ace8a21a9abd6db42692387f04b1d5534d1 SHA512 b265327fa21ecbabbaca2270d8a7022ca46f2890b597683b827848a3d503d26ac7eeb1edb292387694730f6e86dc46a69209d8266ea7aa156266e96052a198ed
+DIST llvm-project-rocm-6.1.1.tar.gz 196027084 BLAKE2B 3ef0b6e3c47c66fd80289373e6ff8aaff44751f9b380addfae73a18dc388093c0535f230b0cc7528724bc43f6992e2ae6decd3d0d3c700893ca95a6166b7b8dc SHA512 e320d4eeaa6f61ed1cdbf653d67fe887d3ce9dc0d6743b4713502e1cb5318ab8afbe1ee71f8cba07635c54ce532df6683de40ade0e5be4a52e50ce25a9b70818
DIST rocm-device-libs-5.1.3.tar.gz 242862 BLAKE2B 68d66de897f461e9f876de5fe2214803d4c00665651dea6af0952f0ce579c6704a5ec41b08971fa613ade309a0a85cb611b56b592dc2a25e247183e634ea3378 SHA512 cc3dfb8d4b4841ba777355c537175259d0019159ff462358320674b85082cccd99f6462f60fee66228ddfb88fade043445c1bac62504aa1462ba61b7e2751de7
DIST rocm-device-libs-5.3.3.tar.gz 245690 BLAKE2B 475c0d818b8b0f090a8daeca2910cd4002e4cdf505d020327f46eb5f864a26937a6a3dfe4ff7b188ebda0f936b1c396f2163bb27b9e2a62c5976e60fa60856ac SHA512 8f6f2fc1534e348e02ba30a25cfc6017f8eab768968b5d0344a5ea7d65c4f0a874072f9e53919c74545814330602ef7c190753c7ff019137230e02f58a5d3a5d
DIST rocm-device-libs-5.4.3.tar.gz 246095 BLAKE2B eb749346c96d465a5f22831968ccbd71f02749e6aa0d9c2becc0f378641ca0f65c1a131bfd3ed226f838b4208091fcc920b1e31b427adbd69a42881898668e6a SHA512 67b904363a3cff6c15bbd032cbc72cb5cd5f82acaa68c74391dbcf415266e8f35486a496b69b69e1fc0721e0e4e21fb6a6b9c180a46cb59cdcf53916be846ca4
DIST rocm-device-libs-5.5.1.tar.gz 245900 BLAKE2B f713b1f12c7be33a4854d79791f592b8e89e2bc463769ec8cdd807483f0e5ca93d7fc852b6cf41d5ad0401d07adc97de9fb1fa54b77af83f665e282d6c0a43e7 SHA512 0138ddc94ce4a81202bdafccbbecef8145c6ddf82c3a14d92bb80b2bed3d3b73898f84279cef89110c50a9cc51e32de1323cc11a1f97c5da4f7f843b393425d0
DIST rocm-device-libs-5.7.1.tar.gz 248357 BLAKE2B 829704382e9420ad79724a250ccfd65278eb697498805297d1a52b8ea35dbff46e11514b681243d61bfac05b8a9734f0cf22d721603e48fe2f9864368222b0bc SHA512 8755d0584fa3b8239f5642b4fb8f5e8dea20bbaca2ff8883894d3583913e9a1fd1552492b36e8ceff092f795783b734e68b002ee0c93711dccdf8e72c528c27c
-DIST rocm-device-libs-6.0.0.tar.gz 248509 BLAKE2B 797a612f4b36b83643b15711bec32c1ceac73103b51d42abb890a241b8224b7c6de33bf88a9c6620db2af9be4641fc709b9610515203177482422c97d5b01044 SHA512 e9f2d7e86ec4cbcd0f471bf45d056c4a9272ee0ec3286a9aa42e819fa5d3ce52c9b12e9a4f575c409fe9b46253b8910f49d5ba0bae3694f8c38970658a19f706
EBUILD rocm-device-libs-5.1.3-r1.ebuild 1184 BLAKE2B bef07c38844eb218c333cf2fb0014881aff83837092dc62aa29d4971e9782da6a38a7db2dd599f6c8aff0c2bd60c94550d72300d8ee2a6db4ea2688820035803 SHA512 814009470618c7cea132ba28d3aa27eda6a55d65646efa54fc3ce0aa11e247af147f175956d2f7466474d891dd5aef80fe9adcc6bf871352d6f7c20c7f802832
EBUILD rocm-device-libs-5.3.3.ebuild 1184 BLAKE2B bef07c38844eb218c333cf2fb0014881aff83837092dc62aa29d4971e9782da6a38a7db2dd599f6c8aff0c2bd60c94550d72300d8ee2a6db4ea2688820035803 SHA512 814009470618c7cea132ba28d3aa27eda6a55d65646efa54fc3ce0aa11e247af147f175956d2f7466474d891dd5aef80fe9adcc6bf871352d6f7c20c7f802832
EBUILD rocm-device-libs-5.4.3.ebuild 1250 BLAKE2B 6013dd693a8120b5eeac654c9bad195428c34059eaef1bd40eaaf856f2edf331d8a3726fa46c077fe0aa62919f3ba68f518cfd9441d23020a06c293cd45f1042 SHA512 df101563920183c6a255f1461e718e28a01b4db355e3807c5a3e7b948627337950105deb7f77a857d489d9591c959909ad1e1957e4f21e3dffba08ee14514469
EBUILD rocm-device-libs-5.5.1.ebuild 1206 BLAKE2B 4e40b4f468a1f3f2bba04aff69de95796f4df079c737b17812a979531a70d62da394655e00d1956d2dd55248141b255a293c1e19fd189e0df3e168f2da9d4d1c SHA512 98a5d239e61f5690bed1af56f8d38f9e188d2f9a3e5c0409dab1afeda7b825b114037e5319daf650ba75916a15c16fef8bb3e61c63ef60255bfea95b4d34d44d
-EBUILD rocm-device-libs-5.7.1.ebuild 1200 BLAKE2B 73f4e2b7ddddec268593e20bd756deefeb6e6e4267a1598f7b705fc20614ef586124300a354253dedc3c21ebabc0824b0bfb393f73ed54130aa9ca27b72b9938 SHA512 8b07f529c2aed33a05675aa4d4f645f97da18bd3eaa8140535e1719fa130aa944ff81491bbd69a3815a448ca418a8270ef3a5ebc3fa6a4ebfce9dc3436ea3585
-EBUILD rocm-device-libs-6.0.0.ebuild 1218 BLAKE2B e05478acbc494ce5d28ffa6bbe8a17d9d81ae604216c2a0b7cfce92a0f1f1a221aa54f595c5f89ac106c3955f1361c0b64ceb2bfac8d7a449320f34abf179b12 SHA512 64744c196cfd11252431571ad77aca587fb94d9b7b3bbbd07b9b4082e0701227d3247c8d8f42158d92cdce2d632e5a1372bb18b4df04ddfa81cd3bba8a4bbf55
-MISC metadata.xml 378 BLAKE2B d4defdfb2ce3bab811d9c2ac75b92b7892d46d87dad9f89c26cde140b3b167b43bf4022128dee45e063e332d6dfafc3ee8d78b0112909a7ce2d4a4a44c6cfa14 SHA512 0732d51019f0d27ffb1ffea32d76cad8a6d82927cb8788ff983cdb8dcc472015dbe36ba568bda7459d0b32837e89e1a32064ab7dfcefd2b88458cbb4438f452a
+EBUILD rocm-device-libs-5.7.1.ebuild 1455 BLAKE2B 3185873cbed4c601d4d3b6b9142376a0af8c3d89718bf8e7a06215cfd9c25cefd956607f557cf721a3f9b68289b91212889d23888bffda7daf8d0c29b596c258 SHA512 f7db2da2818b9eaa4930dfac02e660e98a2b7dc5e326e1fde78acc98d5723a436052a628cf20254e5295a334980c9d350047503cb262ee4c9820d5ef889d170c
+EBUILD rocm-device-libs-6.1.1.ebuild 2249 BLAKE2B 0e118c5e35b8788affc6b20cbe2fd8473eeb8e1593c4e8b8a986cfcfe373cfdea367c267b0e4339dcb72759dadf75e742ddd696296576c7c61169c41f16440d0 SHA512 8a6a155224f845936279a0c33548d13253c66c9bc0c0b99399a82c69b611cebb76e2eea131dbcf74b6e6792e42c103f4e6f32582a2af25ccbd0567ec94ce6bea
+MISC metadata.xml 486 BLAKE2B 39c4a21b96ad471942a38d1c46b2600e3544729a87cd01c79606d495c595f271d5c04621ec581d2322686aca56de5d7c4b2b0d6125fc8db15b1236b2c093c8c9 SHA512 1a7d6570a687bb55877c6a5d9cbd7dc30a72ec0613b84e33be0982ff46b8d80d89e502e50364afdcc1022d7620fc10317a411b27c255caeafa2b45a85a43fd8c
diff --git a/dev-libs/rocm-device-libs/files/rocm-device-libs-5.5.0-test-bitcode-dir.patch b/dev-libs/rocm-device-libs/files/rocm-device-libs-5.5.0-test-bitcode-dir.patch
new file mode 100644
index 000000000000..2a307786edd5
--- /dev/null
+++ b/dev-libs/rocm-device-libs/files/rocm-device-libs-5.5.0-test-bitcode-dir.patch
@@ -0,0 +1,37 @@
+`--rocm-device-lib-path` is needed to execute the tests because they are not
+installed to system yet
+===================================================================
+--- ROCm-Device-Libs-rocm-6.0.0.orig/test/compile/CMakeLists.txt
++++ ROCm-Device-Libs-rocm-6.0.0/test/compile/CMakeLists.txt
+@@ -30,6 +30,7 @@ function(add_compile_test test_name func
+ -DFILECHECK_BIN=${FILECHECK_BIN}
+ -DOUTPUT_FILE=output.${name}.${test_cpu}.s
+ -DINPUT_FILE=${CMAKE_CURRENT_SOURCE_DIR}/${func_name}.cl
++ -DAMDGCN_BITCODES=${PROJECT_BINARY_DIR}/lib/amdgcn/bitcode
+ -DTEST_CPU=${test_cpu}
+ -DEXTRA_CHECK_PREFIX=${extra_check_prefixes}
+ -P ${script})
+Index: ROCm-Device-Libs-rocm-6.0.0/test/compile/RunConstantFoldTest.cmake
+===================================================================
+--- ROCm-Device-Libs-rocm-6.0.0.orig/test/compile/RunConstantFoldTest.cmake
++++ ROCm-Device-Libs-rocm-6.0.0/test/compile/RunConstantFoldTest.cmake
+@@ -16,6 +16,7 @@ execute_process(COMMAND
+ -target amdgcn-amd-amdhsa -mcpu=${TEST_CPU}
+ -Xclang -finclude-default-header
+ --rocm-path=${BINARY_DIR}
++ --rocm-device-lib-path=${AMDGCN_BITCODES}
+ -mllvm -amdgpu-simplify-libcall=0
+ -o ${OUTPUT_FILE} ${INPUT_FILE}
+ RESULT_VARIABLE CLANG_RESULT
+Index: ROCm-Device-Libs-rocm-6.0.0/test/compile/RunCompileTest.cmake
+===================================================================
+--- ROCm-Device-Libs-rocm-6.0.0.orig/test/compile/RunCompileTest.cmake
++++ ROCm-Device-Libs-rocm-6.0.0/test/compile/RunCompileTest.cmake
+@@ -16,6 +16,7 @@ execute_process(COMMAND
+ -target amdgcn-amd-amdhsa -mcpu=${TEST_CPU}
+ -Xclang -finclude-default-header
+ --rocm-path=${BINARY_DIR}
++ --rocm-device-lib-path=${AMDGCN_BITCODES}
+ -mllvm -amdgpu-simplify-libcall=0
+ -o ${OUTPUT_FILE} ${INPUT_FILE}
+ RESULT_VARIABLE CLANG_RESULT
diff --git a/dev-libs/rocm-device-libs/files/rocm-device-libs-5.5.1-remove-gfx700-tests.patch b/dev-libs/rocm-device-libs/files/rocm-device-libs-5.5.1-remove-gfx700-tests.patch
new file mode 100644
index 000000000000..0fb5e44e218c
--- /dev/null
+++ b/dev-libs/rocm-device-libs/files/rocm-device-libs-5.5.1-remove-gfx700-tests.patch
@@ -0,0 +1,34 @@
+https://github.com/ROCm/ROCm-Device-Libs/issues/86
+https://github.com/ROCm/ROCm-Device-Libs/pull/89
+From 936a78464491c95c7cfffde08491bfe1a48c7177 Mon Sep 17 00:00:00 2001
+From: Brian Sumner <brian.sumner@amd.com>
+Date: Tue, 9 May 2023 07:55:03 -0700
+Subject: [PATCH] Remove gfx700 from tests
+
+Change-Id: I23d6639cb7c04246cc5be86d6e172e32546b3b90
+---
+ test/compile/CMakeLists.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/test/compile/CMakeLists.txt b/test/compile/CMakeLists.txt
+index 9af0b1a..a789222 100644
+--- a/test/compile/CMakeLists.txt
++++ b/test/compile/CMakeLists.txt
+@@ -54,12 +54,12 @@ foreach(gpu gfx900 gfx1030)
+ add_constant_fold_test(lgamma_r ${gpu})
+ endforeach()
+
+-foreach(gpu gfx700 gfx803)
++foreach(gpu gfx803)
+ add_isa_test(asin ${gpu})
+ add_isa_test(atan2 ${gpu})
+ add_isa_test(atan2pi ${gpu})
+ endforeach()
+
+-foreach(gpu gfx600 gfx700)
++foreach(gpu gfx600)
+ add_isa_test(frexp ${gpu})
+ endforeach()
+--
+2.41.0
+
diff --git a/dev-libs/rocm-device-libs/files/rocm-device-libs-6.0.0-add-gws-attribute.patch b/dev-libs/rocm-device-libs/files/rocm-device-libs-6.0.0-add-gws-attribute.patch
new file mode 100644
index 000000000000..1aaecbb0c1e6
--- /dev/null
+++ b/dev-libs/rocm-device-libs/files/rocm-device-libs-6.0.0-add-gws-attribute.patch
@@ -0,0 +1,22 @@
+Fix compatilibity with Clang-18
+https://github.com/ROCm/ROCm-Device-Libs/issues/96
+
+Backports https://github.com/ROCm/llvm-project/commit/688c78d85caf499957db175811f8b00c7c818f83
+--- a/ockl/src/cg.cl
++++ b/ockl/src/cg.cl
+@@ -84,13 +84,13 @@ multi_grid_sync(__global struct mg_sync *s, uint members)
+ }
+ }
+
+-void
++__attribute__((target("gws"))) void
+ __ockl_gws_init(uint nwm1, uint rid)
+ {
+ __builtin_amdgcn_ds_gws_init(nwm1, rid);
+ }
+
+-void
++__attribute__((target("gws"))) void
+ __ockl_gws_barrier(uint nwm1, uint rid)
+ {
+ __builtin_amdgcn_ds_gws_barrier(nwm1, rid); \ No newline at end of file
diff --git a/dev-libs/rocm-device-libs/files/rocm-device-libs-6.1.0-fix-llvm-link.patch b/dev-libs/rocm-device-libs/files/rocm-device-libs-6.1.0-fix-llvm-link.patch
new file mode 100644
index 000000000000..7a08dc4a1d0d
--- /dev/null
+++ b/dev-libs/rocm-device-libs/files/rocm-device-libs-6.1.0-fix-llvm-link.patch
@@ -0,0 +1,28 @@
+https://github.com/ROCm/llvm-project/pull/68
+From 1c7e7f872980a5b15fb3d85f8780e78ce3b715b1 Mon Sep 17 00:00:00 2001
+From: Selene <lixueying@mail.bnu.edu.cn>
+Date: Wed, 1 May 2024 17:38:33 +0800
+Subject: [PATCH] Allow link to llvm shared library for current distros
+
+---
+ amd/device-libs/utils/prepare-builtins/CMakeLists.txt | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/amd/device-libs/utils/prepare-builtins/CMakeLists.txt b/amd/device-libs/utils/prepare-builtins/CMakeLists.txt
+index 63661962860a..079dc08e3419 100644
+--- a/utils/prepare-builtins/CMakeLists.txt
++++ b/utils/prepare-builtins/CMakeLists.txt
+@@ -26,5 +26,9 @@ set_target_properties(prepare-builtins PROPERTIES
+ CXX_STANDARD_REQUIRED Yes
+ CXX_EXTENSIONS No)
+ llvm_update_compile_flags(prepare-builtins)
+-llvm_map_components_to_libnames(llvm_libs support core bitreader bitwriter)
++if (LLVM_LINK_LLVM_DYLIB)
++ set(llvm_libs LLVM)
++else()
++ llvm_map_components_to_libnames(llvm_libs support core bitreader bitwriter)
++endif()
+ target_link_libraries(prepare-builtins ${llvm_libs})
+--
+2.44.0
+
diff --git a/dev-libs/rocm-device-libs/files/rocm-device-libs-6.1.0-fix-test-failures.patch b/dev-libs/rocm-device-libs/files/rocm-device-libs-6.1.0-fix-test-failures.patch
new file mode 100644
index 000000000000..856b5cf7e392
--- /dev/null
+++ b/dev-libs/rocm-device-libs/files/rocm-device-libs-6.1.0-fix-test-failures.patch
@@ -0,0 +1,64 @@
+Modified from https://github.com/ROCm/llvm-project/commit/7c2188cbc193f2b4dd5394f17404b44340001f30.patch
+From 7c2188cbc193f2b4dd5394f17404b44340001f30 Mon Sep 17 00:00:00 2001
+From: Matt Arsenault <Matthew.Arsenault@amd.com>
+Date: Thu, 4 Jan 2024 19:34:47 +0700
+Subject: [PATCH] device-libs: Fix input file path test failures
+
+The test file input paths broke with the move to the mono-repo. Some of
+the constant folding values are host dependent, so update the values to
+what works for me now. Not really sure what else I can do about these.
+
+Change-Id: Ic764f637bb9532fcede9bfb9ce3886a2b7d467d8
+---
+ amd/device-libs/test/compile/frexp.cl | 10 ++++++----
+ amd/device-libs/test/compile/lgamma_r.cl | 2 +-
+ 3 files changed, 8 insertions(+), 9 deletions(-)
+
+diff --git a/test/compile/frexp.cl b/test/compile/frexp.cl
+index 780c541500021b..b3181ce87db711 100644
+--- a/test/compile/frexp.cl
++++ b/test/compile/frexp.cl
+@@ -5,11 +5,11 @@
+ // later.
+
+ // GCN-LABEL: {{^}}test_frexp_f32:
+-// GFX600-DAG: s_movk_i32 [[CLASS_MASK:s[0-9]+]], 0x1f8
++// GFX600-DAG: s_mov_b32 [[INF:s[0-9]+]], 0x7f80000
+ // GFX600-DAG: v_frexp_mant_f32{{(_e32)?}} [[MANT:v[0-9]+]], [[SRC:v[0-9]+]]
+ // GFX600-DAG: v_frexp_exp_i32_f32{{(_e32)?}} [[EXP:v[0-9]+]], [[SRC:v[0-9]+]]
+
+-// GFX600-DAG: v_cmp_class_f32{{(_e64)?}} [[CMP:(vcc|s{{\[[0-9]+:[0-9]+\]}})]], [[SRC]], [[CLASS_MASK]]
++// GFX600-DAG: v_cmp_lt_f32{{(_e64)?}} [[CMP:(vcc|s{{\[[0-9]+:[0-9]+\]}})]], |[[SRC]]|, [[INF]]
+
+ // GFX600-DAG: v_cndmask_b32{{(_e32)?|(e64)?}} v{{[0-9]+}}, [[SRC]], [[MANT]], [[CMP]]
+ // GFX600-DAG: v_cndmask_b32{{(_e32)?|(e64)?}} v{{[0-9]+}}, 0, [[EXP]], [[CMP]]
+@@ -30,12 +30,14 @@ kernel void test_frexp_f32(global float* restrict out0,
+ }
+
+ // GCN-LABEL: {{^}}test_frexp_f64:
++// GFX600: s_mov_b32 s{{[0-9]+}}, 0{{$}}
+
+-// GFX600-DAG: s_movk_i32 [[CLASS_MASK:s[0-9]+]], 0x1f8
++// GFX600-DAG: s_mov_b32 s[[INF_LO:[0-9]+]], 0{{$}}
++// GFX600-DAG: s_mov_b32 s[[INF_HI:[0-9]+]], 0x7ff00000{{$}}
+ // GFX600-DAG: v_frexp_mant_f64{{(_e32)?}} v{{\[}}[[MANT_LO:[0-9]+]]:[[MANT_HI:[0-9]+]]{{\]}}, [[SRC:v\[[0-9]+:[0-9]+\]]]
+ // GFX600-DAG: v_frexp_exp_i32_f64{{(_e32)?}} [[EXP:v[0-9]+]], [[SRC:v\[[0-9]+:[0-9]+\]]]
+
+-// GFX600-DAG: v_cmp_class_f64{{(_e64)?}} [[CMP:(vcc|s{{\[[0-9]+:[0-9]+\]}})]], [[SRC]], [[CLASS_MASK]]
++// GFX600-DAG: v_cmp_lt_f64{{(_e64)?}} [[CMP:(vcc|s{{\[[0-9]+:[0-9]+\]}})]], |[[SRC]]|, s{{\[}}[[INF_LO]]:[[INF_HI]]{{\]}}
+
+ // GFX600-DAG: v_cndmask_b32{{(_e32)?|(e64)?}} v{{[0-9]+}}, v{{[0-9]+}}, v[[MANT_LO]], [[CMP]]
+ // GFX600-DAG: v_cndmask_b32{{(_e32)?|(e64)?}} v{{[0-9]+}}, v{{[0-9]+}}, v[[MANT_HI]], [[CMP]]
+diff --git a/test/compile/lgamma_r.cl b/test/compile/lgamma_r.cl
+index 1e1984226cd55c..56d1ba15f761f2 100644
+--- a/test/compile/lgamma_r.cl
++++ b/test/compile/lgamma_r.cl
+@@ -66,7 +66,7 @@ kernel void constant_fold_lgamma_r_f32(volatile global float* out,
+ out[0] = test_lgamma_r(0x1.0p-127f, sign_out);
+
+ // CONSTANTFOLD-NEXT: store volatile i32 1,
+- // CONSTANTFOLD-NEXT: store volatile float 0x419DE28040000000,
++ // CONSTANTFOLD-NEXT: store volatile float 0x419DE28060000000,
+ out[0] = test_lgamma_r(nextafter(0x1.0p+23f, __builtin_inff()), sign_out);
+
+ // CONSTANTFOLD-NEXT: store volatile i32 1,
diff --git a/dev-libs/rocm-device-libs/files/rocm-device-libs-6.1.0-fix-test-failures2.patch b/dev-libs/rocm-device-libs/files/rocm-device-libs-6.1.0-fix-test-failures2.patch
new file mode 100644
index 000000000000..c0559e9468f6
--- /dev/null
+++ b/dev-libs/rocm-device-libs/files/rocm-device-libs-6.1.0-fix-test-failures2.patch
@@ -0,0 +1,44 @@
+Modified from https://github.com/ROCm/llvm-project/commit/794ebeffcafbf6f4d86cb1bfd7a5a0d1d30f1fc7
+From 794ebeffcafbf6f4d86cb1bfd7a5a0d1d30f1fc7 Mon Sep 17 00:00:00 2001
+From: Matt Arsenault <Matthew.Arsenault@amd.com>
+Date: Thu, 4 Jan 2024 20:40:30 +0700
+Subject: [PATCH] device-libs: Fix native_rsqrt test failures for f16-as-f32
+ case
+
+At some point the code quality regressed for these.
+
+Change-Id: Ib5c4c1d093a6056dd6213ed6eaf157ad806101fb
+---
+ amd/device-libs/test/compile/native_rsqrt.cl | 13 +++++++++----
+ 1 file changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/test/compile/native_rsqrt.cl b/test/compile/native_rsqrt.cl
+index 94ef375e4d522f..291cc6f32c3351 100644
+--- a/test/compile/native_rsqrt.cl
++++ b/test/compile/native_rsqrt.cl
+@@ -6,16 +6,21 @@
+
+ half __ocml_native_rsqrt_f16(half);
+
+-// GCN: {{^}}test_native_rsqrt_f16:
+-// GFX600: v_rsq_f32
+-// GFX700: v_rsq_f32
++// FIXME: Promoted case using full expansion
++// GCN-LABEL: {{^}}test_native_rsqrt_f16:
++// GFX600: v_sqrt_f32
++// GFX600: v_rcp_f32
++
++// GFX700: v_sqrt_f32
++// GFX700: v_rcp_f32
++
+ // GFX803: v_rsq_f16
+ kernel void test_native_rsqrt_f16(global half* restrict out, global half* restrict in) {
+ int id = get_local_id(0);
+ out[id] = __ocml_native_rsqrt_f16(in[id]);
+ }
+
+-// GCN: {{^}}test_native_rsqrt_f32:
++// GCN-LABEL: {{^}}test_native_rsqrt_f32:
+ // GCN: v_rsq_f32
+ kernel void test_native_rsqrt_f32(global float* restrict out, global float* restrict in) {
+ int id = get_local_id(0);
diff --git a/dev-libs/rocm-device-libs/metadata.xml b/dev-libs/rocm-device-libs/metadata.xml
index c47f589544e4..cbbf3a273306 100644
--- a/dev-libs/rocm-device-libs/metadata.xml
+++ b/dev-libs/rocm-device-libs/metadata.xml
@@ -5,7 +5,11 @@
<email>candrews@gentoo.org</email>
<name>Craig Andrews</name>
</maintainer>
+ <maintainer type="person">
+ <email>lockalsash@gmail.com</email>
+ <name>Sv. Lockal</name>
+ </maintainer>
<upstream>
- <remote-id type="github">RadeonOpenCompute/ROCm-Device-Libs</remote-id>
+ <remote-id type="github">ROCm/ROCm-Device-Libs</remote-id>
</upstream>
</pkgmetadata>
diff --git a/dev-libs/rocm-device-libs/rocm-device-libs-5.7.1.ebuild b/dev-libs/rocm-device-libs/rocm-device-libs-5.7.1.ebuild
index 56af5a5be6b3..f86b432e076a 100644
--- a/dev-libs/rocm-device-libs/rocm-device-libs-5.7.1.ebuild
+++ b/dev-libs/rocm-device-libs/rocm-device-libs-5.7.1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -47,3 +47,10 @@ src_configure() {
)
cmake_src_configure
}
+
+src_install() {
+ cmake_src_install
+ local CLANG_EXE="$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/clang"
+ local bitcodedir="$("${CLANG_EXE}" -print-resource-dir)/$(get_libdir)/amdgcn/bitcode"
+ dosym -r "/usr/lib/amdgcn/bitcode" "${bitcodedir#${EPREFIX}}"
+}
diff --git a/dev-libs/rocm-device-libs/rocm-device-libs-6.0.0.ebuild b/dev-libs/rocm-device-libs/rocm-device-libs-6.0.0.ebuild
deleted file mode 100644
index 09ca777faf52..000000000000
--- a/dev-libs/rocm-device-libs/rocm-device-libs-6.0.0.ebuild
+++ /dev/null
@@ -1,51 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-RESTRICT="strip"
-
-inherit cmake llvm
-
-LLVM_MAX_SLOT=17
-
-if [[ ${PV} == *9999 ]] ; then
- EGIT_REPO_URI="https://github.com/RadeonOpenCompute/ROCm-Device-Libs/"
- inherit git-r3
- S="${WORKDIR}/${P}/src"
-else
- SRC_URI="https://github.com/RadeonOpenCompute/ROCm-Device-Libs/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz"
- S="${WORKDIR}/ROCm-Device-Libs-rocm-${PV}"
- KEYWORDS="~amd64"
-fi
-
-DESCRIPTION="Radeon Open Compute Device Libraries"
-HOMEPAGE="https://github.com/RadeonOpenCompute/ROCm-Device-Libs"
-
-LICENSE="MIT"
-SLOT="0/$(ver_cut 1-2)"
-IUSE="test"
-RESTRICT="!test? ( test )"
-
-RDEPEND="sys-devel/clang:${LLVM_MAX_SLOT}"
-DEPEND="${RDEPEND}"
-
-CMAKE_BUILD_TYPE=Release
-
-PATCHES=(
- "${FILESDIR}/${PN}-5.5.1-fix-llvm-link.patch"
- )
-
-src_prepare() {
- sed -e "s:amdgcn/bitcode:lib/amdgcn/bitcode:" -i "${S}/cmake/OCL.cmake" || die
- sed -e "s:amdgcn/bitcode:lib/amdgcn/bitcode:" -i "${S}/cmake/Packages.cmake" || die
- cmake_src_prepare
-}
-
-src_configure() {
- local mycmakeargs=(
- # -DLLVM_DIR="${EPREFIX}/usr/lib/llvm/roc/lib/cmake/llvm"
- -DLLVM_DIR="$(get_llvm_prefix "${LLVM_MAX_SLOT}")"
- )
- cmake_src_configure
-}
diff --git a/dev-libs/rocm-device-libs/rocm-device-libs-6.1.1.ebuild b/dev-libs/rocm-device-libs/rocm-device-libs-6.1.1.ebuild
new file mode 100644
index 000000000000..04fd989b95cb
--- /dev/null
+++ b/dev-libs/rocm-device-libs/rocm-device-libs-6.1.1.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+LLVM_COMPAT=( 18 )
+inherit cmake llvm-r1
+
+MY_P=llvm-project-rocm-${PV}
+components=( "amd/device-libs" )
+
+if [[ ${PV} == *9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/ROCm/llvm-project"
+ inherit git-r3
+ S="${WORKDIR}/${P}/${components[0]}"
+else
+ SRC_URI="https://github.com/ROCm/llvm-project/archive/rocm-${PV}.tar.gz -> ${MY_P}.tar.gz"
+ S="${WORKDIR}/${MY_P}/${components[0]}"
+ KEYWORDS="~amd64"
+fi
+
+DESCRIPTION="Radeon Open Compute Device Libraries"
+HOMEPAGE="https://github.com/ROCm/ROCm-Device-Libs"
+
+LICENSE="MIT"
+SLOT="0/$(ver_cut 1-2)"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+ dev-build/rocm-cmake
+ $(llvm_gen_dep '
+ sys-devel/clang:${LLVM_SLOT}
+ sys-devel/lld:${LLVM_SLOT}
+ ')
+"
+
+CMAKE_BUILD_TYPE=Release
+
+PATCHES=(
+ "${FILESDIR}/${PN}-5.5.0-test-bitcode-dir.patch"
+ "${FILESDIR}/${PN}-6.1.0-fix-llvm-link.patch"
+ "${FILESDIR}/${PN}-6.0.0-add-gws-attribute.patch"
+ "${FILESDIR}/${PN}-6.1.0-fix-test-failures.patch"
+ "${FILESDIR}/${PN}-6.1.0-fix-test-failures2.patch"
+)
+
+src_unpack() {
+ if [[ ${PV} == *9999 ]] ; then
+ git-r3_fetch
+ git-r3_checkout '' . '' "${components[@]}"
+ else
+ archive="${MY_P}.tar.gz"
+ ebegin "Unpacking from ${archive}"
+ tar -x -z -o \
+ -f "${DISTDIR}/${archive}" \
+ "${components[@]/#/${MY_P}/}" || die
+ eend ${?}
+ fi
+}
+
+src_prepare() {
+ sed -e "s:amdgcn/bitcode:lib/amdgcn/bitcode:" -i "${S}/cmake/OCL.cmake" || die
+ sed -e "s:amdgcn/bitcode:lib/amdgcn/bitcode:" -i "${S}/cmake/Packages.cmake" || die
+ cmake_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DLLVM_DIR="$(get_llvm_prefix)"
+ )
+ # do not trust CMake with autoselecting Clang, as it autoselects the latest one
+ # producing too modern LLVM bitcode and causing linker errors in other packages
+ CC="$(get_llvm_prefix)/bin/clang" CXX="$(get_llvm_prefix)/bin/clang++" cmake_src_configure
+}
+
+src_install() {
+ cmake_src_install
+ local CLANG_EXE="$(get_llvm_prefix)/bin/clang"
+ # install symlink, so that clang won't ask for "--rocm-device-lib-path" flag anymore
+ local bitcodedir="$("${CLANG_EXE}" -print-resource-dir)/$(get_libdir)/amdgcn/bitcode"
+ dosym -r "/usr/lib/amdgcn/bitcode" "${bitcodedir#${EPREFIX}}"
+}