|
NForge
Tensor library
|
A C++ tensor library meant to feel like NumPy or PyTorch idk.
sum, mean, min, max, prod, norm)See INTRO.md for more examples.
Using CMake and FetchContent with your project.
Documentation is built using Doxygen and Github Actions, then hosted on Github Pages on the branch gh-pages.
See marbjo07.github.io/NForge/docs
To generate documentation locally, ensure Doxygen is installed, then from project root:
Requires the CUDA Toolkit. MSBuild is recommended on Windows.
Unit and integration tests use Catch2 and live under tests/.
Run after building:
Make sure CMake was configured with NFORGE_BUILD_TESTS.
Benchmarks run on merge with main branch. A performance regression blocks merging.
Current benchmarks are the examples from physics scenarios with default parameters and some microbenchmarks for various hotpath functions. The results are published to marbjo07.github.io/NForge/dev/bench/
NForge uses clang-format to enforce consistent formatting. Formatting is checked automatically on all pull requests and must pass before merging.
The easiest way to avoid formatting failures is to install the pre-commit hook, which checks formatting automatically on every commit:
After installation, any commit that fails formatting will be blocked and fixed in-place. Stage the changes and commit again to proceed.
Or run clang-format directly through your editor or IDE.