Skip to content

Commit e2dd7b8

Browse files
committed
Patch out SYRK portions in GEMM
The GEMM functions in ATLAS's reference BLAS will detect if a matrix is being multiplied by its transpose and if so dispatch to SYRK. While a good idea, it is much more complicated to pull in the SYRK portions of ATLAS as they have some headers and source files that are generated dynamically at build time. Given our changes here do not benefit from SYRK, simply patch out those custom dispatch portions in the GEMM functions.
1 parent 7cafcbf commit e2dd7b8

File tree

2 files changed

+0
-24
lines changed

2 files changed

+0
-24
lines changed

sklearn/src/cblas/cblas_dgemm.c

-12
Original file line numberDiff line numberDiff line change
@@ -139,18 +139,6 @@ void cblas_dgemm(const enum CBLAS_ORDER Order,
139139
return;
140140
}
141141
#endif
142-
/*
143-
* Call SYRK when that's what the user is actually asking for; just handle
144-
* beta=0, because beta=X requires we copy C and then subtract to preserve
145-
* asymmetry
146-
*/
147-
if (A == B && M == N && TA != TB && lda == ldb && beta == 0.0)
148-
{
149-
ATL_dsyrk(CblasUpper, (Order == CblasColMajor) ? TA : TB, N, K,
150-
alpha, A, lda, beta, C, ldc);
151-
ATL_dsyreflect(CblasUpper, N, C, ldc);
152-
return;
153-
}
154142
if (Order == CblasColMajor)
155143
ATL_dgemm(TA, TB, M, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
156144
else

sklearn/src/cblas/cblas_sgemm.c

-12
Original file line numberDiff line numberDiff line change
@@ -139,18 +139,6 @@ void cblas_sgemm(const enum CBLAS_ORDER Order,
139139
return;
140140
}
141141
#endif
142-
/*
143-
* Call SYRK when that's what the user is actually asking for; just handle
144-
* beta=0, because beta=X requires we copy C and then subtract to preserve
145-
* asymmetry
146-
*/
147-
if (A == B && M == N && TA != TB && lda == ldb && beta == 0.0)
148-
{
149-
ATL_ssyrk(CblasUpper, (Order == CblasColMajor) ? TA : TB, N, K,
150-
alpha, A, lda, beta, C, ldc);
151-
ATL_ssyreflect(CblasUpper, N, C, ldc);
152-
return;
153-
}
154142
if (Order == CblasColMajor)
155143
ATL_sgemm(TA, TB, M, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
156144
else

0 commit comments

Comments
 (0)