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
16 changes: 14 additions & 2 deletions .github/workflows/aomp-shell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,22 @@ jobs:

- name: Run shellcheck
run: |
shellcheck_status=0
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
if [[ $file == *.sh ]]; then
echo "Running shellcheck on $file"
shellcheck -x "$file"
file_dir=$(dirname "$file")
file_name=$(basename "$file")

echo "Running shellcheck on $file in directory $file_dir"
pushd "$file_dir"

shellcheck -x "$file_name"
if [ $? -ne 0 ]; then
shellcheck_status=1
fi

popd
fi
done
exit $shellcheck_status
shell: bash {0}
18 changes: 8 additions & 10 deletions utils/kokkos_build-cgsolve.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
#
# Written by Jan-Patrick Lehr <JanPatrick.Lehr@amd.com>
#
PROGVERSION="X.Y-Z"
#


function print_info() {
toPrint="$1"
Expand All @@ -41,7 +40,7 @@ function print_error() {

AOMP="${AOMP:-_AOMP_INSTALL_DIR_}"

if [ ! -d $AOMP ] ; then
if [ ! -d "${AOMP}" ] ; then
print_error "AOMP is not installed in ${AOMP}. Please set the environment variable."
exit 1
fi
Expand All @@ -53,21 +52,21 @@ KOKKOS_EXAMPLES_REPO=https://github.com/kokkos/kokkos-openmptarget-examples.git
NUM_THREADS=${NUM_THREADS:-8}

COMPILERNAME_TO_USE=${_COMPILER_TO_USE_:-clang++}
AOMP_VERSION=$($AOMP/bin/${COMPILERNAME_TO_USE} --version | head -n 1)
# AOMP_VERSION=$($AOMP/bin/${COMPILERNAME_TO_USE} --version | head -n 1)

cd $GIT_DIR || exit 1
cd "$GIT_DIR" || exit 1

if [ "$1" == "clean" ]; then
print_info "Removing $KOKKOS_EXAMPLES_SOURCE_DIR"
rm -rf $KOKKOS_EXAMPLES_SOURCE_DIR
rm -rf "$KOKKOS_EXAMPLES_SOURCE_DIR"
exit 0
fi

# Get the source code
git clone $KOKKOS_EXAMPLES_REPO $KOKKOS_EXAMPLES_SOURCE_DIR
git clone "$KOKKOS_EXAMPLES_REPO" "$KOKKOS_EXAMPLES_SOURCE_DIR"

# Change to the directory
cd $KOKKOS_EXAMPLES_SOURCE_DIR || exit 1
cd "$KOKKOS_EXAMPLES_SOURCE_DIR" || exit 1

cd cgsolve || exit 1

Expand All @@ -85,5 +84,4 @@ sed -i "s/-march=gfx90a/-march=$AOMP_GPU/" ../Makefile.inc
cmd="PATH=$AOMP/bin:$PATH CXX=clang++ make KOKKOS_PATH=$KOKKOS_SOURCE_DIR arch=MI250x backend=ompt comp=rocmclang"

print_info "$cmd"
PATH=$AOMP/bin:$PATH CXX=clang++ make KOKKOS_PATH=$KOKKOS_SOURCE_DIR arch=MI250x backend=ompt comp=rocmclang -j${NUM_THREADS}
#OFFLOAD_FLAGS='-ffast-math -fopenmp-target-fast'
PATH=$AOMP/bin:$PATH CXX=clang++ make KOKKOS_PATH="$KOKKOS_SOURCE_DIR" arch=MI250x backend=ompt comp=rocmclang -j"${NUM_THREADS}"