From 54c95e49f09e70233adb363b5b612cb8d427c116 Mon Sep 17 00:00:00 2001 From: tensor-tang Date: Mon, 6 Aug 2018 11:34:11 +0800 Subject: [PATCH] fix blas --- paddle/fluid/operators/math/blas.h | 4 ++++ paddle/fluid/operators/math/blas_impl.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/paddle/fluid/operators/math/blas.h b/paddle/fluid/operators/math/blas.h index 485e96227e4..2558154e0b3 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 4164fe6229c..bf338210796 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 -- GitLab