Skip to content

Commit 9291302

Browse files
authored
fix unused var error (#9908)
1 parent 47609ab commit 9291302

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

paddle/fluid/operators/math/math_function.cu

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ void batched_gemm<platform::CUDADeviceContext, float16>(
268268
const CBLAS_TRANSPOSE transB, const int M, const int N, const int K,
269269
const float16 alpha, const float16* A, const float16* B, const float16 beta,
270270
float16* C, const int batchCount, const int strideA, const int strideB) {
271+
#if CUDA_VERSION >= 8000
271272
// Note that cublas follows fortran order, so the order is different from
272273
// the cblas convention.
273274
int lda = (transA == CblasNoTrans) ? K : M;
@@ -289,7 +290,6 @@ void batched_gemm<platform::CUDADeviceContext, float16>(
289290
PADDLE_ENFORCE_GE(context.GetComputeCapability(), 53,
290291
"cublas Hgemm requires GPU compute capability >= 53");
291292

292-
#if CUDA_VERSION >= 8000
293293
PADDLE_ENFORCE(platform::dynload::cublasHgemmStridedBatched(
294294
context.cublas_handle(), cuTransB, cuTransA, N, M, K, &h_alpha, h_B, ldb,
295295
strideB, h_A, lda, strideA, &h_beta, h_C, ldc, strideC, batchCount));
@@ -304,6 +304,7 @@ void batched_gemm<platform::CUDADeviceContext, float>(
304304
const CBLAS_TRANSPOSE transB, const int M, const int N, const int K,
305305
const float alpha, const float* A, const float* B, const float beta,
306306
float* C, const int batchCount, const int strideA, const int strideB) {
307+
#if CUDA_VERSION >= 8000
307308
// Note that cublas follows fortran order, so the order is different from
308309
// the cblas convention.
309310
int lda = (transA == CblasNoTrans) ? K : M;
@@ -315,7 +316,6 @@ void batched_gemm<platform::CUDADeviceContext, float>(
315316
(transB == CblasNoTrans) ? CUBLAS_OP_N : CUBLAS_OP_T;
316317
const int strideC = M * N;
317318

318-
#if CUDA_VERSION >= 8000
319319
PADDLE_ENFORCE(platform::dynload::cublasSgemmStridedBatched(
320320
context.cublas_handle(), cuTransB, cuTransA, N, M, K, &alpha, B, ldb,
321321
strideB, A, lda, strideA, &beta, C, ldc, strideC, batchCount));
@@ -330,6 +330,7 @@ void batched_gemm<platform::CUDADeviceContext, double>(
330330
const CBLAS_TRANSPOSE transB, const int M, const int N, const int K,
331331
const double alpha, const double* A, const double* B, const double beta,
332332
double* C, const int batchCount, const int strideA, const int strideB) {
333+
#if CUDA_VERSION >= 8000
333334
// Note that cublas follows fortran order, so the order is different from
334335
// the cblas convention.
335336
int lda = (transA == CblasNoTrans) ? K : M;
@@ -341,7 +342,6 @@ void batched_gemm<platform::CUDADeviceContext, double>(
341342
(transB == CblasNoTrans) ? CUBLAS_OP_N : CUBLAS_OP_T;
342343
const int strideC = M * N;
343344

344-
#if CUDA_VERSION >= 8000
345345
PADDLE_ENFORCE(platform::dynload::cublasDgemmStridedBatched(
346346
context.cublas_handle(), cuTransB, cuTransA, N, M, K, &alpha, B, ldb,
347347
strideB, A, lda, strideA, &beta, C, ldc, strideC, batchCount));

0 commit comments

Comments
 (0)