Status: current · test counts are whatever ctest -N lists for your tree
Run the narrowest scope that covers your change. The full suite takes 15-20 minutes and a few binaries hold nearly all of it.
| scope | command |
|---|---|
| one test case | ./build/tests/stedc_tests --gtest_filter='StedcTest/0.BatchedMatrices' |
| one binary | ctest -R '^stedc_tests$' |
| one component | ctest -L tridiag |
| everything quick | ctest -LE slow (count: ctest -N -LE slow) |
| everything | ctest (count: ctest -N) |
Counts move as binaries are added, so none is written here: read them off ctest -N (see the CI page). ctest -R is a substring regex: -R syev matches syev_tests, syevx_tests, syev_cta_tests. Anchor with ^...$ for one binary.
For anything wider than one binary, use scripts/ctest_gpus.sh with ctest's arguments:
Measured -LE slow on threadripper02 (4x RTX PRO 6000), the only box validated:
| mode | time |
|---|---|
| serial, one GPU visible | 469 s |
| 1 slot per GPU | 126 s |
| 2 slots per GPU | 78 s |
Failing names are identical in all modes. On the 2x RTX 4090 box (125 GB, zero swap, two OOM kills under concurrency; docs/ci.md) keep the full gate serial. On threadripper02 a process that sees all four GPUs runs several times slower than one that sees one (cause unknown); set CUDA_VISIBLE_DEVICES when running a binary by hand.
Component labels, one per binary (see CMakeLists.txt): util, blas, ortho, tridiag, eig, sparse. Run ctest -L <component> for the subsystem you touched. After changing shared low-level code (Queue, Matrix/MatrixView, the memory pool, sg_partition, anything under include/batchlas/util) run the full suite.
The slow label (BATCHLAS_SLOW_TESTS in tests/CMakeLists.txt) marks stedc_tests, steqr_tests, sytrd_sb2st_tests, gesvd_tests and consumer_package_tests. ctest -LE slow is a good broad check but not a pre-push gate. Label a test slow when it grows past about 15 s, and remove the label when it no longer dominates.
sg_partition_tests covers src/kernels/common/sg_partition/ (SubGroupPartition<P, Masked> and every collective). It is header-only, links no BatchLAS library, and builds alone: cmake --build build --target sg_partition_tests. Run it once per device:
Typed suites derive from test_utils::BatchLASTest<Config> (tests/test_utils.hh); Config carries ScalarType and BackendVal. Type lists: backend_types<Config> (every compiled backend x float, double, std::complex<float>, std::complex<double>), backend_types_filtered<Config, IncludeComplex>, backend_types_complex<Config>.
SetUp(), in order:
TearDown() waits on the queue. A suite must not declare its own ctx or SetUp(); put per-suite state in the derived fixture.
Note: NETLIB instantiations exist only when CPU device code is compiled (BATCHLAS_HAS_CPU_TARGET). Under dev-gpu-tests they vanish from the type lists and typed-test indices shift (SteqrTest/0 becomes float/CUDA). See CPU SYCL target detection.
Two runtime filters from BatchLASTest work on any binary, directly or through ctest:
| variable | accepted values (case-insensitive) | runs |
|---|---|---|
| BATCHLAS_TEST_BACKEND | CUDA, ROCM, NETLIB | only that backend's instantiations |
| BATCHLAS_TEST_FLOAT_TYPE | float | float and std::complex<float> |
| double | double and std::complex<double> | |
| complex | both complex types |
The two combine. BATCHLAS_TEST_BACKEND=CUDA is the largest lever: NETLIB instantiations run host O(n^3) reference solves (91% of steqr_tests runtime). Original CUDA-only vs all-backend timings (suites have changed since; the ratio is the point): trmm_tests ~1.5 s vs ~58 s, stedc_tests ~7.6 s vs ~34 s, trsm_tests ~1.2 s vs ~5.4 s, gemv_tests ~0.4 s vs ~1.8 s.
Warning: both filters are GTEST_SKIP()s. Case list and pass count look unchanged while the filtered coverage is gone, and startup is not cut. An unrecognised value skips every case: BATCHLAS_TEST_BACKEND=cuda0 warns, BATCHLAS_TEST_FLOAT_TYPE=single skips silently. A run where everything skipped is not a pass.
A launch that finds no device image for its kernel ("No kernel named ...") fails the test. BATCHLAS_TEST_ALLOW_MISSING_KERNEL=1 turns that into a skip, for a deliberately partial -fsycl-targets build only (test_utils::may_skip_missing_kernel).
The suite is not green on main. tests/known-failures.txt lists accepted failures by test name, and for typed tests by pinned type parameter; each block names its cause. CI diffs every run against that ledger; see the CI page.