Skip to content

Commit

Permalink
Convert run_test.yml to run_test.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
SimeonEhrig committed Jun 4, 2020
1 parent c160b0a commit ee4569b
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 63 deletions.
12 changes: 6 additions & 6 deletions script/compiler_base.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
include:
- local: '/script/run_test.yml'

.base_gcc:
image: registry.gitlab.com/hzdr/crp/alpaka-group-container/alpaka-ci:gcc
variables:
Expand All @@ -9,7 +6,8 @@ include:
-DALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLE=ON
-DALPAKA_ACC_CPU_B_OMP2_T_SEQ_ENABLE=ON"
# -DALPAKA_ACC_CPU_B_SEQ_T_THREADS_ENABLE=ON
extends: .test_job
script:
- script/run_test.sh
# x86_64 tag is used to get a multi-core CPU for the tests
tags:
- x86_64
Expand All @@ -22,7 +20,8 @@ include:
-DALPAKA_ACC_CPU_B_OMP2_T_SEQ_ENABLE=ON"
# -DALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLE=ON
# -DALPAKA_ACC_CPU_B_SEQ_T_THREADS_ENABLE=ON
extends: .test_job
script:
- script/run_test.sh
# x86_64 tag is used to get a multi-core CPU for the tests
tags:
- x86_64
Expand All @@ -36,7 +35,8 @@ include:
before_script:
- nvidia-smi
- nvcc --version
extends: .test_job
script:
- script/run_test.sh
tags:
- cuda
- intel
76 changes: 76 additions & 0 deletions script/run_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#!/bin/bash

# the default build type is Release
# if neccesary, you can rerun the pipeline with another build type-> https://docs.gitlab.com/ee/ci/pipelines.html#manually-executing-pipelines
# to change the build type, you must set the environment variable CUPLA_BUILD_TYPE

if [[ ! -v CUPLA_BUILD_TYPE ]] ; then
CUPLA_BUILD_TYPE=Release ;
fi

echo "number of processor threads $(nproc)"
$CXX --version
cmake --version
echo "Boost version-> $BOOST_VERSION"
export cupla_DIR=$CI_PROJECT_DIR

# use one build directory for all build configurations
mkdir build
cd build
echo "Build type-> $CUPLA_BUILD_TYPE"

# ALPAKA_ACCS contains the backends, which are used for each build
# the backends are set in the sepcialized base jobs .base_gcc,.base_clang and.base_cuda
for CMAKE_FLAGS in $ALPAKA_ACCS ; do
echo "###################################################"
echo "# Example Matrix Multiplication (adapted original)"
echo "###################################################"
echo "can not run with CPU_B_SEQ_T_SEQ due to missing elements layer in original SDK example"
echo "CPU_B_SEQ_T_OMP2/THREADS too many threads necessary (256)"
if [[ $CMAKE_FLAGS =~ -*DALPAKA_ACC_GPU_CUDA_ENABLE=ON.* ]]; then
cmake $cupla_DIR/example/CUDASamples/matrixMul/ \
-DBOOST_ROOT=/opt/boost/$BOOST_VERSION \
$CMAKE_FLAGS \
-DCMAKE_BUILD_TYPE=$CUPLA_BUILD_TYPE
make -j
time ./matrixMul -wA=64 -wB=64 -hA=64 -hB=64
rm -r * ;
fi

echo "###################################################"
echo "# Example Async API (adapted original)"
echo "###################################################"
echo "can not run with CPU_B_SEQ_T_SEQ due to missing elements layer in original SDK example"
echo "CPU_B_SEQ_T_OMP2/THREADS too many threads necessary (512)"
if [[ $CMAKE_FLAGS =~ -*DALPAKA_ACC_GPU_CUDA_ENABLE=ON.* ]]; then
cmake $cupla_DIR/example/CUDASamples/asyncAPI/ \
-DBOOST_ROOT=/opt/boost/$BOOST_VERSION \
$CMAKE_FLAGS \
-DCMAKE_BUILD_TYPE=$CUPLA_BUILD_TYPE
make -j
time ./asyncAPI
rm -r * ;
fi

echo "###################################################"
echo "# Example Async API (added elements layer)"
echo "###################################################"
cmake $cupla_DIR/example/CUDASamples/asyncAPI_tuned/ \
-DBOOST_ROOT=/opt/boost/$BOOST_VERSION \
$CMAKE_FLAGS \
-DCMAKE_BUILD_TYPE=$CUPLA_BUILD_TYPE
make -j
time ./asyncAPI_tuned
rm -r *

echo "###################################################"
echo "Example vectorAdd (added elements layer)"
echo "###################################################"
cmake $cupla_DIR/example/CUDASamples/vectorAdd/ \
-DBOOST_ROOT=/opt/boost/$BOOST_VERSION \
$CMAKE_FLAGS \
-DCMAKE_BUILD_TYPE=$CUPLA_BUILD_TYPE
make -j
time ./vectorAdd 100000
rm -r * ;
done
57 changes: 0 additions & 57 deletions script/run_test.yml

This file was deleted.

0 comments on commit ee4569b

Please sign in to comment.