Skip to content

Commit

Permalink
fix: move RUY sgemm implementation below BLAS
Browse files Browse the repository at this point in the history
  • Loading branch information
ebraraktas committed Mar 14, 2024
1 parent 85166a5 commit 302ca69
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/cpu/primitives.cc
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,21 @@ namespace ctranslate2 {
}
#endif

#ifdef CT2_WITH_OPENBLAS
case cpu::GemmBackend::OPENBLAS: {
cblas_sgemm(CblasRowMajor,
transpose_a ? CblasTrans : CblasNoTrans,
transpose_b ? CblasTrans : CblasNoTrans,
m, n, k,
alpha,
a, lda,
b, ldb,
beta,
c, ldc);
break;
}
#endif

#ifdef CT2_WITH_RUY
case cpu::GemmBackend::RUY: {
if (lda != (transpose_a ? m : k)
Expand Down Expand Up @@ -746,21 +761,6 @@ namespace ctranslate2 {
}
#endif

#ifdef CT2_WITH_OPENBLAS
case cpu::GemmBackend::OPENBLAS: {
cblas_sgemm(CblasRowMajor,
transpose_a ? CblasTrans : CblasNoTrans,
transpose_b ? CblasTrans : CblasNoTrans,
m, n, k,
alpha,
a, lda,
b, ldb,
beta,
c, ldc);
break;
}
#endif

default:
throw std::runtime_error("No SGEMM backend on CPU");
}
Expand Down

0 comments on commit 302ca69

Please sign in to comment.