choice.hh
Go to the documentation of this file.
1#pragma once
2
3/// @file
4/// @brief gesv: tiny, blocked. `evidence: docs/perf/lu.md#the-fused-gesv-tier` @ingroup api_selection_ops
5
7
8#include <array>
9#include <string_view>
10#include <variant>
11
13
14struct Tiny : select::NoFields<"tiny"> {}; ///< gesv_tiny_dispatch: fused LU factor + solve (buckets derived)
15struct Blocked : select::NoFields<"blocked"> {}; ///< public getrf + public getrs; any homogeneous batch
16
17using GesvChoice = std::variant<Tiny, Blocked>; ///< no vendor family: a `vendor` pin warns and runs Auto
18
19template <class T> /// Every compiled choice, once, in tie-break order (§6.3).
20constexpr auto candidates() { return select::all_of<GesvChoice>(); }
21
22inline constexpr select::OpSpec spec{Op::gesv}; ///< no vendor library; last resort (§5.5): blocked
23
24inline constexpr std::array<std::string_view, 2> key_names{"n:log:3", "nrhs:log"}; ///< work: 2n^3/3 + 2 n^2 nrhs
25
26/// Both sides of every transcribed threshold (16|17, 32|33, nrhs 4|5), log-spaced elsewhere (the transcriber's grid).
27inline constexpr std::array<int, 29> grid_n{1, 2, 3, 4, 6, 8, 12, 16, 17, 20, 24, 28, 32, 33, 40, 48, 64,
28 96, 128, 192, 256, 384, 512, 768, 1024, 1536, 2048, 3072, 4096};
29inline constexpr std::array<int, 8> grid_nrhs{1, 2, 4, 5, 8, 16, 64, 256};
30
31} // namespace batchlas::ops::gesv
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, 29 > grid_n
Both sides of every transcribed threshold (16|17, 32|33, nrhs 4|5), log-spaced elsewhere (the transcr...
Definition choice.hh:27
std::variant< Tiny, Blocked > GesvChoice
no vendor family: a vendor pin warns and runs Auto
Definition choice.hh:17
constexpr std::array< int, 8 > grid_nrhs
Definition choice.hh:29
constexpr std::array< std::string_view, 2 > key_names
work: 2n^3/3 + 2 n^2 nrhs
Definition choice.hh:24
constexpr select::OpSpec spec
no vendor library; last resort (§5.5): blocked
Definition choice.hh:22
constexpr auto candidates()
Every compiled choice, once, in tie-break order (§6.3).
Definition choice.hh:20
Flat kernel selection: one choose() per op over measured per-device tables.
public getrf + public getrs; any homogeneous batch
Definition choice.hh:15
gesv_tiny_dispatch: fused LU factor + solve (buckets derived)
Definition choice.hh:14
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