Skip to content

Commit

Permalink
Add openBLAS support for sgemm() in compute_forward_out_prod()
Browse files Browse the repository at this point in the history
  • Loading branch information
gwjr committed Nov 16, 2023
1 parent e5c1f02 commit da122af
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ggml.c
Original file line number Diff line number Diff line change
Expand Up @@ -9631,17 +9631,17 @@ static void ggml_compute_forward_out_prod_f32(
// compute by src0 rows

// TODO: #if defined(GGML_USE_CUBLAS) ggml_cuda_out_prod
// TODO: #if defined(GGML_USE_OPENBLAS) || defined(GGML_USE_CLBLAST)
// TODO: #if defined(GGML_USE_CLBLAST)

#if defined(GGML_USE_ACCELERATE)
#if defined(GGML_USE_ACCELERATE) || defined(GGML_USE_OPENBLAS)
bool use_blas = ggml_is_matrix(src0) &&
ggml_is_matrix(src1) &&
ggml_is_contiguous(src0) &&
(ggml_is_contiguous(src1) || ggml_is_transposed(src1));
#endif

if (params->type == GGML_TASK_INIT) {
#if defined(GGML_USE_ACCELERATE) // gemm beta will zero dst
#if defined(GGML_USE_ACCELERATE) || defined(GGML_USE_OPENBLAS) // gemm beta will zero dst
if (use_blas) {
return;
}
Expand All @@ -9654,7 +9654,7 @@ static void ggml_compute_forward_out_prod_f32(
return;
}

#if defined(GGML_USE_ACCELERATE)
#if defined(GGML_USE_ACCELERATE) || defined(GGML_USE_OPENBLAS)
if (use_blas) {
if (params->ith != 0) { // All threads other than the first do no work.
return;
Expand Down

0 comments on commit da122af

Please sign in to comment.