commit:     a31808f3051758ccde8604944e1559ce92ef8ec4
Author:     Yiyang Wu <xgreenlandforwyy <AT> gmail <DOT> com>
AuthorDate: Tue Jun 21 08:38:05 2022 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Thu Sep 22 01:06:33 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a31808f3

dev-util/Tensile: add 5.1.3, switch to vanilla clang-14

enable py3.11 as well.
No need to rebuild when hip upgrade since hip is just used at runtime.

Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>

 dev-util/Tensile/Manifest                          |  1 +
 dev-util/Tensile/Tensile-5.0.2-r2.ebuild           |  2 +-
 ...ensile-5.0.2-r2.ebuild => Tensile-5.1.3.ebuild} | 16 +++--
 .../Tensile/files/Tensile-5.1.3-gentoopath.patch   | 75 ++++++++++++++++++++++
 4 files changed, 86 insertions(+), 8 deletions(-)

diff --git a/dev-util/Tensile/Manifest b/dev-util/Tensile/Manifest
index c3e8f48bab20..3b51748fa904 100644
--- a/dev-util/Tensile/Manifest
+++ b/dev-util/Tensile/Manifest
@@ -1,3 +1,4 @@
 DIST Tensile-5.0.2-PR1419.patch.gz 43754 BLAKE2B 
3b1d7333ed0115f77816806e7735e25d897dbae3f7a40ece61d655c8f016d9d1c804b586b4e0e75661e20c517f5937a61d5ead25a545f0ce2e4a178bcbb3e7be
 SHA512 
0154d8e14d335f4ecd86e5db335289f8662cede7e5d4b93bf6c56d8e48c1d7d0457271c078c9abbbca1f4aa91f028f6ce6a89efb783ba0207d0f39fd5de8a42c
 DIST rocm-Tensile-4.3.0.tar.gz 14250149 BLAKE2B 
030138eaca2a0aadd96801e6dbd72e510716dd90553ef3795c5e04e00a34a05ecae82b24f755e4033a4acfcdb1cf26291da1e7902bb090f89a010d403e832beb
 SHA512 
126db0b413c716fba8d5be9bff7a44fd1badacbf32f3db8d0db649819177db37ebd56fd22dd3c809655f5d29675be115e698cd10bc3d0b4b23878ae3726fce47
 DIST rocm-Tensile-5.0.2.tar.gz 14362090 BLAKE2B 
d44c3135496db41c4eb2545f6054c84493e89ef6357da881dae6859763338417e7a9e142cdce7e2de0536684bb641049ad0440964adbe68d03ca329f01efabc9
 SHA512 
f5ab7d7cbc5ba25498a02a6b7c07d5a9a548edcd44b439b92c8718072382adc18ae78274db1a7174e06436ac1396f3b4edafc7f491a2c87086c368e7270e64e3
+DIST rocm-Tensile-5.1.3.tar.gz 14357517 BLAKE2B 
7c5881cc2b1d25db39f54a99f9f0a08395a5f7a58deebe74d9868e8f7044db5ae2f3907196adf16dc6abeba0f1f47f5cce5c8900891276daff8e4ad614cf3b94
 SHA512 
4405cb6de65c1da1fd93910fc901402a24e996ff04eccadf483c25d8eb518e03ea9bbf00e372dd5fe377696e71c39355603095f3c5fc1e26d311ed15d8e3b734

diff --git a/dev-util/Tensile/Tensile-5.0.2-r2.ebuild 
b/dev-util/Tensile/Tensile-5.0.2-r2.ebuild
index 38854fd0c269..22d3a6cee451 100644
--- a/dev-util/Tensile/Tensile-5.0.2-r2.ebuild
+++ b/dev-util/Tensile/Tensile-5.0.2-r2.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=8
 
-PYTHON_COMPAT=( python3_{8..10} )
+PYTHON_COMPAT=( python3_{8..11} )
 DISTUTILS_USE_PEP517=setuptools
 inherit distutils-r1 prefix
 

