forked from facebookresearch/TensorComprehensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.sh
executable file
·17 lines (11 loc) · 899 Bytes
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#! /bin/bash
set -e
NGPU=$(nvidia-smi -L | wc -l)
let DEFAULT_PAR="${NGPU}"
NPAR=${NPAR:=${DEFAULT_PAR}}
FILTER_OUT=${FILTER_OUT:=some-weird-name-that-we-never-hit}
find build -name "test_*" -type f -executable -name "*${FILTER}*" | grep -v ${FILTER_OUT} | xargs -n 1 -P ${NPAR} -i bash -c 'echo Running {}; CUDA_VISIBLE_DEVICES=${CUDA_VISIBLE_DEVICES:=$((RANDOM % '"${NGPU}"'))} ./{} "'"$@"'" || exit 255' \
|| (echo "$(tput setaf 1)Some tests are broken $(tput sgr 0)" && exit 1)
find build -name "example_*" -type f -executable -name "*${FILTER}*" | grep -v ${FILTER_OUT} | xargs -n 1 -P ${NPAR} -i bash -c 'echo Running {}; CUDA_VISIBLE_DEVICES=${CUDA_VISIBLE_DEVICES:=$((RANDOM % '"${NGPU}"'))} ./{} --benchmark_warmup=0 --benchmark_iterations=1"'"$@"'" --disable_version_checks || exit 255' \
|| (echo "$(tput setaf 1)Some tests are broken $(tput sgr 0)" && exit 1)
echo SUCCESS