From caa4027d9dadb99af28084565b7d3f4c8b17e8d5 Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Wed, 2 May 2018 17:12:45 +0800 Subject: [PATCH] Follow comments --- paddle/fluid/operators/math/blas_impl.cu.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/paddle/fluid/operators/math/blas_impl.cu.h b/paddle/fluid/operators/math/blas_impl.cu.h index 86e494699..89935829a 100644 --- a/paddle/fluid/operators/math/blas_impl.cu.h +++ b/paddle/fluid/operators/math/blas_impl.cu.h @@ -126,14 +126,9 @@ inline void Blas::GEMM( CUDA_R_32F, algo)); #else // CUDA 7.5 does not support cublasGemmEx, hence we fall back to use hgemm - const half h_alpha = static_cast(alpha); - const half h_beta = static_cast(beta); - const half *h_A = reinterpret_cast(A); - const half *h_B = reinterpret_cast(B); - half *h_C = reinterpret_cast(C); - - CUBlas(context_.cublas_handle(), cuTransB, cuTransA, N, M, - K, &h_alpha, h_B, ldb, h_A, lda, &h_beta, h_C, N); + CUBlas::GEMM(context_.cublas_handle(), cuTransB, cuTransA, + N, M, K, &h_alpha, h_B, ldb, h_A, lda, + &h_beta, h_C, N); #endif // CUDA_VERSION >= 8000 } -- GitLab