diff --git a/dev-util/Tensile/Tensile-5.0.2-r2.ebuild 
b/dev-util/Tensile/Tensile-5.1.3.ebuild
similarity index 86%
copy from dev-util/Tensile/Tensile-5.0.2-r2.ebuild
copy to dev-util/Tensile/Tensile-5.1.3.ebuild
index 38854fd0c269..f2a39a52dbbb 100644
--- a/dev-util/Tensile/Tensile-5.0.2-r2.ebuild
+++ b/dev-util/Tensile/Tensile-5.1.3.ebuild
@@ -3,14 +3,16 @@
 
 EAPI=8
 
-PYTHON_COMPAT=( python3_{8..10} )
+PYTHON_COMPAT=( python3_{8..11} )
 DISTUTILS_USE_PEP517=setuptools
-inherit distutils-r1 prefix
+inherit distutils-r1 llvm prefix
+
+LLVM_MAX_SLOT=14
 
 DESCRIPTION="Stretching GPU performance for GEMMs and tensor contractions"
 HOMEPAGE="https://github.com/ROCmSoftwarePlatform/Tensile";
 
SRC_URI="https://github.com/ROCmSoftwarePlatform/Tensile/archive/rocm-${PV}.tar.gz
 -> rocm-Tensile-${PV}.tar.gz
-               
https://github.com/littlewu2508/littlewu2508.github.io/raw/main/gentoo-distfiles/${P}-PR1419.patch.gz";
+               
https://github.com/littlewu2508/littlewu2508.github.io/raw/main/gentoo-distfiles/${PN}-5.0.2-PR1419.patch.gz";
 S="${WORKDIR}/${PN}-rocm-${PV}"
 
 LICENSE="MIT"
@@ -24,24 +26,24 @@ RDEPEND="${PYTHON_DEPS}
        dev-python/pyyaml[${PYTHON_USEDEP}]
        dev-python/msgpack[${PYTHON_USEDEP}]
        >=dev-util/rocm-smi-4.3.0
+       >=sys-devel/clang-14.0.6-r1:${LLVM_MAX_SLOT}=
 "
 DEPEND="${RDEPEND}
