choice.hh
Go to the documentation of this file.
1#pragma once
2
3/// @file
4/// @brief posv: tiny, cta, blocked.
5/// `evidence: docs/perf/potrf.md#posv-selection-since-flat-kernel-selection-phase-3` @ingroup api_selection_ops
6
8
9#include <array>
10#include <string_view>
11#include <variant>
12
14
15struct Tiny : select::NoFields<"tiny"> {}; ///< posv_tiny_dispatch: fused factor + solve, small n and nrhs
16struct Cta : select::NoFields<"cta"> {}; ///< public potrf + potrs_fused_dispatch; B fits in SLM
17struct Blocked : select::NoFields<"blocked"> {}; ///< public potrf + two public trsm; any homogeneous batch
18
19using PosvChoice = std::variant<Tiny, Cta, Blocked>; ///< fieldless: buckets, nb and wg are derived in the driver
20
21template <class T> /// Tie-break order (§6.3). No vendor family: a `vendor` pin warns and runs Auto.
22constexpr auto candidates() { return select::all_of<PosvChoice>(); }
23
24inline constexpr select::OpSpec spec{Op::posv, select::Lib::none}; ///< no library; blocked's children report errors
25
26inline constexpr std::array<std::string_view, 4> key_names{ ///< work: n^3/3 + 2 n^2 nrhs
27 "uplo:exact", "n:log:3", "nrhs:log", "batch:log"};
28
29/// potrf's grid_n within [1, 1024]; the transcriber (tuned/README.md) spells the same grid.
30inline constexpr std::array<int, 33> grid_n{1, 2, 3, 4, 6, 8, 12, 16, 20, 24, 28, 32, 36, 40, 48, 56,
31 64, 80, 96, 112, 128, 160, 192, 224, 256, 288, 320, 384, 448, 512, 640, 768, 1024};
32inline constexpr std::array<int, 6> grid_nrhs{1, 2, 4, 8, 16, 64};
33inline constexpr std::array<int, 5> grid_batch{128, 512, 2048, 8192, 32768};
34
35} // namespace batchlas::ops::posv
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, 4 > key_names
work: n^3/3 + 2 n^2 nrhs
Definition choice.hh:26
constexpr std::array< int, 33 > grid_n
potrf's grid_n within [1, 1024]; the transcriber (tuned/README.md) spells the same grid.
Definition choice.hh:30
constexpr std::array< int, 6 > grid_nrhs
Definition choice.hh:32
constexpr std::array< int, 5 > grid_batch
Definition choice.hh:33
std::variant< Tiny, Cta, Blocked > PosvChoice
fieldless: buckets, nb and wg are derived in the driver
Definition choice.hh:19
constexpr auto candidates()
Tie-break order (§6.3). No vendor family: a vendor pin warns and runs Auto.
Definition choice.hh:22
constexpr select::OpSpec spec
no library; blocked's children report errors
Definition choice.hh:24
Flat kernel selection: one choose() per op over measured per-device tables.
public potrf + two public trsm; any homogeneous batch
Definition choice.hh:17
public potrf + potrs_fused_dispatch; B fits in SLM
Definition choice.hh:16
posv_tiny_dispatch: fused factor + solve, small n and nrhs
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