choice.hh
Go to the documentation of this file.
1#pragma once
2
3/// @file
4/// @brief getrf: tiny, 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 Tiny : select::NoFields<"tiny"> {}; ///< getrf_tiny_dispatch: register-resident, n <= 32 (cdouble 16)
15struct Cta : select::NoFields<"cta"> {}; ///< getrf_cta_dispatch: SLM-resident panel, n <= the SLM ceiling
16struct Blocked : select::NoFields<"blocked"> {}; ///< getrf_blocked_dispatch + the public gemm and trsm
17struct Vendor : select::NoFields<"vendor"> {}; ///< backend::getrf_vendor (cuBLAS / rocSOLVER / LAPACKE)
18
19using GetrfChoice = std::variant<Tiny, Cta, Blocked, Vendor>; ///< natives: GPU, sub-group 32, square, not NETLIB
20
21template <class T> /// Every compiled choice, once, in tie-break order (§6.3).
22constexpr auto candidates() { return select::all_of<GetrfChoice>(); }
23
24inline constexpr select::OpSpec spec{Op::getrf, select::Lib::factorization}; ///< §5.5: blocked, then vendor (CPU)
25
26inline constexpr std::array<std::string_view, 2> key_names{"n:log:3", "batch:log"}; ///< work ~ n^3 batch
27
28/// Both sides of every transcribed threshold (4|5, 7|8|9, 16|17, 24|25, 32|33, 255|256, 511|512; batch
29/// 255|256), a coarse log grid elsewhere. The transcriber (tuned/README.md) spells the same grid.
30inline constexpr std::array<int, 28> grid_n{1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 16, 17, 24, 25,
31 32, 33, 48, 64, 96, 128, 192, 255, 256, 384, 511, 512, 768, 1024};
32inline constexpr std::array<int, 10> grid_batch{1, 8, 64, 128, 255, 256, 512, 2048, 8192, 32768};
33
34} // namespace batchlas::ops::getrf
constexpr auto all_of()
Every alternative of a field-less choice variant, in declaration (= tie-break) order.
Definition select.hh:110
constexpr auto candidates()
Every compiled choice, once, in tie-break order (§6.3).
Definition choice.hh:22
constexpr std::array< int, 10 > grid_batch
Definition choice.hh:32
constexpr std::array< std::string_view, 2 > key_names
work ~ n^3 batch
Definition choice.hh:26
constexpr select::OpSpec spec
§5.5: blocked, then vendor (CPU)
Definition choice.hh:24
std::variant< Tiny, Cta, Blocked, Vendor > GetrfChoice
natives: GPU, sub-group 32, square, not NETLIB
Definition choice.hh:19
constexpr std::array< int, 28 > grid_n
Both sides of every transcribed threshold (4|5, 7|8|9, 16|17, 24|25, 32|33, 255|256,...
Definition choice.hh:30
Flat kernel selection: one choose() per op over measured per-device tables.
getrf_blocked_dispatch + the public gemm and trsm
Definition choice.hh:16
getrf_cta_dispatch: SLM-resident panel, n <= the SLM ceiling
Definition choice.hh:15
getrf_tiny_dispatch: register-resident, n <= 32 (cdouble 16)
Definition choice.hh:14
backend::getrf_vendor (cuBLAS / rocSOLVER / LAPACKE)
Definition choice.hh:17
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