MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
Loading...
Searching...
No Matches
nc_model.hpp File Reference
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>

Classes

struct  mtl::detail::nc_model_inputs
 Everything a model needs. More...

Namespaces

namespace  mtl
namespace  mtl::detail
 mat*vec multiply into pre-allocated y: y = A * x.

Enumerations

enum class  mtl::detail::nc_model {
  mtl::detail::m0_default , mtl::detail::m1_balanced , mtl::detail::m2_detected , mtl::detail::m3_per_team ,
  mtl::detail::m4_per_sharer , mtl::detail::m5_exact , mtl::detail::m6_guarded , mtl::detail::m7_sharer_gated
}
 Candidate models for sizing nc. See the file header for why each exists. More...

Functions

std::size_t mtl::detail::balanced_nc (std::size_t n, std::size_t nc_max, unsigned jc_nt, std::size_t nr=1)
 Choose the jc-block size that balances the threaded n-partition – the jc-side counterpart of balanced_mc (#479, feeding #429).
constexpr std::size_t mtl::detail::nc_from_budget (std::size_t budget_bytes, std::size_t kc, std::size_t sdata, std::size_t nr) noexcept
 The capacity-only part: nc such that the packed B panel kc x nc fills the budget, rounded down to a whole number of nr-column panels.
std::size_t mtl::detail::nc_for_model (nc_model model, const nc_model_inputs &in) noexcept
 nc under one model.
constexpr bool mtl::detail::nc_guard_declines (std::size_t packed_b_new, std::size_t packed_b_old, std::size_t l3_bytes) noexcept
 M6's rule, as a named predicate: decline the balanced nc when it would BOTH grow the resident packed-B set AND push it past L3 (#429, measured in #479).
constexpr const char * mtl::detail::nc_model_name (nc_model m) noexcept
 Short stable token for CSV columns and command lines.
nc_model mtl::detail::nc_model_from_name (const char *s, bool &ok) noexcept
 Parse a model name; ok reports whether it was recognised.
nc_model mtl::detail::nc_model_selection ()
 The model this process runs, from MTL5_NC_MODEL; M7 when unset (#492).

Variables

constexpr nc_model mtl::detail::all_nc_models []
constexpr std::size_t mtl::detail::nc_model_count
 How many models there are.