21inline int cublas_int(blas_int
value)
24 return static_cast<int>(
value);
27template <uni20::cublas::CublasScalar Scalar,
class LhsHandle,
class RhsHandle>
31 return blas::blas_trans_char_is_supported<Scalar>(lhs.
transform) &&
32 blas::blas_trans_char_is_supported<Scalar>(rhs.
transform);
35template <uni20::cublas::CublasScalar Scalar,
class OutputHandle,
class LhsHandle,
class RhsHandle>
55template <uni20::cublas::CublasScalar Scalar,
class OutputHandle,
class LhsHandle,
class RhsHandle>
56 requires std::convertible_to<OutputHandle, Scalar*> && std::convertible_to<LhsHandle, Scalar const*> &&
57 std::convertible_to<RhsHandle, Scalar const*>
62 CHECK(detail::provider_transforms_are_supported(lhs, rhs));
64 blas_int
const lhs_cols = detail::require_gemm_shape(output, lhs, rhs);
65 if (output.
rows == 0 || output.
cols == 0)
return;
68 blas::blas_trans_char<Scalar>(rhs.
transform), detail::cublas_int(output.
rows),
69 detail::cublas_int(output.
cols), detail::cublas_int(lhs_cols), alpha,
Checked column-major GEMM wrappers over a leased cuBLAS execution context.
Provider-ready BLAS matrix operands and transform helpers.
Move-only dynamic pairing of one cuBLAS handle slot and one idle stream.
Definition cublas/execution.hpp:56
Concept for numeric scalar types (integer, real, or complex).
Definition scalar_concepts.hpp:81
locale_t value
Definition data_table.cpp:49
void gemm(ExecutionLease &execution, char lhs_transform, char rhs_transform, int rows, int cols, int inner, Scalar alpha, Scalar const *lhs, int lhs_leading_dimension, Scalar const *rhs, int rhs_leading_dimension, Scalar beta, Scalar *output, int output_leading_dimension)
Enqueue column-major GEMM through an exclusive handle/stream lease.
Definition backend/cublas/gemm.hpp:98
constexpr blas_int transformed_cols(blas_int rows, blas_int cols, MatrixTransform transform)
Columns produced by applying transform to an untransformed matrix.
Definition blas_matrix.hpp:145
constexpr blas_int transformed_rows(blas_int rows, blas_int cols, MatrixTransform transform)
Rows produced by applying transform to an untransformed matrix.
Definition blas_matrix.hpp:139
Definition linalg/cublas/gemm.hpp:17
void gemm(uni20::cublas::ExecutionLease &execution, blas::BlasWritableMatrix< Scalar, OutputHandle > output, Scalar alpha, blas::BlasReadableMatrix< Scalar, LhsHandle > lhs, blas::BlasReadableMatrix< Scalar, RhsHandle > rhs, Scalar beta)
Run provider-ready column-major GEMM through cuBLAS.
Definition linalg/cublas/gemm.hpp:58
mpreal beta(mpreal const &a, mpreal const &x)
Real Beta function; positive rational/integer pairs retain exact values.
Definition mpreal_special.hpp:164
Readable matrix shape plus transform as seen by a BLAS provider.
Definition blas_matrix.hpp:130
blas_int cols
Definition blas_matrix.hpp:133
MatrixTransform transform
Definition blas_matrix.hpp:135
blas_int leading_dimension
Definition blas_matrix.hpp:134
blas_int rows
Definition blas_matrix.hpp:132
Handle data
Definition blas_matrix.hpp:131
Writable matrix shape as seen by a BLAS/LAPACK provider.
Definition blas_matrix.hpp:119
blas_int rows
Definition blas_matrix.hpp:121
blas_int leading_dimension
Definition blas_matrix.hpp:123
Handle data
Definition blas_matrix.hpp:120
blas_int cols
Definition blas_matrix.hpp:122
#define CHECK(cond,...)
Definition trace.hpp:299
#define CHECK_EQUAL(a, b,...)
Definition trace.hpp:309