choice.hh
Go to the documentation of this file.
1#pragma once
2
3/// @file
4/// @brief orgqr: blocked, vendor. `evidence: docs/perf/qr.md#the-shipped-orgqr-ceiling` @ingroup api_selection_ops
5
7
8#include <array>
9#include <string_view>
10#include <variant>
11
13
14struct Blocked : select::NoFields<"blocked"> {}; ///< orgqr_blocked_dispatch: identity + the public ormqr; GPU, n <= m
15struct Vendor : select::NoFields<"vendor"> {}; ///< backend::orgqr_vendor; any shape (n > m, CPU, heterogeneous)
16
17using OrgqrChoice = std::variant<Blocked, Vendor>; ///< fieldless: orgqr_nb is derived from type and min(m, n)
18
19template <class T> /// Every compiled choice, in tie-break order (§6.3).
20constexpr auto candidates() { return select::all_of<OrgqrChoice>(); }
21
22inline constexpr std::array<std::string_view, 2> last_resort{"vendor", "blocked"}; ///< §5.5: vendor is the general one
23inline constexpr select::OpSpec spec{Op::orgqr, select::Lib::factorization, {last_resort}}; ///< op, library, rules
24
25inline constexpr std::array<std::string_view, 2> key_names{"m:log", "n:log:2"}; ///< work ~ m n^2; no batch key
26
27/// Both sides of the transcribed 512 ceiling, a coarse log grid elsewhere, n <= m (transcriber: tuned/README.md).
28inline constexpr std::array<int, 17> grid{1, 2, 4, 8, 16, 32, 64, 128, 256, 384, 512, 513, 768, 1024, 2048, 4096,
29 8192};
30
31} // namespace batchlas::ops::orgqr
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
§5.5: vendor is the general one
Definition choice.hh:22
constexpr std::array< std::string_view, 2 > key_names
work ~ m n^2; no batch key
Definition choice.hh:25
std::variant< Blocked, Vendor > OrgqrChoice
fieldless: orgqr_nb is derived from type and min(m, n)
Definition choice.hh:17
constexpr select::OpSpec spec
op, library, rules
Definition choice.hh:23
constexpr std::array< int, 17 > grid
Both sides of the transcribed 512 ceiling, a coarse log grid elsewhere, n <= m (transcriber: tuned/RE...
Definition choice.hh:28
constexpr auto candidates()
Every compiled choice, in tie-break order (§6.3).
Definition choice.hh:20
Flat kernel selection: one choose() per op over measured per-device tables.
orgqr_blocked_dispatch: identity + the public ormqr; GPU, n <= m
Definition choice.hh:14
backend::orgqr_vendor; any shape (n > m, CPU, heterogeneous)
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