File: upstream-testsuite

package info (click to toggle)
cccl 2.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 39,248 kB
  • sloc: cpp: 264,457; python: 6,421; sh: 2,762; perl: 460; makefile: 114; xml: 13
file content (74 lines) | stat: -rwxr-xr-x 1,448 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/sh
set -e

host=
device=${1:-CPP}

CPP=ON
CUDA=OFF
TBB=ON
OMP=ON
case $device in
	CUDA)
		CUDA=ON
		;;
	*/CUDA)
		host=${device%/CUDA}
		device=CUDA
		CPP=OFF
		CUDA=ON
		TBB=OFF
		OMP=OFF
		eval ${host}=ON
		;;
esac

CPP14=OFF
CPP17=OFF
eval CPP${2:-17}=ON

CXX="${3:-g++}"

p=" ${DEB_BUILD_OPTIONS} "
p=${p##* parallel=}
p=${p%% *}
p=${p:-$(nproc)}

if [ "$CXX" != "cuda-g++" ]; then
	if [ "$(readlink -f /usr/bin/$CXX)" = "$(readlink -f /usr/bin/cuda-g++)" ]; then
		# do not rerun the cuda-g++ test
		exit 77
	fi
fi

AUTOPKGTEST_TMP=${AUTOPKGTEST_TMP:-$(mktemp -d)}

set -x

cmake \
	-S . \
	-B $AUTOPKGTEST_TMP \
	${3:+-DCMAKE_C_COMPILER=$(echo "$3" | tr + c) -DCMAKE_CXX_COMPILER=$3} \
	-DTHRUST_ENABLE_MULTICONFIG=ON \
	-DTHRUST_MULTICONFIG_ENABLE_DIALECT_CPP11=OFF \
	-DTHRUST_MULTICONFIG_ENABLE_DIALECT_CPP14=$CPP14 \
	-DTHRUST_MULTICONFIG_ENABLE_DIALECT_CPP17=$CPP17 \
	-DTHRUST_MULTICONFIG_ENABLE_SYSTEM_CPP=$CPP \
	-DTHRUST_MULTICONFIG_ENABLE_SYSTEM_CUDA=$CUDA \
	-DTHRUST_MULTICONFIG_ENABLE_SYSTEM_TBB=$TBB \
	-DTHRUST_MULTICONFIG_ENABLE_SYSTEM_OMP=$OMP \
	-DTHRUST_MULTICONFIG_WORKLOAD=LARGE \
	${host:+-DTHRUST_HOST_SYSTEM_OPTIONS=$host} \
	-DTHRUST_DEVICE_SYSTEM_OPTIONS=$device \
	-D_THRUST_CMAKE_DIR=/usr/share/cmake/thrust \
	-DTHRUST_INSTALL_CUB_HEADERS=OFF \
	-DTHRUST_INSTALL_LIBCUDACXX_HEADERS=OFF \
	-Wno-dev

cd $AUTOPKGTEST_TMP

make -k ${p:+-j $p}

test "$device" = "CUDA" || ctest --output-on-failure

make clean