choice.hh
Go to the documentation of this file.
1#pragma once
2
3/// @file
4/// @brief gesvd: jacobi, cta, blocked, vendor. evidence: docs/perf/gesvd.md @ingroup api_selection_ops
5
7
8#include <array>
9#include <string_view>
10#include <variant>
11
13
14struct Jacobi : select::NoFields<"jacobi"> {}; ///< gesvdj_cta: one-sided Jacobi, max(m, n) <= 64, not Hermitian
15struct Cta : select::NoFields<"cta"> {}; ///< gesvd_cta: normal equations + syev_cta, max(m, n) <= 32, not thin
16struct Blocked : select::NoFields<"blocked"> {}; ///< gesvd_blocked: bidiagonalisation + bdsdc, or syev_blocked (Lower)
17struct Vendor : select::NoFields<"vendor"> {}; ///< backend::gesvd_vendor; needs the solver library
18
19using GesvdChoice = std::variant<Jacobi, Cta, Blocked, Vendor>; ///< natives need a GPU; cta, blocked: complex only if Hermitian
20
21template <class T> /// Every compiled choice, in tie-break order (§6.3): native first, vendor last.
22constexpr auto candidates() { return select::all_of<GesvdChoice>(); }
23
24inline constexpr select::OpSpec spec{Op::gesvd, select::Lib::solver}; ///< last resort (§5.5): blocked, vendor
25
26/// Keys: herm N|L|U and vec none|all|thin (from the CANONICAL jobs) exact; m, n log weight 1.5.
27inline constexpr std::array<std::string_view, 4> key_names{"herm:exact", "vec:exact", "m:log:1.5", "n:log:1.5"};
28
29/// Both sides of every driver ceiling (32 cta, 64 jacobi) plus a coarse log grid, as tuned/README.md's transcriber.
30inline constexpr std::array<int, 15> grid_mn{1, 2, 4, 8, 16, 24, 32, 33, 48, 64, 65, 128, 256, 512, 1024};
31inline constexpr std::array<std::string_view, 3> grid_herm{"N", "L", "U"};
32inline constexpr std::array<std::string_view, 3> grid_vec{"none", "all", "thin"};
33
34} // namespace batchlas::ops::gesvd
constexpr auto all_of()
Every alternative of a field-less choice variant, in declaration (= tie-break) order.
Definition select.hh:110
constexpr auto candidates()
Every compiled choice, in tie-break order (§6.3): native first, vendor last.
Definition choice.hh:22
constexpr std::array< std::string_view, 4 > key_names
Keys: herm N|L|U and vec none|all|thin (from the CANONICAL jobs) exact; m, n log weight 1....
Definition choice.hh:27
constexpr select::OpSpec spec
last resort (§5.5): blocked, vendor
Definition choice.hh:24
constexpr std::array< std::string_view, 3 > grid_vec
Definition choice.hh:32
std::variant< Jacobi, Cta, Blocked, Vendor > GesvdChoice
natives need a GPU; cta, blocked: complex only if Hermitian
Definition choice.hh:19
constexpr std::array< int, 15 > grid_mn
Both sides of every driver ceiling (32 cta, 64 jacobi) plus a coarse log grid, as tuned/README....
Definition choice.hh:30
constexpr std::array< std::string_view, 3 > grid_herm
Definition choice.hh:31
Flat kernel selection: one choose() per op over measured per-device tables.
gesvd_blocked: bidiagonalisation + bdsdc, or syev_blocked (Lower)
Definition choice.hh:16
gesvd_cta: normal equations + syev_cta, max(m, n) <= 32, not thin
Definition choice.hh:15
gesvdj_cta: one-sided Jacobi, max(m, n) <= 64, not Hermitian
Definition choice.hh:14
backend::gesvd_vendor; needs the solver library
Definition choice.hh:17
Base of a family with no knobs: struct Cta : NoFields<"cta"> {};.
Definition select.hh:101
What an op's choice.hh declares once: its name, the library its Vendor family calls (one gate for can...
Definition select.hh:529