| activations | SafeC Standard Library — Activation functions on Tensor. |
| attention | SafeC Standard Library — Attention (scaled dot-product + multi-head). |
| attention_advanced | SafeC Standard Library — Advanced attention: Multi-head Latent
Attention (MLA/EG-MLA), Shifted-Window (Swin) attention, and Gated
DeltaNet. |
| autoencoder | SafeC Standard Library — autoencoders: plain, denoising, sparse,
variational (VAE, beta-VAE, conditional VAE) and vector-quantized
(VQ-VAE). MLP encoders and decoders over flattened rows, trained with
Autograd::get -- or convolutional ones (ConvAutoencoder, ConvVae) built from
convnet.h's ConvNet. |
| cnn | SafeC Standard Library — CNN: 2D convolution + pooling over flat CHW
feature maps. |
| convnet | SafeC Standard Library — trainable convolutional networks on std::ml's
Autograd::get core. |
| cuda_ffi | Internal: included by the CUDA backend sources (gpu_cuda.sc,
gpu_cuda_attention.sc, gpu_cudnn.sc, device_cuda.sc, dsp/fft_cuda.sc), not
a public header. The CUDA driver API, NVRTC and cuBLAS / cuBLASLt
declarations they share, and the opaque handle types of those libraries
and cuDNN for their 'extern' declarations: each C handle (CUcontext,
CUevent, cublasHandle_t, ...) is a pointer to its own marker struct here,
so one kind of handle can't be passed where another is expected. None is
ever constructed or read; only the libraries they come from look behind
them. |
| datasets | SafeC Standard Library — datasets and mini-batch loading for std::ml. |
| device | SafeC Standard Library — devices: where a tensor's values live. |
| device_kernels | Generated by gen_device_kernels.sh from device_kernels.cu -- do not edit. |
| device_kernels_spirv | Generated by gen_device_kernels.sh from device_kernels.cu (slangc 2026.20) -- do not edit.
Every kernel as a SPIR-V module, validated by spirv-val, per build: 0 plain,
1 DK_TAGGED, 2 DK_ATTN64, 3 DK_TAGGED and DK_ATTN64. |
| device_kernels_wgsl | Generated by gen_device_kernels_wgsl.sh from device_kernels.wgsl -- do not edit. |
| device_webgpu | SafeC Standard Library — the WebGPU device backend's interface
(device_webgpu.sc): the static backend interface device.h describes, plus
the few calls gpu_webgpu.h's host-array API makes on the same device,
queue and kernels. Programs reach the backend through device.h (the
webgpu feature, DEVICE_WEBGPU); this header is for gpu_webgpu.sc. |
| diffusion | SafeC Standard Library — Diffusion: noise schedules (EDM/Karras, DDPM
linear) and samplers (DDPM ancestral, DDIM, DPM-Solver, DPM-Solver++). |
| element | SafeC Standard Library — tensor element types. |
| float16 | |
| gan | SafeC Standard Library — generative adversarial networks. |
| gpu_cuda | |
| gpu_cuda_attention | SafeC Standard Library — attention on NVIDIA GPUs (CUDA): flash attention
and linear attention as this library's own CUDA kernels. |
| gpu_cudnn | SafeC Standard Library — cuDNN convolution, pooling and U-Net on CUDA. |
| gpu_miopen | SafeC Standard Library — MIOpen convolution, pooling and U-Net on ROCm. |
| gpu_mps | |
| gpu_mps_metallib | Generated by gen_mps_metallib.sh from gpu_mps_kernels.metal — do not
edit directly. Regenerate after changing the kernel source. |
| gpu_rocm | |
| gpu_spirv | |
| gpu_webgpu | |
| llm | SafeC Standard Library — LLM orchestration (LangChain/LangGraph/
LangSmith-inspired). |
| lora | SafeC Standard Library — parameter-efficient fine-tuning: LoRA and QLoRA. |
| module | SafeC Standard Library — models as composable traits. |
| mps_ffi | Internal: included by the Metal backend sources (gpu_mps.sc,
device_mps.sc), not a public header. The opaque types of the Objective-C
runtime and libdispatch they call Metal through besides gpu_mps.h's
MtlObject (Objective-C's 'id': every MTLDevice, MTLBuffer, encoder,
NSString, ...): a selector, an autorelease pool token. None is ever constructed or read;
only the runtime looks behind them. Each objc_msgSend call site casts
objc_msgSend to the typed signature of the message it sends. |
| nn | SafeC Standard Library — trainable networks on std::ml's Autograd::get core. |
| norm | SafeC Standard Library — trainable normalization: LayerNorm and AdaLN. |
| rl | SafeC Standard Library — reinforcement learning. |
| rnn | SafeC Standard Library — Recurrent cells: RNN, GRU, LSTM, xLSTM. |
| rocm_ffi | Internal: included by the ROCm backend sources (gpu_rocm.sc,
device_rocm.sc, gpu_miopen.sc, dsp/fft_rocm.sc), not a public header. The
HIP runtime, hiprtc and rocBLAS declarations they share, and the opaque
handle types of those libraries and MIOpen / hipFFT for their 'extern'
declarations: each C handle (hipModule_t, rocblas_handle, ...) is a
pointer to its own marker struct here, so one kind of handle can't be
passed where another is expected. None is ever constructed or read; only
the libraries they come from look behind them. |
| sparse | SafeC Standard Library — sparse tensors (CSR) with autograd and devices. |
| ssm | SafeC Standard Library — state space models (Mamba's selective SSM). |
| tensor | SafeC Standard Library — Tensor: CPU tensors with reverse-mode Autograd::get. |
| tensor_auto | SafeC Standard Library — size-based automatic backend selection for
Tensor ops on the CPU (mixing SIMD/vDSP/BLAS, chosen FOR the caller
instead of BY the caller; GPU placement is device.h's job). |
| tensor_blas | SafeC Standard Library — BLAS-accelerated Tensor matmul. |
| tensor_half | SafeC Standard Library — fp16 / bf16 tensors and mixed-precision ops. |
| tensor_nn | SafeC Standard Library — neural-net building blocks on top of std::ml's
Tensor/Autograd::get core (tensor.h/tensor.sc): activation functions, the
Adam optimizer, and 1D pooling. Separate file from tensor.sc for the
same reason the GPU backends are separate — an independently useful slice of
functionality, not a change to the core type or its existing ops. |
| tensor_spirv | SafeC Standard Library — GPU-backed Tensor ops (Vulkan/SPIR-V (cross-vendor)). |
| tensor_vdsp | SafeC Standard Library — vDSP-accelerated elementwise Tensor ops (see
tensor_vdsp.sc). Same Autograd::get math/backward wiring as tensor.h's plain
tensor_add/sub/mul/sum (reuses __add_backward/__sub_backward/
__mul_backward/__sum_backward directly — only the forward computation
changes), just vectorized via Accelerate's vDSP instead of a scalar loop.
Link with '-framework Accelerate', same as tensor_blas.sc. |
| trainer | SafeC Standard Library — the training loop. |
| transformer | SafeC Standard Library — Transformer image-generation backbones: DiT
(Diffusion Transformer, Peebles & Xie 2023) and JiT ("Just-image-
Transformer" — a plain, unconditioned-per-layer transformer backbone,
as opposed to DiT's per-layer adaptive conditioning). |
| unet | SafeC Standard Library — U-Net: a small encoder/decoder CNN with skip
connections (Ronneberger et al. 2015), the convolutional backbone
classic DDPM-style diffusion models denoise with. |
| webgpu_api | SafeC Standard Library — the part of the WebGPU C API (webgpu.h, as
wgpu-native and Dawn ship it) that device_webgpu.sc and gpu_webgpu.sc
call, declared for SafeC. Layouts follow webgpu.h's current revision (the
one with WGPUStringView labels, callback-info structs and WGPUFuture
returns: wgpu-native v24 on, Dawn from 2024 on); tests/stdlib/webgpu
checks them against the real header with a C compiler (layout_check.c). |