This eclass provides utilities for ROCm libraries in
https://github.com/ROCmSoftwarePlatform, e.g. rocBLAS, rocFFT.
It contains a USE_EXPAND, amdgpu_targets_*, which handles the GPU
architecture to compile, and keep targets coherent among dependencies.
Packages that depend on ROCm libraries, like cupy, can also make use of
this eclass, mainly specify GPU architecture and it's corresponding dependencies via USE_EXPAND.
Closes:
https://bugs.gentoo.org/810619
Bugs:
https://bugs.gentoo.org/817440
Signed-off-by: Yiyang Wu <
xgreenlandforwyy@gmail.com>
---
eclass/rocm.eclass | 284 ++++++++++++++++++++++++++++++++++++
profiles/base/make.defaults | 2 +-
2 files changed, 285 insertions(+), 1 deletion(-)
create mode 100644 eclass/rocm.eclass
diff --git a/eclass/rocm.eclass b/eclass/rocm.eclass
new file mode 100644
index 000000000000..1866d6b7cc94
--- /dev/null
+++ b/eclass/rocm.eclass
@@ -0,0 +1,284 @@
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: rocm.eclass
+# @MAINTAINER:
+# Gentoo Science Project <
sci@gentoo.org>
+# @AUTHOR:
+# Yiyang Wu <
xgreenlandforwyy@gmail.com>
+# @SUPPORTED_EAPIS: 7 8
+# @BLURB: Common functions and variables for ROCm packages written in HIP
+# @DESCRIPTION:
+# ROCm packages such as sci-libs/<roc|hip>* can utilize functions in this
+# eclass. Currently, it handles the AMDGPU_TARGETS variable via USE_EXPAND, so
+# user can use USE flag to control which GPU architecture to compile, and
+# ensure coherence among dependencies. I