Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CUPLA: check for cuda gcc support #5678

Merged
merged 2 commits into from Mar 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions cuda-toolfile.spec
Expand Up @@ -178,13 +178,11 @@ cat << \EOF_TOOLFILE >%{i}/etc/scram.d/nvidia-drivers.xml
</tool>
EOF_TOOLFILE

touch cuda_gcc_supported.cu
if [ $(nvcc -dc cuda_gcc_supported.cu -o cuda_gcc_supported.cu.o 2>&1 | grep 'unsupported GNU version' | wc -l) -eq 0 ] ; then
if [ $(%{cuda_gcc_support}) = true ] ; then
cat << \EOF_TOOLFILE >%{i}/etc/scram.d/cuda-gcc-support.xml
<tool name="cuda-gcc-support" version="@TOOL_VERSION@">
</tool>
EOF_TOOLFILE
fi
rm -f cuda_gcc_supported.*

## IMPORT scram-tools-post
13 changes: 7 additions & 6 deletions cupla.spec
Expand Up @@ -37,12 +37,13 @@ done
g++ $CXXFLAGS $HOST_FLAGS build/tbb/*.o -L$TBB_ROOT/lib -ltbb -shared -o lib/libcupla-tbb.so

# build the CUDA GPU backend
mkdir build/cuda
for FILE in $FILES; do
nvcc -DALPAKA_ACC_GPU_CUDA_ENABLED -DCUPLA_STREAM_ASYNC_ENABLED=1 $CXXFLAGS $NVCC_FLAGS -Xcompiler "$HOST_FLAGS" -x cu -c $FILE -o build/cuda/$(basename $FILE).o
done
g++ $CXXFLAGS $HOST_FLAGS build/cuda/*.o -L$CUDA_ROOT/lib64 -lcudart -shared -o lib/libcupla-cuda.so

if [ $(%{cuda_gcc_support}) = true ] ; then
mkdir build/cuda
for FILE in $FILES; do
nvcc -DALPAKA_ACC_GPU_CUDA_ENABLED -DCUPLA_STREAM_ASYNC_ENABLED=1 $CXXFLAGS $NVCC_FLAGS -Xcompiler "$HOST_FLAGS" -x cu -c $FILE -o build/cuda/$(basename $FILE).o
done
g++ $CXXFLAGS $HOST_FLAGS build/cuda/*.o -L$CUDA_ROOT/lib64 -lcudart -shared -o lib/libcupla-cuda.so
fi

%install
cp -ar include %{i}/include
Expand Down
1 change: 1 addition & 0 deletions rpm-preamble.file
Expand Up @@ -290,3 +290,4 @@ fi
%define is_ncmsos %(case %{cmsos} in (%1_*) echo 0 ;; (*) echo 1 ;; esac)
%define is_cmsarch %(case %{cmsos} in (*_%1) echo 1 ;; (*) echo 0 ;; esac)
%define is_ncmsarch %(case %{cmsos} in (*_%1) echo 0 ;; (*) echo 1 ;; esac)
%define cuda_gcc_support touch cuda_gcc_supported.cu; if [ $(nvcc -dc cuda_gcc_supported.cu -o cuda_gcc_supported.cu.o 2>&1 | grep 'unsupported GNU version' | wc -l) -eq 0 ] ; then echo true; else echo false; fi ; rm -f cuda_gcc_supported.cu*