dev-libs/rocm-device-libs: Remove old

Signed-off-by: Michał Górny <mgorny@gentoo.org>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/2350
This commit is contained in:
Michał Górny
2026-11-07 10:32:57 +01:00
parent c8bc92bd6c
commit 8d4fb16eee
3 changed files with 0 additions and 253 deletions
-1
View File
@@ -1,4 +1,3 @@
DIST llvm-project-rocm-6.3.3.tar.gz 206663912 BLAKE2B 939527dbbcd0c4b4785e5cdbd7144149f169120506c2b5b00e84e8208e3877109e24cf58501a1317d1f9dcce0614cf47a0290cb2e0e10aa7b164bcb064c2ffbc SHA512 380d6ca72dd215b1996b14fe9b54f4981bd1d275aae22ed89f4f3efc46ec2988054cc98dcc45e1c678812c2bd3488ed6cf375ca193af4ad272a6cff7f2388872
DIST llvm-project-rocm-6.4.3.tar.gz 218920681 BLAKE2B 85c29c1f66f9d23fa7fb6d98baf60cb08a8507a7b3a4c0a5054d9d4d3bc1fb7de56ddae583e37a36c7a3f17f9e57bd49777deca7560ca8b4882c1eea1db5b421 SHA512 b6b4149c6426793f4497dfd1200079b0caef4d5a6f49c1f3a301d70f5f7b322b850085ff2f89d55df1dfab6d6a97948fe4084d4ec14654ee97cdab26e71a45c0
DIST llvm-project-rocm-7.0.2.tar.gz 228207703 BLAKE2B 0a46338e43eeb9ee484cf9b79488f38b96983ba0a5736d606b1b1d450b9c7aa214047200c3d6712b8053d742e2f014333b2db28feca7d0c8b6928282604e1f4e SHA512 b7916941711ec062aad518d752d213d2e6c846875956ade650da01fa02df94b2a8501c656c1333bb2febb1d46cc8266dd98fd509c72ac0c9c29321276a919450
DIST llvm-project-rocm-7.1.0.tar.gz 228282149 BLAKE2B c4bbaf1842d91747a3f7a9ae8a8db0a4b2485394770f9be5782346de1c2c66c496629a820f4bc9418803c4abe2e629b44083b9d9a8b0ffe79431d04f71a7b191 SHA512 01fa89fcee6910d53407be6cfe3a83bec98260a48beca6393ca7e5991d283897da42a918c6e9888a9cee46adc9c4086dd4b4221e7e25d64108296b755669a7e7
@@ -1,152 +0,0 @@
commit 83ef5b48800a47cc30b3d4bcfdf31de9c3bd0dc8
Author: Patrick Lauer <patrick@gentoo.org>
Date: Sun Jul 28 07:43:54 2024 +0000
Revert "ockl: Don't use wave32 ballot builtin"
This reverts commit 066a0b2716b7ade96a2b3e79e5ddcd0c110e9f98.
diff --git a/ockl/src/dm.cl b/ockl/src/dm.cl
index 18efc54203b7..a3f06c448aee 100644
--- a/ockl/src/dm.cl
+++ b/ockl/src/dm.cl
@@ -287,14 +287,9 @@ first(__global void * v)
return __builtin_astype(w2, __global void *);
}
-// Read val from one active lane whose predicate is one.
-// If no lanes have the predicate set, return none
-// This is like first, except that first may not have its predicate set
+REQUIRES_WAVE64
static uint
-elect_uint(int pred, uint val, uint none)
-{
- // Pretend wave32 doesn't exist. The wave64 ballot works, and the high half
- // will fold out as 0.
+elect_uint_wave64(int pred, uint val, uint none) {
uint ret = none;
ulong mask = __builtin_amdgcn_ballot_w64(pred != 0);
@@ -306,14 +301,51 @@ elect_uint(int pred, uint val, uint none)
return ret;
}
-// Count the number of nonzero arguments across the wave
+REQUIRES_WAVE32
static uint
-votes(bool b)
+elect_uint_wave32(int pred, uint val, uint none) {
+ uint ret = none;
+ uint mask = __builtin_amdgcn_ballot_w32(pred != 0);
+ if (mask != 0U) {
+ uint l = __ockl_ctz_u32(mask);
+ ret = __builtin_amdgcn_ds_bpermute(l << 2, val);
+ }
+
+ return ret;
+}
+
+// Read val from one active lane whose predicate is one.
+// If no lanes have the predicate set, return none
+// This is like first, except that first may not have its predicate set
+static uint
+elect_uint(int pred, uint val, uint none)
+{
+ return __oclc_wavefrontsize64 ? elect_uint_wave64(pred, val, none) : elect_uint_wave32(pred, val, none);
+}
+
+REQUIRES_WAVE64
+static uint
+votes_wave64(bool b)
{
ulong mask = __builtin_amdgcn_ballot_w64(b);
return __builtin_popcountl(mask);
}
+REQUIRES_WAVE32
+static uint
+votes_wave32(bool b)
+{
+ uint mask = __builtin_amdgcn_ballot_w32(b);
+ return __builtin_popcount(mask);
+}
+
+// Count the number of nonzero arguments across the wave
+static uint
+votes(bool b)
+{
+ return __oclc_wavefrontsize64 ? votes_wave64(b) : votes_wave32(b);
+}
+
// The kind of the smallest block that can hold sz bytes
static uint
size_to_kind(uint sz)
diff --git a/ockl/src/wfaas.cl b/ockl/src/wfaas.cl
index 3861a5bb3eab..4dab97cea5f7 100644
--- a/ockl/src/wfaas.cl
+++ b/ockl/src/wfaas.cl
@@ -21,25 +21,60 @@ static int optimizationBarrierHack(int in_val)
return out_val;
}
+REQUIRES_WAVE32
+static bool wfany_impl_w32(int e) {
+ return __builtin_amdgcn_ballot_w32(e) != 0;
+}
+
+REQUIRES_WAVE64
+static bool wfany_impl_w64(int e) {
+ return __builtin_amdgcn_ballot_w64(e) != 0;
+}
+
ATTR bool
OCKL_MANGLE_I32(wfany)(int e)
{
e = optimizationBarrierHack(e);
- return __builtin_amdgcn_ballot_w64(e) != 0;
+ return __oclc_wavefrontsize64 ?
+ wfany_impl_w64(e) : wfany_impl_w32(e);
+}
+
+REQUIRES_WAVE32
+static bool wfall_impl_w32(int e) {
+ return __builtin_amdgcn_ballot_w32(e) == __builtin_amdgcn_read_exec_lo();
+}
+
+REQUIRES_WAVE64
+static bool wfall_impl_w64(int e) {
+ return __builtin_amdgcn_ballot_w64(e) == __builtin_amdgcn_read_exec();
}
ATTR bool
OCKL_MANGLE_I32(wfall)(int e)
{
e = optimizationBarrierHack(e);
- return __builtin_amdgcn_ballot_w64(e) == __builtin_amdgcn_read_exec();
+ return __oclc_wavefrontsize64 ?
+ wfall_impl_w64(e) : wfall_impl_w32(e);
+}
+
+
+REQUIRES_WAVE32
+static bool wfsame_impl_w32(int e) {
+ uint u = __builtin_amdgcn_ballot_w32(e);
+ return (u == 0) | (u == __builtin_amdgcn_read_exec_lo());
+}
+
+REQUIRES_WAVE64
+static bool wfsame_impl_w64(int e) {
+ ulong u = __builtin_amdgcn_ballot_w64(e);
+ return (u == 0UL) | (u == __builtin_amdgcn_read_exec());
}
ATTR bool
OCKL_MANGLE_I32(wfsame)(int e)
{
e = optimizationBarrierHack(e);
- ulong u = __builtin_amdgcn_ballot_w64(e);
- return (u == 0UL) | (u == __builtin_amdgcn_read_exec());
+ return __oclc_wavefrontsize64 ?
+ wfsame_impl_w64(e) : wfsame_impl_w32(e);
}
@@ -1,100 +0,0 @@
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
LLVM_COMPAT=( 19 )
inherit cmake flag-o-matic 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/llvm-project/tree/amd-staging/amd/device-libs"
LICENSE="MIT"
SLOT="0/$(ver_cut 1-2)"
IUSE="test"
RESTRICT="!test? ( test )"
BDEPEND="
dev-build/rocm-cmake
$(llvm_gen_dep '
llvm-core/clang:${LLVM_SLOT}
llvm-core/lld:${LLVM_SLOT}
')
"
CMAKE_BUILD_TYPE=Release
PATCHES=(
"${FILESDIR}/${PN}-6.1.0-fix-llvm-link.patch"
"${FILESDIR}/${PN}-6.1.2-fix-build.patch"
"${FILESDIR}/${PN}-6.2.0-test-bitcode-dir.patch"
"${FILESDIR}/${PN}-6.4.2-cmake-4-compat.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" \
-i "${S}/cmake/Packages.cmake" || die
cmake_src_prepare
}
src_configure() {
# 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.
# Clean up unsupported flags for the switched compiler, see #936099
local -x CC="$(get_llvm_prefix)/bin/clang"
local -x CXX="$(get_llvm_prefix)/bin/clang++"
strip-unsupported-flags
local mycmakeargs=(
-DLLVM_DIR="$(get_llvm_prefix)"
)
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}"}"
}
src_test() {
# https://github.com/ROCm/llvm-project/issues/76
# "Failing tests are on gfx that are not supported"
local CMAKE_SKIP_TESTS=(
compile_frexp__gfx600
compile_fract__gfx600
compile_fract__gfx700
)
cmake_src_test
}