choice.hh
Go to the documentation of this file.
1#pragma once
2
3/// @file
4/// @brief getri: blocked, vendor. evidence: docs/perf/lu.md @ingroup api_selection_ops
5
7
8#include <array>
9#include <string_view>
10#include <variant>
11
13
14struct Blocked : select::NoFields<"blocked"> {}; ///< getri_blocked_dispatch: P into C + two public trsm; GPU, square
15struct Vendor : select::NoFields<"vendor"> {}; ///< backend::getri_vendor; also CPU, NETLIB, heterogeneous batches
16
17using GetriChoice = std::variant<Blocked, Vendor>; ///< both fieldless: the driver derives wg
18
19template <class T> /// Every compiled choice, in tie-break order (§6.3): native first.
20constexpr auto candidates() { return select::all_of<GetriChoice>(); }
21
22inline constexpr std::array<std::string_view, 2> last_resort{"vendor", "blocked"}; ///< generality order (§5.5)
23inline constexpr select::OpSpec spec{Op::getri, select::Lib::factorization, {last_resort}}; ///< op, library, rules
24
25inline constexpr std::array<std::string_view, 2> key_names{"n:log:3", "batch:log"}; ///< work ~ n^3 batch
26
27/// Log grid + both sides of the transcribed edges (float 128, cfloat 256); the transcriber (tuned/README.md) spells it.
28inline constexpr std::array<int, 24> grid_n{1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 64,
29 96, 127, 128, 192, 255, 256, 384, 512, 768, 1024, 2048, 4096};
30inline constexpr std::array<int, 5> grid_batch{128, 512, 2048, 8192, 32768};
31
32} // namespace batchlas::ops::getri
constexpr auto all_of()
Every alternative of a field-less choice variant, in declaration (= tie-break) order.
Definition select.hh:110
constexpr std::array< std::string_view, 2 > last_resort
generality order (§5.5)
Definition choice.hh:22
constexpr std::array< std::string_view, 2 > key_names
work ~ n^3 batch
Definition choice.hh:25
std::variant< Blocked, Vendor > GetriChoice
both fieldless: the driver derives wg
Definition choice.hh:17
constexpr auto candidates()
Every compiled choice, in tie-break order (§6.3): native first.
Definition choice.hh:20
constexpr select::OpSpec spec
op, library, rules
Definition choice.hh:23
constexpr std::array< int, 24 > grid_n
Log grid + both sides of the transcribed edges (float 128, cfloat 256); the transcriber (tuned/README...
Definition choice.hh:28
constexpr std::array< int, 5 > grid_batch
Definition choice.hh:30
Flat kernel selection: one choose() per op over measured per-device tables.
getri_blocked_dispatch: P into C + two public trsm; GPU, square
Definition choice.hh:14
backend::getri_vendor; also CPU, NETLIB, heterogeneous batches
Definition choice.hh:15
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