#!/bin/sh
cd "$(dirname "$(realpath "$0")")"
set -e
alias log="echo '[build.sh]'"

TARGET="ex1 ex2 ex3"

if [ $# -gt 0 ]
then targets=$@
fi


rm -fr bin
mkdir -p bin

ccargs=""
#ccargs="$ccargs -g -G -Xcompiler -fsanitize=address"


for target in $targets
do
	echo ""
	nvcc $ccargs -o bin/${target}.out src/${target}.cu
	./bin/${target}.out
done
