numerics 0.1.0
Loading...
Searching...
No Matches
kernel.hpp
Go to the documentation of this file.
1/// @file kernel/kernel.hpp
2/// @brief Master include for the numerics kernel module.
3///
4/// The kernel module is the performance substrate that the rest of numerics
5/// sits on top of. It is organized in tiers and sub-namespaces:
6///
7/// Tier 1 -- raw.hpp (namespace num::kernel::raw)
8/// Raw-pointer, always-inline inner loops with __restrict__ and ivdep.
9/// BLAS dispatch built in where cblas equivalents exist. No OMP.
10/// Use when writing a fused custom kernel that composes multiple
11/// operations into a single memory pass.
12///
13/// Tier 2 -- policy.hpp + array.hpp + reduce.hpp + dense.hpp
14///
15/// policy.hpp (num::kernel)
16/// seq_t, par_t, default_policy, kseq, kpar, kdefault
17///
18/// array.hpp (num::kernel::array)
19/// axpby, axpbyz -- fused elementwise, dispatched
20/// map, zip_map, reduce -- template, always-inline
21///
22/// reduce.hpp (num::kernel::reduce)
23/// l1_norm, linf_norm, sum -- scalar reductions, dispatched
24///
25/// dense.hpp (num::kernel::dense)
26/// ger -- rank-1 update, dispatched
27/// trsv_lower, trsv_upper -- triangular solves (serial; BLAS via raw::)
28///
29/// Dispatch uses compile-time policy tags (seq_t / par_t) rather than a
30/// runtime enum. The default (kdefault / default_policy) is par_t when
31/// NUMERICS_HAS_OMP is defined, seq_t otherwise. Zero runtime overhead.
32///
33/// Quick reference:
34/// num::kernel::raw::axpy(y, x, alpha, n) -- raw pointer
35/// num::kernel::array::axpby(a, x, b, y) -- type-safe, default policy
36/// num::kernel::array::axpby(a, x, b, y, kseq) -- force sequential
37/// num::kernel::reduce::l1_norm(x, kpar) -- force parallel
38/// num::kernel::dense::trsv_lower(L, b, x) -- triangular solve
39#pragma once
40
41#include "kernel/raw.hpp"
42#include "kernel/policy.hpp"
43#include "kernel/array.hpp"
44#include "kernel/reduce.hpp"
45#include "kernel/dense.hpp"
46#include "kernel/subspace.hpp"
Elementwise vector kernels (namespace num::kernel::array)
Dense matrix inner kernels (namespace num::kernel::dense)
Compile-time dispatch policy tags for the kernel module.
Tier-1 kernel: raw-pointer, inline, zero-overhead inner loops.
Scalar reduction kernels (namespace num::kernel::reduce)
Subspace construction and orthogonalization kernels. (namespace num::kernel::subspace)