diff --git a/paddle/fluid/operators/math/blas.h b/paddle/fluid/operators/math/blas.h index 485e96227e4fe9bc9380b83e13aab1ac044dea89..2558154e0b39a4281bfaa59ba75867589d73be5d 100644 --- a/paddle/fluid/operators/math/blas.h +++ b/paddle/fluid/operators/math/blas.h @@ -90,6 +90,7 @@ class Blas { void GEMM(bool transA, bool transB, int M, int N, int K, T alpha, const T* A, int lda, const T* B, int ldb, T beta, T* C, int ldc) const; +#ifdef PADDLE_WITH_MKLML template T* GEMM_ALLOC(const CBLAS_IDENTIFIER id, const int M, const int N, const int K) const; @@ -106,6 +107,7 @@ class Blas { template void GEMM_FREE(T* data) const; +#endif template void MatMul(const framework::Tensor& mat_a, bool trans_a, @@ -163,6 +165,7 @@ class BlasT : private Blas { Base()->template GEMM(args...); } +#ifdef PADDLE_WITH_MKLML template T* GEMM_ALLOC(ARGS... args) const { return Base()->template GEMM_ALLOC(args...); @@ -182,6 +185,7 @@ class BlasT : private Blas { void GEMM_FREE(ARGS... args) const { Base()->template GEMM_FREE(args...); } +#endif template void MatMul(ARGS... args) const { diff --git a/paddle/fluid/operators/math/blas_impl.h b/paddle/fluid/operators/math/blas_impl.h index 4164fe6229c5987e7f56fb050df7479758b35ac3..bf3382107960dfd8b52f94b421b49022dcb6d291 100644 --- a/paddle/fluid/operators/math/blas_impl.h +++ b/paddle/fluid/operators/math/blas_impl.h @@ -264,6 +264,7 @@ inline void GEMM_WARP(CBLAS_ORDER order, CBLAS_TRANSPOSE transA, beta, C, ldc); } +#ifdef PADDLE_WITH_MKLML template <> template T *Blas::GEMM_ALLOC(const CBLAS_IDENTIFIER id, @@ -296,6 +297,7 @@ template void Blas::GEMM_FREE(T *data) const { CBlas::GEMM_FREE(data); } +#endif template <> template