notes-ing2/gpu/tp1/c/build.sh
2024-03-10 21:31:32 +01:00

20 lines
278 B
Bash
Executable file

#!/bin/sh
cd "$(dirname "$(realpath "$0")")"
set -e
TARGET="ex1.cu ex2.cu ex3.cu ex4.cu"
if [ $# -gt 0 ]
then TARGET=$1
fi
rm -fr bin
mkdir -p bin
for target in $TARGET
do nvcc src/$target -o bin/${target%.cu}.out
done
for target in $TARGET
do ./bin/${target%.cu}.out
done