Skip to content

Commit 54c95e4

Browse files
committed
fix blas
1 parent 8c23f7c commit 54c95e4

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

paddle/fluid/operators/math/blas.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ class Blas {
9090
void GEMM(bool transA, bool transB, int M, int N, int K, T alpha, const T* A,
9191
int lda, const T* B, int ldb, T beta, T* C, int ldc) const;
9292

93+
#ifdef PADDLE_WITH_MKLML
9394
template <typename T>
9495
T* GEMM_ALLOC(const CBLAS_IDENTIFIER id, const int M, const int N,
9596
const int K) const;
@@ -106,6 +107,7 @@ class Blas {
106107

107108
template <typename T>
108109
void GEMM_FREE(T* data) const;
110+
#endif
109111

110112
template <typename T>
111113
void MatMul(const framework::Tensor& mat_a, bool trans_a,
@@ -163,6 +165,7 @@ class BlasT : private Blas<DeviceContext> {
163165
Base()->template GEMM<T>(args...);
164166
}
165167

168+
#ifdef PADDLE_WITH_MKLML
166169
template <typename... ARGS>
167170
T* GEMM_ALLOC(ARGS... args) const {
168171
return Base()->template GEMM_ALLOC<T>(args...);
@@ -182,6 +185,7 @@ class BlasT : private Blas<DeviceContext> {
182185
void GEMM_FREE(ARGS... args) const {
183186
Base()->template GEMM_FREE<T>(args...);
184187
}
188+
#endif
185189

186190
template <typename... ARGS>
187191
void MatMul(ARGS... args) const {

paddle/fluid/operators/math/blas_impl.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ inline void GEMM_WARP(CBLAS_ORDER order, CBLAS_TRANSPOSE transA,
264264
beta, C, ldc);
265265
}
266266

267+
#ifdef PADDLE_WITH_MKLML
267268
template <>
268269
template <typename T>
269270
T *Blas<platform::CPUDeviceContext>::GEMM_ALLOC(const CBLAS_IDENTIFIER id,
@@ -296,6 +297,7 @@ template <typename T>
296297
void Blas<platform::CPUDeviceContext>::GEMM_FREE(T *data) const {
297298
CBlas<T>::GEMM_FREE(data);
298299
}
300+
#endif
299301

300302
template <>
301303
template <typename T>

0 commit comments

Comments
 (0)