struct Impl {
// structs
struct Table;
struct Workspace;
// fields
Options options;
std::unique_ptr<Int8Gemm> int8;
int(* thread_source)() = nullptr;
Profile profile;
bool verify = false;
std::mutex tables_mutex;
std::vector<std::shared_ptr<const Table>> tables;
std::mutex host_mutex;
std::vector<std::pair<int, std::unique_ptr<Context>>> host_engines;
// construction
~Impl();
// methods
static void verifyInt8(std::int64_t m, std::int64_t n, std::int64_t k, const std::int8_t* r, std::int64_t ldr, const std::int8_t* s, std::int64_t lds, bool unsigned_columns, const std::int32_t* c);
static std::vector<double>& scratch();
static Workspace& workspace();
static bool finishColumn(const double* p, std::int64_t m, double alpha, double beta, double* output);
int threads() const;
std::shared_ptr<const Table> table(std::int64_t k) const;
Table build(std::int64_t k, std::int64_t chunk) const;
Operand prepare(bool rows, const double* x, std::int64_t ld, bool transpose, std::int64_t extent, std::int64_t depth, const Plan& plan, const int* exponents, bool host_residues = false, bool borrow = false) const;
void materialize(const Operand::Data& d) const;
void blockResidues(const Table& table, const Operand::Data& r, std::int64_t row0, const Operand::Data& s, std::int64_t col0, std::int64_t m, std::int64_t n, Workspace& w) const;
void blockReconstruct(const Table& table, const double* residue, const int* row_exp, const int* col_exp, std::int64_t m, std::int64_t n, double alpha, double beta, double* c, std::int64_t ldc, Workspace& w) const;
const Context& hostEngine(int bits) const;
void runHost(std::span<const Task> tasks, const Table& tab) const;
void runDevice(std::span<const Task> tasks, const Table& tab) const;
void runBlocks(std::span<const Task> tasks) const;
};