Clustering
C++20 header-only: DBSCAN, HDBSCAN, k-means.
Loading...
Searching...
No Matches
clustering::math::defaults Namespace Reference

Typedefs

using Backend = ::clustering::math::detail::ReferenceGemm
 Alias resolving to the default GEMM backend tag.

Variables

constexpr std::size_t pairwiseGemmThreshold = 100000
 Workload threshold at which pairwiseSqEuclidean switches from the per-pair SIMD kernel to the GEMM-identity kernel.
constexpr std::size_t pairwiseArgminMaxD = 64
 Maximum feature dimension for which the fused pairwiseArgminSqEuclidean driver is used.

Typedef Documentation

◆ Backend

using clustering::math::defaults::Backend = ::clustering::math::detail::ReferenceGemm

Alias resolving to the default GEMM backend tag.

Defaults to detail::ReferenceGemm. Override project-wide at build time with -DCLUSTERING_MATH_DEFAULT_BACKEND=<tag-type>; override per call site by passing the Backend template argument to gemm.

Definition at line 26 of file defaults.h.

Variable Documentation

◆ pairwiseArgminMaxD

std::size_t clustering::math::defaults::pairwiseArgminMaxD = 64
inlineconstexpr

Maximum feature dimension for which the fused pairwiseArgminSqEuclidean driver is used.

Above this d, callers fall back to the materialized two-step.

The fused kernel keeps its full K range in register; above this d the accumulator path spills and the chunked materialized fallback wins on cache residency. Measured locally on Zen 5 with the gemmKernel8x6Avx2F32FusedArgmin layout: the fused path beats chunked materialized through d == 64, and breaks even or loses past that.

Definition at line 76 of file defaults.h.

◆ pairwiseGemmThreshold

std::size_t clustering::math::defaults::pairwiseGemmThreshold = 100000
inlineconstexpr

Workload threshold at which pairwiseSqEuclidean switches from the per-pair SIMD kernel to the GEMM-identity kernel.

Compared against n*m*d. 100000 follows FAISS's distance_compute_blas_threshold; the exact crossover is hardware-dependent (GEMM packing/kernel cost vs. SIMD per-pair overhead) and should be re-measured per target. Override project-wide at build time with -DCLUSTERING_PAIRWISE_GEMM_THRESHOLD=

; must be set uniformly across the build so every translation unit instantiates the pairwise template with the same dispatch body.

Definition at line 52 of file defaults.h.