You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEAT] Support transpose flags transa, transb != 'N' in GEMM #13
qblas_gemm and the higher-level wrappers currently reject any value other than 'N' for the transpose flags, which makes it impossible for
callers to handle mixed-layout operands (e.g. row-major × col-major) without doing a full copy into a contiguous buffer first.
Reference (in the numpy-quaddtype tree at src/csrc/quadblas_interface.cpp, but the upstream QBLAS-side QuadBLAS::gemm shares the same limitation):
// For now, we only support no transpose// TODO: Implement transpose support if neededif ((transa != 'N' && transa != 'n') || (transb != 'N' && transb != 'n')) {
return -1; // Transpose not implemented yet
}
QuadBLAS::gemm(qblas_layout, m, n, k, *alpha, A, lda, B, ldb, *beta, C, ldc);
qblas_gemv already accepts 'T' (implemented as a layout swap), but
the same T / C semantics aren't available for gemm.
Proposed API
Match the BLAS convention so the wrapper can pass transa/transb
through directly:
// Each of 'N', 'T', 'C' supported (C == T for real-valued types).QuadBLAS::gemm(Layout layout,
Trans transa, Trans transb,
size_t m, size_t n, size_t k,
Sleef_quad alpha,
const Sleef_quad *A, size_t lda,
const Sleef_quad *B, size_t ldb,
Sleef_quad beta,
Sleef_quad *C, size_t ldc);
Layout already exists; adding a Trans enum (or a char) and honoring it in the kernel would let the C wrapper drop the "transpose not implemented yet" guard.
Notes / acceptance
Implementation can reuse the same trick qblas_gemv uses (swap dims + flip layout) when that's enough, or do a real transposed kernel where it matters for performance.
Existing tests in tests/ should be extended with transa/transb variants of the gemm cases.
changed the title [-][FEAT] Support transpose flags `transa, transb != 'N'` in `qblas_gemm` / `qblas_gemv`[/-][+][FEAT] Support transpose flags `transa, transb != 'N'` in GEMM[/+]on May 12, 2026
Activity
[-][FEAT] Support transpose flags `transa, transb != 'N'` in `qblas_gemm` / `qblas_gemv`[/-][+][FEAT] Support transpose flags `transa, transb != 'N'` in GEMM[/+]