Development Setup
We work with CMake for building and testing the project. The usual things apply. We also have different CMake presets for using sanitizers and different compilers etc.
-
Build requirements
Terminal window apt install cmake gcc ninja-buildTerminal window module load GCC CUDA Ninja CMake -
Build and run tests
Terminal window cmake -B build -G Ninjacmake --build build./build/tests/testsTerminal window cmake --preset debugcmake --build --preset debugctest --preset debugTerminal window cmake --workflow --preset dev
Intel-LLVM
Section titled “Intel-LLVM”module load intel-compilers/2024.2.0 GCCcore/14.3.0 CUDA/12.8.0 Ninja/1.13.0 CMake/4.0.3cmake --preset linux-icpx-debugmodule load GCCcore Clang CUDA Ninja CMakecmake --preset linux-clang-debug-
Build
Terminal window cmake --build build --target tests -
Run
The tests can be run using
ctestTerminal window ctest --test-dir buildor just
Terminal window ./build/tests/tests
Tests can be written in an .itl or directly in CUDA C++.
Most tests are generated using the test_converter.py script. Simply do:
python tests/test_converter.pyThe tests are written in ITL. They come from various other interval arithmetic libraries.
To write new ones, add a new file into the itl folder and provide tests in the ITL format. E.g.,
/* Multiline comment*/// regular commenttestcase section.test1 { add [10.0, 20.0] [13.0, 17.0] = [23.0, 37.0]; sub [10.0, 20.0] [13.0, 16.0] = [-6.0, 7.0]; neg [-infinity, infinity] = [-infinity, infinity]; pos [10.0, 20.0] = [10.0, 20.0];}
testcase test_outside_of_section { isEmpty [nai] = false; // nai stands for not-an-interval isEmpty [empty] = true; convexHull [1.0,3.0] [entire] = [entire]; // entire = [-∞, ∞] cbrt [0x40p0, 0x7dp0] = [4.0, 5.0]; // hexfloat supported}All handwritten tests need to be included in the tests_additional.h header and should follow a similar structure as the existing tests.