choice.hh
Go to the documentation of this file.
1#pragma once
2
3/// @file
4/// @brief syev: cta, cta_fused, jacobi, blocked, two_stage, vendor. evidence: docs/perf/syev.md @ingroup api_selection_ops
5
7
8#include <array>
9#include <string_view>
10#include <variant>
11
12namespace batchlas::ops::syev {
13
14struct Cta : select::NoFields<"cta"> {}; ///< syev_cta: sytrd + steqr_cta, n <= 32
15struct CtaFused : select::NoFields<"cta_fused"> {}; ///< syev_cta_fused: one kernel, n <= 32
16struct Jacobi : select::NoFields<"jacobi"> {}; ///< syev_jacobi_cta, n <= 32
17struct Blocked : select::NoFields<"blocked"> {}; ///< syev_blocked: sytrd_blocked + stedc, any n
18struct TwoStage : select::NoFields<"two_stage"> {}; ///< syev_two_stage: sy2sb + sb2st + stedc, any n
19struct Vendor : select::NoFields<"vendor"> {}; ///< backend::syev_vendor; needs the solver library
20
21using SyevChoice = std::variant<Cta, CtaFused, Jacobi, Blocked, TwoStage, Vendor>; ///< GPU natives: square, no NETLIB
22
23template <class T> /// Every compiled choice, once, in tie-break order (§6.3): native first, vendor last.
24constexpr auto candidates() { return select::all_of<SyevChoice>(); }
25
26inline constexpr select::OpSpec spec{Op::syev, select::Lib::solver}; ///< last resort (§5.5): blocked, vendor (CPU)
27
28/// Keys: jobz N|V exact; uplo is no key (Upper mirrors into Lower); n log weight 3; batch log.
29inline constexpr std::array<std::string_view, 3> key_names{"jobz:exact", "n:log:3", "batch:log"};
30
31/// Both sides of every transcribed threshold plus a log grid; the transcriber (tuned/README.md) spells the same grid.
32inline constexpr std::array<int, 37> grid_n{1, 2, 3, 4, 6, 8, 9, 12, 16, 20, 24, 25, 28,
33 32, 33, 40, 48, 64, 96, 128, 192, 256, 257, 320, 321, 384,
34 448, 449, 512, 513, 640, 768, 1024, 1025, 1536, 2048, 4096};
35inline constexpr std::array<int, 5> grid_batch{128, 512, 2048, 8192, 32768};
36
37} // namespace batchlas::ops::syev
constexpr auto all_of()
Every alternative of a field-less choice variant, in declaration (= tie-break) order.
Definition select.hh:110
constexpr std::array< int, 5 > grid_batch
Definition choice.hh:35
constexpr std::array< int, 37 > grid_n
Both sides of every transcribed threshold plus a log grid; the transcriber (tuned/README....
Definition choice.hh:32
std::variant< Cta, CtaFused, Jacobi, Blocked, TwoStage, Vendor > SyevChoice
GPU natives: square, no NETLIB.
Definition choice.hh:21
constexpr select::OpSpec spec
last resort (§5.5): blocked, vendor (CPU)
Definition choice.hh:26
constexpr auto candidates()
Every compiled choice, once, in tie-break order (§6.3): native first, vendor last.
Definition choice.hh:24
constexpr std::array< std::string_view, 3 > key_names
Keys: jobz N|V exact; uplo is no key (Upper mirrors into Lower); n log weight 3; batch log.
Definition choice.hh:29
Flat kernel selection: one choose() per op over measured per-device tables.
syev_blocked: sytrd_blocked + stedc, any n
Definition choice.hh:17
syev_cta_fused: one kernel, n <= 32
Definition choice.hh:15
syev_cta: sytrd + steqr_cta, n <= 32
Definition choice.hh:14
syev_jacobi_cta, n <= 32
Definition choice.hh:16
syev_two_stage: sy2sb + sb2st + stedc, any n
Definition choice.hh:18
backend::syev_vendor; needs the solver library
Definition choice.hh:19
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