Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions bin/aomp_common_vars
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ if [ "$AOMP_SKIP_FLANG_NEW" == 1 ] ; then
else
AOMP_PROJECTS_LIST=${AOMP_PROJECTS_LIST:-"clang;lld;clang-tools-extra;flang"}
fi
AOMP_COMPONENT_LIST=${AOMP_COMPONENT_LIST:-"prereq project"}
AOMP_COMPONENT_LIST=${AOMP_COMPONENT_LIST:-"prereq rocm_sysdeps project"}

# AOMP_SUPP is for SUPPlemental software components needed for testing.
# such as openmpi, hdf5, and silo. Applications that need supplemental
Expand Down Expand Up @@ -279,19 +279,19 @@ function shquot() {
# AOMP_DEBUG_ORIGIN_RPATH, AOMP_ASAN_ORIGIN_RPATH, or OPENMP_EXTRAS_LIB_RPATH.
# Spliting options with AOMP_ORIGIN_NO_DTAGS is no longer necessary.

AOMP_ORIGIN_RPATH_LIST="\$ORIGIN:\$ORIGIN/../lib:\$ORIGIN/../lib64:\$ORIGIN/../../../lib:\$ORIGIN/../llvm/lib"
AOMP_ORIGIN_RPATH_LIST="\$ORIGIN:\$ORIGIN/../lib:\$ORIGIN/../lib64:\$ORIGIN/../../../lib:\$ORIGIN/../llvm/lib:\$ORIGIN/../rocm_sysdeps/lib:\$ORIGIN/../../rocm_sysdeps/lib"
AOMP_ORIGIN_RPATH=(-DCMAKE_SHARED_LINKER_FLAGS='-Wl,--disable-new-dtags'
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON
-DCMAKE_INSTALL_RPATH="$AOMP_ORIGIN_RPATH_LIST")
AOMP_DEBUG_ORIGIN_RPATH_LIST="\$ORIGIN:\$ORIGIN/../lib-debug:\$ORIGIN/../lib64:\$ORIGIN/../../../lib-debug"
AOMP_DEBUG_ORIGIN_RPATH_LIST="\$ORIGIN:\$ORIGIN/../lib-debug:\$ORIGIN/../lib64:\$ORIGIN/../../../lib-debug:\$ORIGIN/../rocm_sysdeps/lib:\$ORIGIN/../../rocm_sysdeps/lib"
AOMP_DEBUG_ORIGIN_RPATH=(-DCMAKE_SHARED_LINKER_FLAGS='-Wl,--disable-new-dtags'
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON
-DCMAKE_INSTALL_RPATH="$AOMP_DEBUG_ORIGIN_RPATH_LIST")

# Libraries and Binaries need different RUNPATH as below
if [ "$AOMP_BUILD_SANITIZER" == 1 ]; then
## Below 3 lines are actually only required for AOMP ASan RPATH Cmake configuration.
AOMP_ASAN_ORIGIN_RPATH_LIST="\$ORIGIN:\$ORIGIN/../../lib:\$ORIGIN/../lib:\$ORIGIN/../lib64:\$ORIGIN/../../../../lib/asan:\$ORIGIN/../lib/llvm"
AOMP_ASAN_ORIGIN_RPATH_LIST="\$ORIGIN:\$ORIGIN/../../lib:\$ORIGIN/../lib:\$ORIGIN/../lib64:\$ORIGIN/../../../../lib/asan:\$ORIGIN/../lib/llvm:\$ORIGIN/../rocm_sysdeps/lib:\$ORIGIN/../../rocm_sysdeps/lib"
AOMP_ASAN_ORIGIN_RPATH=(-DCMAKE_SHARED_LINKER_FLAGS='-Wl,--disable-new-dtags'
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=OFF
-DCMAKE_INSTALL_RPATH="$AOMP_ASAN_ORIGIN_RPATH_LIST")
Expand Down
5 changes: 3 additions & 2 deletions bin/build_amdsmi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ fi

check_writable_installdir "$1" "$AOMP_INSTALL_DIR"

patchrepo "$AOMP_REPOS/amdsmi"
patchrepo "$AOMP_REPOS/rocm-systems"

if [ "$1" != "nocmake" ] && [ "$1" != "install" ] ; then
if [ -d "$BUILD_DIR/build/amdsmi" ] ; then
Expand All @@ -79,6 +79,7 @@ if [ "$1" != "nocmake" ] && [ "$1" != "install" ] ; then

MYCMAKEOPTS=("${AOMP_ORIGIN_RPATH[@]}" -DCMAKE_BUILD_TYPE="$BUILDTYPE"
-DCMAKE_INSTALL_PREFIX="$AOMP_INSTALL_DIR"
-DCMAKE_PREFIX_PATH="$AOMP_INSTALL_DIR/rocm_sysdeps"
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
-DCMAKE_INSTALL_RPATH="\$ORIGIN/../lib"
-DCMAKE_EXE_LINKER_FLAGS='-Wl,--disable-new-dtags')
Expand Down Expand Up @@ -129,5 +130,5 @@ if [ "$1" == "install" ] ; then
echo "ERROR make install failed "
exit 1
fi
removepatch "$AOMP_REPOS/amdsmi"
removepatch "$AOMP_REPOS/rocm-systems"
fi
5 changes: 3 additions & 2 deletions bin/build_rocm_smi_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ fi

check_writable_installdir "$1" "$AOMP_INSTALL_DIR"

patchrepo "$AOMP_REPOS/rocm_smi_lib"
patchrepo "$AOMP_REPOS/rocm-systems"

if [ "$1" != "nocmake" ] && [ "$1" != "install" ] ; then
if [ -d "$BUILD_DIR/build/rocm_smi_lib" ] ; then
Expand All @@ -79,6 +79,7 @@ if [ "$1" != "nocmake" ] && [ "$1" != "install" ] ; then

MYCMAKEOPTS=("${AOMP_ORIGIN_RPATH[@]}" -DCMAKE_BUILD_TYPE="$BUILDTYPE"
-DCMAKE_INSTALL_PREFIX="$AOMP_INSTALL_DIR"
-DCMAKE_PREFIX_PATH="$AOMP_INSTALL_DIR/rocm_sysdeps"
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
-DCMAKE_INSTALL_RPATH="\$ORIGIN/../lib"
-DCMAKE_EXE_LINKER_FLAGS='-Wl,--disable-new-dtags')
Expand Down Expand Up @@ -130,5 +131,5 @@ if [ "$1" == "install" ] ; then
echo "ERROR make install failed "
exit 1
fi
removepatch "$AOMP_REPOS/rocm_smi_lib"
removepatch "$AOMP_REPOS/rocm-systems"
fi
149 changes: 149 additions & 0 deletions bin/build_rocm_sysdeps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
#!/bin/bash
#
# build_rocm_sysdeps.sh: Script to build the rocm runtime and install into the
# aomp compiler installation
# Requires that "build_roct.sh install" be installed first
#

# --- Start standard header to set AOMP environment variables ----
realpath=$(realpath "$0")
thisdir=$(dirname "$realpath")
. "$thisdir/aomp_common_vars"
# --- end standard header ----

set -eo pipefail
set -E

# Error Handling
cmd_error(){
echo "Error: build_rocm_sysdeps.sh failed"
exit 1
}

trap cmd_error ERR

INSTALL_ROCM_SYSDEPS=${INSTALL_ROCM_SYSDEPS:-$AOMP_INSTALL_DIR/rocm_sysdeps}
ROCM_SYSDEPS_LIST=${ROCM_SYSDEPS_LIST:-libdrm}
BUILD_DIR=$BUILD_AOMP/build/rocm_sysdeps

if [ "$1" == "-h" ] || [ "$1" == "help" ] || [ "$1" == "-help" ] ; then
echo " "
echo " This script builds the ROCM sysdeps libraries"
echo " It gets the source from: Functions in this script"
echo " It builds libraries in: $BUILD_AOMP/build/rocm_sysdeps"
echo " It installs in: $INSTALL_ROCM_SYSDEPS"
echo " "
echo "Example commands and actions: "
echo " ./build_rocm_sysdeps.sh cmake, make , NO Install "
echo " ./build_rocm_sysdeps.sh install NO Cmake, make , INSTALL"
echo " "
echo "To build aomp, see the README file in this directory"
echo " "
exit
fi

check_writable_installdir "$1" "$INSTALL_ROCM_SYSDEPS"

###############################################################################################
# TheRock ships libdrm in rocm_sysdeps and therefore will not invoke a system install of libdrm.
# AOMP needs this library shipped with the install to satisfy dlopen of libhsa.
###############################################################################################

function buildlibdrm(){
_cname="libdrm"
_version="2.4.134"
_installdir="$INSTALL_ROCM_SYSDEPS"
_builddir="$BUILD_DIR/$_cname"
_patcheddir="$BUILD_DIR/$_cname-patched"
_srcdir="$_builddir/$_cname-$_cname-$_version"
TARBALL_URL="https://rocm-third-party-deps.s3.us-east-2.amazonaws.com/libdrm-libdrm-${_version}.tar.bz2"
THEROCK=https://raw.githubusercontent.com/ROCm/TheRock/main/third-party/sysdeps/linux/libdrm
AMDGPU_IDS="$_patcheddir/data/amdgpu.ids"

if [ "$1" != "install" ]; then
if [ -d "$_builddir" ] ; then
rm -rf "$_builddir"
fi
mkdir -p "$_builddir"
cd "$_builddir"

wget $THEROCK/inline_amdgpu_ids.sh
chmod +x inline_amdgpu_ids.sh
wget "$TARBALL_URL"
tar -xf $_cname-$_cname-$_version.tar.bz2
# Need to copy to patch directory or inline_amdgpu_ids.sh complains about patching source
cp -a "$_srcdir" "$_patcheddir"

# Patch libdrm source with additional amdgpu ids
cat >> "$AMDGPU_IDS" << 'EOF'
7590, C0, AMD Radeon RX 9060 XT
7590, CF, AMD Radeon RX 9050
7590, DF, AMD Radeon RX 9050 4GB
744B, 00, AMD Radeon PRO W7900D
75A0, 00, AMD Instinct MI350X
75A3, 00, AMD Instinct MI355X
75B0, 00, AMD Instinct MI350X VF
75B3, 00, AMD Instinct MI355X VF
75A8, 00, AMD Instinct MI350P
7551, C1, AMD Radeon AI Pro R9700S
7551, C8, AMD Radeon AI Pro R9600D
EOF

"$_builddir"/inline_amdgpu_ids.sh "$_patcheddir"
cd "$_cname-$_cname-$_version"
# Configure libdrm
meson setup "$_builddir" "$_patcheddir" \
--prefix "$_installdir" \
-Dpkgconfig.relocatable=true \
-Dlibdir=lib \
-Damdgpu=enabled \
-Dintel=disabled \
-Dman-pages=disabled \
-Dnouveau=disabled \
-Dradeon=disabled \
-Dvmwgfx=disabled

# Build libdrm
meson compile -C "$_builddir" --verbose
fi
if [ "$1" == "install" ]; then
meson install -C "$_builddir"
fi
}

function main(){
for _component in $ROCM_SYSDEPS_LIST ; do
if [ "$_component" == "libdrm" ] ; then
buildlibdrm "$1"
else
echo "ERROR: Invalid component name $_component"
exit 1
fi
done
}

if [ "$1" != "install" ] ; then
echo " "
echo "This is a FRESH START. ERASING any previous builds in $BUILD_DIR"
echo "Use ""$0 nocmake"" or ""$0 install"" to avoid FRESH START."
echo "rm -rf $BUILD_DIR"
rm -rf "$BUILD_DIR"
mkdir -p "$BUILD_DIR"
cd "$BUILD_DIR" || exit
echo

echo " -----Running rocm_sysdeps cmake ---- "
# Call main function
main
fi

# ----------- Install only if asked ----------------------------
if [ "$1" == "install" ] ; then
cd "$BUILD_DIR" || exit
echo " -----Installing to $INSTALL_ROCM_SYSDEPS/lib ----- "
# Call main function install
main install
# hwloc depends on rocmsmilib due to (--with-rocm) build option. rocmsmilib depends on libdrm. Moving hwloc and rocmsmilib build invocation here.
ROCM_SYSDEPS_PATH=$INSTALL_ROCM_SYSDEPS PREREQUISITE_COMPONENTS="rocmsmilib hwloc" "$thisdir/build_prereq.sh"
fi

5 changes: 3 additions & 2 deletions bin/build_rocprofiler-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ if [ "$1" == "install" ] ; then
$SUDO rm "$INSTALL_ROCPROF_SDK"/testfile
fi

patchrepo "$AOMP_REPOS/rocprofiler-sdk"
patchrepo "$AOMP_REPOS/rocm-systems"

if [ "$1" != "nocmake" ] && [ "$1" != "install" ] ; then
echo " "
Expand Down Expand Up @@ -76,6 +76,7 @@ if [ "$1" != "nocmake" ] && [ "$1" != "install" ] ; then

MYCMAKEOPTS=(-DCMAKE_PREFIX_PATH="$AOMP_INSTALL_DIR;$HOME/local/aqlprofile"
-DCMAKE_INSTALL_PREFIX="$INSTALL_ROCPROF_SDK"
-DCMAKE_PREFIX_PATH="$AOMP_INSTALL_DIR/rocm_sysdeps"
-DCMAKE_BUILD_TYPE="$BUILD_TYPE"
-DROCM_ROOT_DIR="$AOMP_INSTALL_DIR"
-DBUILD_SHARED_LIBS=On
Expand Down Expand Up @@ -128,7 +129,7 @@ if [ "$1" == "install" ] ; then
exit 1
fi

removepatch "$AOMP_REPOS/rocprofiler-sdk"
removepatch "$AOMP_REPOS/rocm-systems"
else
echo
echo "SUCCESSFUL BUILD, please run: $0 install"
Expand Down
6 changes: 3 additions & 3 deletions bin/build_rocr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ if [ "$1" != "nocmake" ] && [ "$1" != "install" ] ; then
declare -a MYCMAKEOPTS
MYCMAKEOPTS=(-DCMAKE_INSTALL_PREFIX="$INSTALL_ROCM"
-DCMAKE_BUILD_TYPE="$BUILDTYPE"
-DCMAKE_PREFIX_PATH="$AOMP_INSTALL_DIR/lib"
-DCMAKE_PREFIX_PATH="$AOMP_INSTALL_DIR/lib/llvm;$AOMP_INSTALL_DIR/rocm_sysdeps"
-DIMAGE_SUPPORT=OFF "${AOMP_ORIGIN_RPATH[@]}"
-DCMAKE_INSTALL_LIBDIR=lib
-DCMAKE_C_COMPILER="${AOMP_INSTALL_DIR}/lib/llvm/bin/clang"
Expand Down Expand Up @@ -89,7 +89,7 @@ if [ "$1" != "nocmake" ] && [ "$1" != "install" ] ; then
-DCMAKE_INSTALL_PREFIX="$AOMP_INSTALL_DIR"
-DCMAKE_INSTALL_LIBDIR=lib/asan
-DCMAKE_BUILD_TYPE="$BUILD_TYPE"
-DCMAKE_PREFIX_PATH="$AOMP_INSTALL_DIR/lib"
-DCMAKE_PREFIX_PATH="$AOMP_INSTALL_DIR/lib/llvm;$AOMP_INSTALL_DIR/rocm_sysdeps"
-DIMAGE_SUPPORT=OFF "${AOMP_ASAN_ORIGIN_RPATH[@]}"
-DBUILD_SHARED_LIBS=On)
mkdir -p "$BUILD_AOMP/build/rocr/asan"
Expand Down Expand Up @@ -117,7 +117,7 @@ if [ "$1" != "nocmake" ] && [ "$1" != "install" ] ; then
ROCR_CMAKE_OPTS=(-DCMAKE_C_COMPILER="$AOMP_INSTALL_DIR/lib/llvm/bin/clang"
-DCMAKE_CXX_COMPILER="$AOMP_INSTALL_DIR/lib/llvm/bin/clang++"
-DLLVM_DIR="$AOMP_INSTALL_DIR/lib/llvm/bin"
-DCMAKE_PREFIX_PATH="$AOMP_INSTALL_DIR/lib"
-DCMAKE_PREFIX_PATH="$AOMP_INSTALL_DIR/lib/llvm;$AOMP_INSTALL_DIR/rocm_sysdeps"
-DCMAKE_INSTALL_PREFIX="$AOMP_INSTALL_DIR"
-DCMAKE_BUILD_TYPE=Debug
"${AOMP_DEBUG_ORIGIN_RPATH[@]}"
Expand Down
22 changes: 17 additions & 5 deletions bin/build_supp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ EOF
}

SUPPLEMENTAL_COMPONENTS=${SUPPLEMENTAL_COMPONENTS:-openmpi silo hdf5 fftw ninja rocmopenmpi xpmem ucx ucc}
PREREQUISITE_COMPONENTS=${PREREQUISITE_COMPONENTS:-cmake rocmsmilib hwloc aqlprofile rocm-core}

# rocsmilib and hwloc build invocation moved to build_rocm_sysdeps.sh (libdrm support). rocmsmi is dependent on libdrm and hwloc depends on rocmsmi.
PREREQUISITE_COMPONENTS=${PREREQUISITE_COMPONENTS:-cmake aqlprofile rocm-core}

# --- Start standard header to set AOMP environment variables ----
realpath=$(realpath "$0")
Expand Down Expand Up @@ -752,7 +754,7 @@ function buildcmake(){

function buildrocmsmilib(){
_cname="rocmsmilib"
_version=7.1.x
_version=10.0
_installdir=$AOMP_SUPP_INSTALL/rocmsmilib-$_version
_linkfrom=$AOMP_SUPP/rocmsmilib
_builddir=$AOMP_SUPP_BUILD/rocmsmilib
Expand All @@ -767,11 +769,21 @@ function buildrocmsmilib(){
fi
runcmd "mkdir -p $_builddir"
runcmd "cd $_builddir"
runcmd "git clone -b release/rocm-rel-7.1 https://github.com/ROCm/rocm_smi_lib rocmsmilib-$_version"
runcmd "cd rocmsmilib-$_version"
runcmd "wget https://github.com/ROCm/rocm-systems/releases/download/therock-10.0/rocm-smi-lib.tar.gz"
runcmd "tar xf rocm-smi-lib.tar.gz"
runcmd "mv rocm-smi-lib rocm-smi-lib-$_version"
runcmd "cd rocm-smi-lib-$_version"

# Patch rocm_smi/CMakeLists.txt to add DRM_INCLUDE_DIRS to SMI_EXAMPLE_EXE. TheRock does not need this because they
# have a global include_directories() before rocm_smi is built. runcmd does not like the variables and expands them.
# Just run without the check for now.
# TODO: rocmsmi will be deprecated in 10.1
grep -Fq 'target_include_directories(${SMI_EXAMPLE_EXE} PRIVATE ${DRM_INCLUDE_DIRS})' rocm_smi/CMakeLists.txt || \
sed -i '/target_link_libraries(${SMI_EXAMPLE_EXE} ${ROCM_SMI_TARGET})/a target_include_directories(${SMI_EXAMPLE_EXE} PRIVATE ${DRM_INCLUDE_DIRS})' rocm_smi/CMakeLists.txt

runcmd "mkdir -p build"
runcmd "cd build"
runcmd "$AOMP_SUPP/cmake/bin/cmake -DCMAKE_INSTALL_PREFIX=$_installdir .."
runcmd "$AOMP_SUPP/cmake/bin/cmake -DCMAKE_INSTALL_PREFIX=$_installdir -DCMAKE_PREFIX_PATH=$ROCM_SYSDEPS_PATH .."
if [ -d "$_installdir" ] ; then
runcmd "rm -rf $_installdir"
fi
Expand Down
2 changes: 1 addition & 1 deletion bin/patches/patch-control-file_24.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ babelstream: babelstream-usm.patch
llvm-project: ATD_ASO_full.patch
UMT: umt.patch
rocm-xio: xio.patch
rocm-systems: rocm-systems-hip-drop-undefined-version-script-entries.patch
rocm-systems: rocm-systems-hip-drop-undefined-version-script-entries.patch rocm-systems-rocm-smi-drm-example-include.patch rocm-systems-rocprofiler-sdk-drm-include.patch
12 changes: 12 additions & 0 deletions bin/patches/rocm-systems-rocm-smi-drm-example-include.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/projects/rocm-smi-lib/rocm_smi/CMakeLists.txt b/projects/rocm-smi-lib/rocm_smi/CMakeLists.txt
index 88c7f34c..965296a1 100644
--- a/projects/rocm-smi-lib/rocm_smi/CMakeLists.txt
+++ b/projects/rocm-smi-lib/rocm_smi/CMakeLists.txt
@@ -81,6 +81,7 @@ set(SMI_EXAMPLE_EXE "rocm_smi_ex")

add_executable(${SMI_EXAMPLE_EXE} "example/rocm_smi_example.cc")
target_link_libraries(${SMI_EXAMPLE_EXE} ${ROCM_SMI_TARGET})
+target_include_directories(${SMI_EXAMPLE_EXE} PRIVATE ${DRM_INCLUDE_DIRS})
add_library(${ROCM_SMI_TARGET} ${CMN_SRC_LIST} ${SMI_SRC_LIST} ${CMN_INC_LIST} ${SMI_INC_LIST})
target_link_libraries(${ROCM_SMI_TARGET} PRIVATE pthread rt dl)
target_include_directories(
12 changes: 12 additions & 0 deletions bin/patches/rocm-systems-rocprofiler-sdk-drm-include.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/projects/rocprofiler-sdk/source/lib/aqlprofile/CMakeLists.txt b/projects/rocprofiler-sdk/source/lib/aqlprofile/CMakeLists.txt
index 7d6e67a064..6b5fa842b7 100644
--- a/projects/rocprofiler-sdk/source/lib/aqlprofile/CMakeLists.txt
+++ b/projects/rocprofiler-sdk/source/lib/aqlprofile/CMakeLists.txt
@@ -35,6 +35,7 @@ target_link_libraries(
$<BUILD_INTERFACE:rocprofiler-sdk::rocprofiler-sdk-dl>
$<BUILD_INTERFACE:rocprofiler-sdk::rocprofiler-sdk-hsa-runtime-nolink>)
set_target_properties(rocprofiler-sdk-aqlprofile PROPERTIES POSITION_INDEPENDENT_CODE ON)
+target_include_directories(rocprofiler-sdk-aqlprofile PRIVATE ${DRM_INCLUDE_DIRS} ${DRM_AMDGPU_INCLUDE_DIRS})

add_subdirectory(core)
add_subdirectory(util)
2 changes: 1 addition & 1 deletion test/smoke-limbo/launch_latency/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ CLANG ?= clang
OMP_BIN = $(AOMP)/bin/$(CLANG)
CC = $(OMP_BIN) $(VERBOSE)
RUNENV = ulimit -s unlimited;
RUNCMD = $(AOMPHIP)/bin/rocprofv3 --output-format csv --kernel-trace --stats -- ./$(TESTNAME) && python3 printLatency.py
RUNCMD = bash ./run_launch_latency.sh $(AOMPHIP)

#-ccc-print-phases
#"-\#\#\#"
Expand Down
20 changes: 20 additions & 0 deletions test/smoke-limbo/launch_latency/run_launch_latency.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
# rocprofv3 messages go to rocprofv3.log.
# Print that log only when this run fails, and keep the failing status.

aomphip=$1
log=rocprofv3.log

exit_with_log() {
status=$1
if [ "$status" -ne 0 ]; then
cat "$log"
exit "$status"
fi
}

"$aomphip/bin/rocprofv3" --output-format csv --kernel-trace --stats -- ./launch_latency 2>"$log"
exit_with_log $?

python3 printLatency.py
exit_with_log $?
Loading