File: run_tests.sh

package info (click to toggle)
pytorch-cuda 2.6.0%2Bdfsg-7
  • links: PTS, VCS
  • area: contrib
  • in suites: forky, sid, trixie
  • size: 161,620 kB
  • sloc: python: 1,278,832; cpp: 900,322; ansic: 82,710; asm: 7,754; java: 3,363; sh: 2,811; javascript: 2,443; makefile: 597; ruby: 195; xml: 84; objc: 68
file content (61 lines) | stat: -rwxr-xr-x 1,729 bytes parent folder | download | duplicates (3)
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
#!/bin/bash
set -x
set -e

VALGRIND_SUP="${PWD}/`dirname $0`/valgrind.sup"
export CPP_TESTS_DIR=$1

VALGRIND=${VALGRIND:=ON}
python test/run_test.py --cpp --verbose -i \
  cpp/basic \
  cpp/atest \
  cpp/scalar_test \
  cpp/broadcast_test \
  cpp/wrapdim_test \
  cpp/apply_utils_test \
  cpp/dlconvertor_test \
  cpp/native_test \
  cpp/scalar_tensor_test \
  cpp/undefined_tensor_test \
  cpp/extension_backend_test \
  cpp/lazy_tensor_test \
  cpp/tensor_iterator_test \
  cpp/Dimname_test \
  cpp/Dict_test \
  cpp/NamedTensor_test \
  cpp/cpu_generator_test \
  cpp/legacy_vmap_test \
  cpp/operators_test

run_if_exists() {
  local test_name="$1"
  if [[ -x "${CPP_TESTS_DIR}/${test_name}" ]]; then
    python test/run_test.py --cpp --verbose -i "cpp/${test_name}"
  else
    echo "Warning: $test_name does not exist."
  fi
}

run_if_exists tensor_interop_test
run_if_exists cudnn_test
run_if_exists cuda_generator_test
run_if_exists apply_test
run_if_exists stream_test
run_if_exists cuda_half_test
run_if_exists cuda_vectorized_test
run_if_exists cuda_distributions_test
run_if_exists cuda_optional_test
run_if_exists cuda_tensor_interop_test
run_if_exists cuda_complex_test
run_if_exists cuda_complex_math_test
run_if_exists cuda_cub_test
run_if_exists cuda_atomic_ops_test

if [ "$VALGRIND" == "ON" ]; then
  # NB: As these tests are invoked by valgrind, let's leave them for now as it's
  # unclear if valgrind -> python -> gtest would work
  valgrind --suppressions="$VALGRIND_SUP" --error-exitcode=1 "${CPP_TESTS_DIR}/basic" --gtest_filter='-*CUDA'
  if [[ -x ${CPP_TESTS_DIR}/tensor_interop_test ]]; then
    valgrind --suppressions="$VALGRIND_SUP" --error-exitcode=1 "${CPP_TESTS_DIR}/tensor_interop_test"
  fi
fi