A small CUDA-enabled C++ library with tensor operations, autograd-style gradient tape, and a lightweight layers API.
- Windows 10/11
- Visual Studio 2022 or newer with Desktop development for C++
- NVIDIA CUDA Toolkit 11.x or newer (tested with 13.2)
- CMake 3.18 or newer
- Ninja (recommended) or another supported CMake generator
-
Open a Visual Studio Developer PowerShell or x64 Native Tools command prompt.
-
Change into the repository root:
cd "libshit"- Create the build directory if needed and configure the project:
cmake -S . -B build -G NinjaThis will locate the CUDA toolkit via find_package(CUDAToolkit REQUIRED) and generate the build files.
- Build the library and tests:
cmake --build build --config Debug --target allAlternatively, build a specific test target:
cmake --build build --config Debug --target grad_tests -- -j1Run all CTest tests from the build directory:
cd build
ctest -C Debug --output-on-failureOr run a single test executable directly:
.\layers_model_tests.exenow personally i ignore all of that and just use my IDE tooling.
include/: public headerssrc/: library and CUDA kernel sourcestests/: test executablesbuild/: out-of-tree CMake build directory
- The library target
libshitis built as a shared DLL. - CUDA headers are exposed to consumers so headers like
shit_errors.hppcan compile in test targets. - The project includes several tests:
basic_testsgrad_testsgrad_loss_scaling_testslayers_model_testsmse_tests