You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
966 B
37 lines
966 B
#!/bin/bash
|
|
|
|
export PATH=/usr/local/cuda-11.5/bin:$PATH
|
|
export LD_LIBRARY_PATH=/usr/local/cuda-11.5/lib64:$LD_LIBRARY_PATH
|
|
|
|
# Set the number of test samples (default: 1000, but can be reduced for faster testing)
|
|
NUM_SAMPLES=100
|
|
if [ "$1" != "" ]; then
|
|
NUM_SAMPLES=$1
|
|
fi
|
|
|
|
echo "Running tests with $NUM_SAMPLES samples..."
|
|
|
|
# Get the directory of this script
|
|
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
|
|
PROJECT_DIR=$(dirname "$SCRIPT_DIR")
|
|
cd "$PROJECT_DIR"
|
|
|
|
# Make sure the build directory exists
|
|
mkdir -p build
|
|
|
|
# Build the C++ code
|
|
cd build
|
|
echo "Building C++ code..."
|
|
cmake ..
|
|
make -j$(nproc)
|
|
|
|
# Run the C++ test program to generate samples and outputs
|
|
echo "Running C++ tests..."
|
|
./test_models ../test/input_samples ../test/output $NUM_SAMPLES
|
|
|
|
# Run the Python comparison script
|
|
cd "$PROJECT_DIR"
|
|
echo "Running Python comparison..."
|
|
python test/compare_models.py --num-samples $NUM_SAMPLES
|
|
|
|
echo "Tests complete! View results in test/comparison/report.html"
|