Compatibility with Sapporo

This commit is contained in:
Yohai Meiron 2020-11-03 21:48:46 -05:00
parent 21bba88d27
commit c6c95c393c
5 changed files with 96 additions and 8 deletions

9
sapporo2/get_sapporo.sh Executable file
View file

@ -0,0 +1,9 @@
#!/bin/bash
commit=7c3f80acf1df5a8907118706a2260184cfccc6a1
archive_md5sum=b7b17eeded2cb5dfb9e174424b3f7ecb
url=https://github.com/treecode/sapporo2/archive/$commit.tar.gz
wget -O sapporo2.tar.gz $url
md5sum --check <<<"$archive_md5sum sapporo2.tar.gz"
tar --strip-components=1 -xvf sapporo2.tar.gz
rm -f sapporo2.tar.gz
patch -p0 < patch.diff

54
sapporo2/patch.diff Normal file
View file

@ -0,0 +1,54 @@
diff -ruN
--- lib/CUDAKernels/kernels.cu
+++
@@ -206,7 +206,7 @@
// template<> __device__ __forceinline__ double RSQRT(double val) { return 1.0/sqrt(val); }
-
+#if (CUDART_VERSION <= 8000)
__device__ double atomicAdd(double* address, double val)
{
unsigned long long int* address_as_ull =
@@ -220,7 +220,7 @@
} while (assumed != old);
return __longlong_as_double(old);
}
-
+#endif
__device__ __forceinline__ double atomicMin(double *address, double val)
{
diff -ruN
--- lib/Makefile
+++
@@ -5,7 +5,8 @@
.SUFFIXES: .o .cpp .ptx .cu
-CUDA_TK ?= /usr/local/cuda
+CUDAHOME ?= /usr/local/cuda
+CUDA_TK = $(CUDAHOME)
testRunFlags1=
@@ -36,17 +37,8 @@
NVCC = $(CUDA_TK)/bin/nvcc
-# Support older CUDA versions out of the box
-NVCCVERSION=$(shell "${NVCC}" --version | grep ^Cuda | sed 's/^.* //g')
-ifeq "${NVCCVERSION}" "V5.5.22"
- NVCCFLAGS ?= -arch sm_20
-else
- NVCCFLAGS ?= -arch sm_30
-endif
-
-#NVCCFLAGS = -arch sm_35
-#NVCCFLAGS ?= -arch sm_30
-#NVCCFLAGS = -arch sm_20
+GPUARCH ?= sm_75
+NVCCFLAGS = -arch $(GPUARCH)
NVCCFLAGS += ${testRunFlags}
# Use with Mac OS X