-       dev-util/hip:=
+       dev-util/hip
 "
 
 PATCHES=( "${FILESDIR}"/${PN}-4.3.0-output-commands.patch
                  "${FILESDIR}"/${PN}-5.0.2-gfx1031.patch
                  "${FILESDIR}"/${PN}-5.0.2-fix-arch-parse.patch
                  "${FILESDIR}"/${PN}-5.0.2-use-ninja.patch
-                 "${FILESDIR}"/${PN}-5.0.2-adjust-parallel.patch
-                 "${WORKDIR}"/${PN}-5.0.2-PR1419.patch
          )
 
 CMAKE_USE_DIR="${WORKDIR}/Source"
 
 src_prepare() {
        distutils-r1_src_prepare
-       eapply $(prefixify_ro "${FILESDIR}"/${PN}-5.0.2-gentoopath.patch)
+       sed -e "s,\@LLVM_PATH\@,$(get_llvm_prefix ${LLVM_MAX_SLOT}),g" 
"${FILESDIR}"/${PN}-5.1.3-gentoopath.patch > "${S}"/gentoopath.patch || die
+       eapply $(prefixify_ro "${S}"/gentoopath.patch)
 
        pushd ${PN} || die
 

diff --git a/dev-util/Tensile/files/Tensile-5.1.3-gentoopath.patch 
b/dev-util/Tensile/files/Tensile-5.1.3-gentoopath.patch
new file mode 100644
index 000000000000..2f41bf3aa715
--- /dev/null
+++ b/dev-util/Tensile/files/Tensile-5.1.3-gentoopath.patch
@@ -0,0 +1,75 @@
+Fix incorrect path in scripts and CMakeLists, in order to build tensile_client 
+===================================================================
+--- Tensile-rocm-5.0.2.orig/Tensile/Source/client/CMakeLists.txt
++++ Tensile-rocm-5.0.2/Tensile/Source/client/CMakeLists.txt
+@@ -56,3 +56,5 @@ endif()
+ foreach(arch IN LISTS TENSILE_GPU_ARCHS)
+     target_link_libraries(tensile_client PRIVATE "--amdgpu-target=${arch}")
+ endforeach(arch)
++
++target_link_libraries(tensile_client PRIVATE LLVMSupport)
+Index: Tensile-rocm-5.0.2/Tensile/Source/lib/CMakeLists.txt
+===================================================================
+--- Tensile-rocm-5.0.2.orig/Tensile/Source/lib/CMakeLists.txt
++++ Tensile-rocm-5.0.2/Tensile/Source/lib/CMakeLists.txt
+@@ -47,7 +47,7 @@ set(tensile_sources  ${tensile_sources}
+     )
+ 
+ if(TENSILE_USE_LLVM)
+-    find_package(LLVM 13.0 QUIET CONFIG)
++    find_package(LLVM PATHS @LLVM_PATH@ QUIET CONFIG)
+     if(NOT LLVM_FOUND)
+         find_package(LLVM 12.0 QUIET CONFIG)
+         if(NOT LLVM_FOUND)
+Index: Tensile-rocm-5.0.2/Tensile/Common.py
+===================================================================
+--- Tensile-rocm-5.0.2.orig/Tensile/Common.py
++++ Tensile-rocm-5.0.2/Tensile/Common.py
+@@ -1873,7 +1873,7 @@ def assignGlobalParameters( config ):
+     else:
+       print2(" %24s: %8s (unspecified)" % (key, defaultValue))
+ 
+-  globalParameters["ROCmPath"] = "/opt/rocm"
++  globalParameters["ROCmPath"] = "@GENTOO_PORTAGE_EPREFIX@/usr"
+   if "ROCM_PATH" in os.environ:
+     globalParameters["ROCmPath"] = os.environ.get("ROCM_PATH")
+   if "TENSILE_ROCM_PATH" in os.environ:
+Index: Tensile-rocm-5.0.2/Tensile/ClientWriter.py
+===================================================================
+--- Tensile-rocm-5.0.2.orig/Tensile/ClientWriter.py
++++ Tensile-rocm-5.0.2/Tensile/ClientWriter.py
+@@ -205,7 +205,7 @@ def getBuildClientLibraryScript(buildPat
+   import io
+   runScriptFile = io.StringIO()
+ 
+-  callCreateLibraryCmd = globalParameters["ScriptPath"] + 
"/bin/TensileCreateLibrary"
++  callCreateLibraryCmd = "TensileCreateLibrary"
+ 
+ 
+   if globalParameters["MergeFiles"]:
+Index: Tensile-rocm-5.0.2/Tensile/GenerateSummations.py
+===================================================================
+--- Tensile-rocm-5.0.2.orig/Tensile/GenerateSummations.py
++++ Tensile-rocm-5.0.2/Tensile/GenerateSummations.py
+@@ -57,7 +57,7 @@ def createLibraryForBenchmark(logicPath,
+     Selection.
+     """
+ 
+-    pythonExePath = os.path.join(os.path.dirname(os.path.realpath(__file__)), 
"bin", "TensileCreateLibrary")
++    pythonExePath = "TensileCreateLibrary"
+     args = [pythonExePath, \
+         "--merge-files", "--new-client-only", "--no-short-file-names", 
"--no-library-print-debug", \
+         "--architecture=all", "--code-object-version=V3", 
"--cxx-compiler=hipcc", "--library-format=yaml", \
+Index: Tensile-rocm-5.0.2/HostLibraryTests/CMakeLists.txt
+===================================================================
+--- Tensile-rocm-5.0.2.orig/HostLibraryTests/CMakeLists.txt
++++ Tensile-rocm-5.0.2/HostLibraryTests/CMakeLists.txt
+@@ -135,7 +135,7 @@ set(test_sources ${test_sources}
+ )
+ 
+ if(TENSILE_USE_LLVM)
+-    find_package(LLVM 13.0 QUIET CONFIG)
++    find_package(LLVM PATHS @LLVM_PATH@ QUIET CONFIG)
+     if(NOT LLVM_FOUND)
+         find_package(LLVM 12.0 QUIET CONFIG)
+         if(NOT LLVM_FOUND)

Reply via email to