@@ -65,6 +65,23 @@ check_rust() {
6565 echo " [OK] Clippy checks passed!"
6666}
6767
68+ check_miri () {
69+ echo " [INFO] Running cargo miri..."
70+ rustup +nightly component add miri
71+ export MIRIFLAGS=" -Zmiri-disable-isolation"
72+ if command -v nvidia-smi > /dev/null 2>&1 && nvidia-smi > /dev/null 2>&1 ; then
73+ echo " [INFO] CUDA GPU detected — but miri not supported for FFI( unsupported operation: can't call foreign function ` cudaMalloc` on OS ` linux` )..."
74+ // cargo +nightly miri nextest run --features gpu --no-fail-fast --test-threads=4
75+ else
76+ echo " [INFO] Running CPU tests with miri..."
77+ cargo +nightly miri nextest run --no-default-features --no-fail-fast --test-threads=4
78+ echo " [WARN] CUDA GPU not detected — skipping GPU tests."
79+ echo " [INFO] (CUDA toolkit may be installed, but no working GPU/driver found)"
80+ fi
81+
82+ echo " [OK] Miri checks passed!"
83+ }
84+
6885check_cpp () {
6986 echo " [INFO] Checking CPP"
7087 files=$( find . -type f \( -name " *.cpp" -o -name " *.cc" -o -name " *.cxx" -o -name " *.hpp" -o -name " *.h" -o -name " *.cu" -o -name " *.cuh" \) )
@@ -129,6 +146,7 @@ help() {
129146 echo " check - Run cargo check, fmt, and clippy"
130147 echo " build - Only build the workspace (runs check first)"
131148 echo " test - Only run tests"
149+ echo " miri - Run miri checks"
132150 echo " coverage - Run coverage"
133151 echo " all - Run check, build, and test"
134152 echo " help - Show this help message"
@@ -152,6 +170,9 @@ main() {
152170 test)
153171 test
154172 ;;
173+ miri)
174+ check_miri
175+ ;;
155176 coverage)
156177 coverage
157178 ;;
0 commit comments