summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSv. Lockal <lockalsash@gmail.com>2024-12-08 19:05:46 +0000
committerSam James <sam@gentoo.org>2025-01-05 21:46:35 +0000
commitcb1623e85af0548958698d63b52d0d6595e28ae4 (patch)
tree8f3064fedfe2962b531a3817e50d0bc92c711820 /dev-util/roctracer
parentsci-libs/rocBLAS: add 6.3.0 (diff)
downloadgentoo-cb1623e85af0548958698d63b52d0d6595e28ae4.tar.gz
gentoo-cb1623e85af0548958698d63b52d0d6595e28ae4.tar.bz2
gentoo-cb1623e85af0548958698d63b52d0d6595e28ae4.zip
dev-util/roctracer: add 6.3.0
Signed-off-by: Sv. Lockal <lockalsash@gmail.com> Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-util/roctracer')
-rw-r--r--dev-util/roctracer/Manifest1
-rw-r--r--dev-util/roctracer/files/roctracer-6.3.0-fix-prettyprinter.patch67
-rw-r--r--dev-util/roctracer/roctracer-6.3.0.ebuild110
3 files changed, 178 insertions, 0 deletions
diff --git a/dev-util/roctracer/Manifest b/dev-util/roctracer/Manifest
index 60f2f32705d5..325362547862 100644
--- a/dev-util/roctracer/Manifest
+++ b/dev-util/roctracer/Manifest
@@ -4,3 +4,4 @@ DIST rocm-tracer-5.3.3.tar.gz 353041 BLAKE2B b7614707ae3af2f5a46d058dacadfb0ef3b
DIST rocprofiler-5.1.3.tar.gz 1402172 BLAKE2B 16e9b127ede94a3f96056e84a2942b6c9f3aec90579fb12796ab8ba385160aa020e3dc77f7a475dadbc0a813a823ae733ca9560f6a09e55c4c82b13dd792dfa4 SHA512 6e9932a425eaaa2a1e1741280d7525c6360700f85edb3bcf4967fe9be4fed662bae0d2ba609701f0d9733769c340e93e32076024b27bab3303449c1d68d9e1ce
DIST roctracer-5.7.1.tar.gz 354686 BLAKE2B 2e72d8df5cf53a913102a715dab55f7c6d33b2d4a9cad7647a61824deba0363cf3dbf96d8de3469a78d6b5c8e517c163c303bf6aa12eeaf8e43f82ac8381ef97 SHA512 62cf62fc505955426596bd6d539c92f4d730d90d820d817343525f1b7be693290727c8c447ca98b1a0e46d1d188b62b3f4fafcf6bffbf2479fc5d937fb354e13
DIST roctracer-6.1.1.tar.gz 396688 BLAKE2B e332c3a6056d1678e3da511878fd2710a4eaa02526cd1e7353dd1dbcba776cb77e6e431d90daf5f238ec7793fc8e9f51afd7f09992f70b26c7e3aab28bb319a9 SHA512 d59c367953b1d5df0daae96746095e2e19f706f43b5ebed3d45c15d23697e9c99c1623bbb8dfa001648fdeda172a3c1d820d884b6da3946addec8f4b9a86e5dc
+DIST roctracer-6.3.0.tar.gz 397368 BLAKE2B 450e99cd90df80f60ec455a94148258b8fcef4adb1babb795c3e66bca648b51cd0b67a9e8f413e601c5f77d0292e70c443d3695198f2e4dcd6058c9e21485198 SHA512 6f29e5f12e1c499ab57ed3c869801742bf71d645852bebd3a887e34f382e6da6df910ab7921232887ea10e95eafa085794e7795e08d3e73cbe225d5967c59620
diff --git a/dev-util/roctracer/files/roctracer-6.3.0-fix-prettyprinter.patch b/dev-util/roctracer/files/roctracer-6.3.0-fix-prettyprinter.patch
new file mode 100644
index 000000000000..d6f5191de6d4
--- /dev/null
+++ b/dev-util/roctracer/files/roctracer-6.3.0-fix-prettyprinter.patch
@@ -0,0 +1,67 @@
+--- a/script/gen_ostream_ops.py
++++ b/script/gen_ostream_ops.py
+@@ -242,7 +242,15 @@ def gen_cppheader(infilepath, outfilepath, rank):
+ if c == 'max_align_t' or c == '__fsid_t': # Skipping as it is defined in multiple domains
+ continue
+ if len(cppHeader.classes[c]["properties"]["public"]) != 0:
+- output_filename_h.write("inline static std::ostream& operator<<(std::ostream& out, const " + c + "& v)\n")
++ print_c = ("typename " + c) if '>::' in c else c
++
++ if '<T' in c:
++ output_filename_h.write("template <typename T>\n")
++ elif c == 'HIP_vector_type':
++ output_filename_h.write("template<typename T, unsigned int rank>\n")
++ print_c = 'HIP_vector_type<T, rank>'
++
++ output_filename_h.write("inline static std::ostream& operator<<(std::ostream& out, const " + print_c + "& v)\n")
+ output_filename_h.write("{\n")
+ output_filename_h.write(" std::operator<<(out, '{');\n")
+ output_filename_h.write(" " + apiname.upper() + "_depth_max_cnt++;\n")
+@@ -257,7 +265,13 @@ def gen_cppheader(infilepath, outfilepath, rank):
+ output_filename_h.write(" return out;\n")
+ output_filename_h.write("}\n")
+ global_str = ''
+- global_ops += "inline static std::ostream& operator<<(std::ostream& out, const " + c + "& v)\n" + "{\n" + " roctracer::" + apiname.lower() + "_support::detail::operator<<(out, v);\n" + " return out;\n" + "}\n\n"
++
++ if '<T' in c:
++ global_ops += "template <typename T>\n"
++ elif c == 'HIP_vector_type':
++ global_ops += "template<typename T, unsigned int rank>\n"
++
++ global_ops += "inline static std::ostream& operator<<(std::ostream& out, const " + print_c + "& v)\n" + "{\n" + " roctracer::" + apiname.lower() + "_support::detail::operator<<(out, v);\n" + " return out;\n" + "}\n\n"
+
+ if rank == 1 or rank == 2:
+ footer = '// end ostream ops for '+ apiname + ' \n'
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -61,11 +61,19 @@ add_custom_command(
+ "${HSA_RUNTIME_INC_PATH}/hsa_ext_image.h" "${HSA_RUNTIME_INC_PATH}/hsa_api_trace.h"
+ COMMENT "Generating hsa_prof_str.h,hsa_prof_str.inline.h...")
+
++set(SYSTEM_HEADERS_DIR ${CMAKE_CURRENT_BINARY_DIR}/system-headers)
++
++execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory "${SYSTEM_HEADERS_DIR}")
++execute_process(COMMAND ${CMAKE_COMMAND} -E touch "${SYSTEM_HEADERS_DIR}/array")
++execute_process(COMMAND ${CMAKE_COMMAND} -E touch "${SYSTEM_HEADERS_DIR}/iosfwd")
++execute_process(COMMAND ${CMAKE_COMMAND} -E touch "${SYSTEM_HEADERS_DIR}/type_traits")
++
++
+ ## Generate the HSA pretty printers
+ add_custom_command(
+ OUTPUT hsa_ostream_ops.h
+- COMMAND ${CMAKE_C_COMPILER} -E "${HSA_RUNTIME_INC_PATH}/hsa.h" -o hsa.h.i
+- COMMAND ${CMAKE_C_COMPILER} -E "${HSA_RUNTIME_INC_PATH}/hsa_ext_amd.h" -o hsa_ext_amd.h.i
++ COMMAND ${CMAKE_C_COMPILER} -nostdinc++ -isystem ${SYSTEM_HEADERS_DIR} -E "${HSA_RUNTIME_INC_PATH}/hsa.h" -o hsa.h.i
++ COMMAND ${CMAKE_C_COMPILER} -nostdinc++ -isystem ${SYSTEM_HEADERS_DIR} -E "${HSA_RUNTIME_INC_PATH}/hsa_ext_amd.h" -o hsa_ext_amd.h.i
+ BYPRODUCTS hsa.h.i hsa_ext_amd.h.i
+ COMMAND ${Python3_EXECUTABLE} ${PROJECT_SOURCE_DIR}/script/gen_ostream_ops.py
+ -in hsa.h.i,hsa_ext_amd.h.i -out hsa_ostream_ops.h > /dev/null
+@@ -83,7 +91,7 @@ find_file(HIP_RUNTIME_API_H hip_runtime_api.h
+ ## Generate the HIP pretty printers
+ add_custom_command(
+ OUTPUT hip_ostream_ops.h
+- COMMAND ${CMAKE_C_COMPILER} "$<$<BOOL:${HIP_INCLUDE_DIRECTORIES}>:-I$<JOIN:${HIP_INCLUDE_DIRECTORIES},$<SEMICOLON>-I>>"
++ COMMAND ${CMAKE_C_COMPILER} -nostdinc++ -isystem ${SYSTEM_HEADERS_DIR} "$<$<BOOL:${HIP_INCLUDE_DIRECTORIES}>:-I$<JOIN:${HIP_INCLUDE_DIRECTORIES},$<SEMICOLON>-I>>"
+ -E "${CMAKE_CURRENT_SOURCE_DIR}/roctracer/hip_full_api.h" -D__HIP_PLATFORM_AMD__=1 -D__HIP_ROCclr__=1 -o hip_runtime_api.h.i
+ BYPRODUCTS hip_runtime_api.h.i
+ COMMAND ${Python3_EXECUTABLE} ${PROJECT_SOURCE_DIR}/script/gen_ostream_ops.py
diff --git a/dev-util/roctracer/roctracer-6.3.0.ebuild b/dev-util/roctracer/roctracer-6.3.0.ebuild
new file mode 100644
index 000000000000..5f78918de05c
--- /dev/null
+++ b/dev-util/roctracer/roctracer-6.3.0.ebuild
@@ -0,0 +1,110 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..13} )
+ROCM_VERSION=${PV}
+
+inherit cmake flag-o-matic prefix python-any-r1 rocm toolchain-funcs
+
+DESCRIPTION="Callback/Activity Library for Performance tracing AMD GPU's"
+HOMEPAGE="https://github.com/ROCm/roctracer"
+SRC_URI="https://github.com/ROCm/roctracer/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/roctracer-rocm-${PV}"
+
+LICENSE="MIT"
+SLOT="0/$(ver_cut 1-2)"
+KEYWORDS="~amd64"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ dev-util/hip:${SLOT}
+ dev-libs/rocr-runtime
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ $(python_gen_any_dep '
+ dev-python/cppheaderparser[${PYTHON_USEDEP}]
+ dev-python/ply[${PYTHON_USEDEP}]
+ ')
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-5.7.1-with-tests.patch"
+ "${FILESDIR}/${PN}-6.3.0-fix-prettyprinter.patch"
+)
+
+python_check_deps() {
+ python_has_version "dev-python/cppheaderparser[${PYTHON_USEDEP}]" \
+ "dev-python/ply[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ python-any-r1_pkg_setup
+}
+
+src_prepare() {
+ cmake_src_prepare
+
+ hprefixify script/*.py
+ eapply $(prefixify_ro "${FILESDIR}/${PN}"-5.3.3-rocm-path.patch)
+
+ # Install libs directly into /usr/lib64
+ sed -e "s:\${CMAKE_INSTALL_LIBDIR}/\${PROJECT_NAME}:\${CMAKE_INSTALL_LIBDIR}:g" \
+ -i src/CMakeLists.txt plugin/file/CMakeLists.txt || die
+
+ # Remove all install commands for tests
+ sed -E '/^ *install\(.+/d' -i test/CMakeLists.txt || die
+
+ # Test fails: https://github.com/ROCm/roctracer/issues/109
+ sed '/load_unload_reload_test/d' -i test/run.sh || die
+
+ # Fix search path for HIP cmake
+ sed -e "s,\${ROCM_PATH}/lib/cmake,/usr/$(get_libdir)/cmake,g" -i test/CMakeLists.txt || die
+
+ # bug #892732
+ sed -e 's/-Werror//' -i CMakeLists.txt || die
+
+ # libc++ may have no experimental/filesystem
+ sed -e 's|experimental/||' -e 's|experimental::||' \
+ -i plugin/file/file.cpp src/hip_stats/hip_stats.cpp \
+ src/roctracer/loader.h src/tracer_tool/tracer_tool.cpp || die
+}
+
+src_configure() {
+ rocm_use_hipcc
+
+ if [[ $(tc-get-cxx-stdlib) == "libc++" ]] ; then
+ # https://releases.llvm.org/9.0.0/projects/libcxx/docs/UsingLibcxx.html#using-filesystem
+ append-libs "-lc++fs"
+ fi
+
+ local mycmakeargs=(
+ -DCMAKE_MODULE_PATH="${EPREFIX}/usr/$(get_libdir)/cmake/hip"
+ -DFILE_REORG_BACKWARD_COMPATIBILITY=OFF
+ -DWITH_TESTS=$(usex test)
+ -DPython3_EXECUTABLE="${PYTHON}"
+ )
+ use test && mycmakeargs+=(
+ -DHIP_ROOT_DIR="${EPREFIX}/usr"
+ -DGPU_TARGETS="$(get_amdgpu_flags)"
+ )
+
+ cmake_src_configure
+}
+
+src_test() {
+ check_amdgpu
+ cd "${BUILD_DIR}" || die
+ # if LD_LIBRARY_PATH not set, dlopen cannot find correct lib
+ LD_LIBRARY_PATH="${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}" bash run.sh || die
+}
+
+src_install() {
+ cmake_src_install
+
+ # remove unneeded copy
+ rm -r "${ED}/usr/share/doc/${PF}-asan" || die
+}