How nuistmrchest/libmatchstick works
LibMatchstick is a lightweight C++/CUDA neural-network library with native C++ and opaque-handle C APIs. Its main workflow configures an MLP or CNN, supplies matrix/tensor input and targets, trains or runs inference, and can save or load parameters. The README documents the MLP/CNN composition and API capabilities; sampled headers establish the data types and network interfaces, but do not show the CUDA implementation call paths.
Main entry points: matchstick/network.h CNN · matchstick_c/network.h Opaque C API · matrix_capi.cu C matrix handles · tensor_3d_capi.cu C 3D tensor handles
Components 15
Neural networks
Compute components
- Network layers
include/matchstick/layer.h - Activations
include/matchstick/activation.h - Loss functions
include/matchstick/loss.h
Data containers
- Matrix operations
src/cpp/matrix.cu - 3D tensor operations
src/cpp/tensor_3d.cu - 4D tensor operations
src/cpp/tensor_4d.cu
C API
- Opaque C API
include/matchstick_c/network.h - C matrix handles
src/c_api/matrix_capi.cu - C 3D tensor handles
src/c_api/tensor_3d_capi.cu - C 4D tensor handles
src/c_api/tensor_4d_capi.cu - C network handles
src/c_api/network_capi.cu
Other components
- Application developer
Connections 19
- Application developer → C++ API: configures and calls
README.md - C++ API → MLP: configures and trains
README.md - C++ API → CNN: configures and trains
README.md - MLP → Activations: sets activations
README.md - MLP → Loss functions: sets loss
README.md - CNN → Network layers: configures convolution and pooling
README.md - CNN → MLP: uses MLP head
README.md - CNN → 3D tensor operations: accepts input
include/matchstick/network.h - CNN → 4D tensor operations: saves kernels
include/matchstick/network.h - MLP → Matrix operations: accepts input and parameters
include/matchstick/network.h - Application developer → Opaque C API: calls opaque handles
README.md - Opaque C API → C network handles: wraps network operations
README.md - Opaque C API → C matrix handles: exposes matrix handles
README.md - Opaque C API → C 3D tensor handles: exposes tensor handles
README.md - Opaque C API → C 4D tensor handles: exposes tensor handles
README.md - C network handles → C++ API: wraps C++ networks
- C matrix handles → Matrix operations: wraps matrix type
- C 3D tensor handles → 3D tensor operations: wraps tensor type
- C 4D tensor handles → 4D tensor operations: wraps tensor type