choice.hh
Go to the documentation of this file.
1#pragma once
2
3/// @file
4/// @brief getrs: cta, 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 Cta : select::NoFields<"cta"> {}; ///< getrs_fused_dispatch: permute + both solves; B fits in SLM
15struct Blocked : select::NoFields<"blocked"> {}; ///< getrs_blocked_dispatch: laswp + two public trsm
16struct Vendor : select::NoFields<"vendor"> {}; ///< backend::getrs_vendor; also takes non-conforming pairs
17
18using GetrsChoice = std::variant<Cta, Blocked, Vendor>; ///< natives: GPU, sub-group 32, conforming, not NETLIB
19
20template <class T> /// Every compiled choice, once, in tie-break order (§6.3).
21constexpr auto candidates() { return select::all_of<GetrsChoice>(); }
22
23inline constexpr select::OpSpec spec{Op::getrs, select::Lib::factorization}; ///< last resort (§5.5): blocked, vendor
24
25inline constexpr std::array<std::string_view, 3> key_names{"n:log:2", "nrhs:log", "batch:log"}; ///< ~ n^2 nrhs batch
26
27/// A log grid plus both sides of every transcribed threshold (n 31/32; nrhs 2/3, 4/5, 63/64, 127/128;
28/// batch 127/128); the transcriber (tuned/README.md) spells the same grid.
29inline constexpr std::array<int, 18> grid_n{1, 2, 4, 8, 16, 24, 31, 32, 48, 64, 96, 128, 192, 256, 384, 512,
30 768, 1024};
31inline constexpr std::array<int, 15> grid_nrhs{1, 2, 3, 4, 5, 8, 16, 32, 63, 64, 127, 128, 256, 512, 1024};
32inline constexpr std::array<int, 8> grid_batch{1, 16, 127, 128, 512, 2048, 8192, 32768};
33
34} // namespace batchlas::ops::getrs
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, 18 > grid_n
A log grid plus both sides of every transcribed threshold (n 31/32; nrhs 2/3, 4/5,...
Definition choice.hh:29
std::variant< Cta, Blocked, Vendor > GetrsChoice
natives: GPU, sub-group 32, conforming, not NETLIB
Definition choice.hh:18
constexpr std::array< int, 8 > grid_batch
Definition choice.hh:32
constexpr std::array< int, 15 > grid_nrhs
Definition choice.hh:31
constexpr auto candidates()
Every compiled choice, once, in tie-break order (§6.3).
Definition choice.hh:21
constexpr select::OpSpec spec
last resort (§5.5): blocked, vendor
Definition choice.hh:23
constexpr std::array< std::string_view, 3 > key_names
~ n^2 nrhs batch
Definition choice.hh:25
Flat kernel selection: one choose() per op over measured per-device tables.
getrs_blocked_dispatch: laswp + two public trsm
Definition choice.hh:15
getrs_fused_dispatch: permute + both solves; B fits in SLM
Definition choice.hh:14
backend::getrs_vendor; also takes non-conforming pairs
Definition choice.hh:16
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