mirror of
https://github.com/augustin64/projet-tipe
synced 2025-01-24 07:36:24 +01:00
Fix compilation with nvcc
This commit is contained in:
parent
08f1a29bb0
commit
7c0b70ce25
9
make.sh
9
make.sh
@ -4,6 +4,14 @@ OUT="out"
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
compile_cuda () {
|
||||||
|
# nvcc will compile .c files as if they did not have
|
||||||
|
# CUDA program parts so we need to copy them to .cu
|
||||||
|
cp $1 "$1"u
|
||||||
|
nvcc "$1"u ${*:1}
|
||||||
|
rm "$1"u
|
||||||
|
}
|
||||||
|
|
||||||
build () {
|
build () {
|
||||||
mkdir -p "$OUT"
|
mkdir -p "$OUT"
|
||||||
[[ $1 ]] || set "main"
|
[[ $1 ]] || set "main"
|
||||||
@ -146,6 +154,7 @@ usage () {
|
|||||||
if [[ "$CC" == "gcc" ]]; then
|
if [[ "$CC" == "gcc" ]]; then
|
||||||
FLAGS="-std=c99 -lm -lpthread" # GCC flags
|
FLAGS="-std=c99 -lm -lpthread" # GCC flags
|
||||||
elif [[ "$CC" == "nvcc" ]]; then
|
elif [[ "$CC" == "nvcc" ]]; then
|
||||||
|
CC=compile_cuda
|
||||||
FLAGS="" # NVCC flags
|
FLAGS="" # NVCC flags
|
||||||
else
|
else
|
||||||
FLAGS=""
|
FLAGS=""
|
||||||
|
Loading…
Reference in New Issue
Block a user