From 7a96d5788d9b15f61b60a33338dcf31ce28d5ac1 Mon Sep 17 00:00:00 2001 From: hong19860320 <9973393+hong19860320@users.noreply.github.com> Date: Wed, 30 Sep 2020 22:28:57 +0800 Subject: [PATCH] Optimize the error messages of the CUDA implementation of activation ops (#27741) test=develop --- paddle/fluid/operators/activation_cudnn_op.cu.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/operators/activation_cudnn_op.cu.cc b/paddle/fluid/operators/activation_cudnn_op.cu.cc index 1903b9e30d8..26ad09cc265 100644 --- a/paddle/fluid/operators/activation_cudnn_op.cu.cc +++ b/paddle/fluid/operators/activation_cudnn_op.cu.cc @@ -41,7 +41,7 @@ struct CudnnActivationFunctor { TensorDescriptor x_desc, out_desc; x_desc.set(x); out_desc.set(GET_DATA_SAFELY(out, "Output", "Out", "CudnnActivation")); - PADDLE_ENFORCE(platform::dynload::cudnnActivationForward( + PADDLE_ENFORCE_CUDA_SUCCESS(platform::dynload::cudnnActivationForward( ctx_.cudnn_handle(), act_desc.desc(), platform::CudnnDataType::kOne(), x_desc.desc(), x.data(), platform::CudnnDataType::kZero(), out_desc.desc(), @@ -67,7 +67,7 @@ struct CudnnActivationGradFunctor { out_desc.set(out); dout_desc.set(dout); dx_desc.set(GET_DATA_SAFELY(dx, "Output", "X@GRAD", "CudnnActivationGrad")); - PADDLE_ENFORCE(platform::dynload::cudnnActivationBackward( + PADDLE_ENFORCE_CUDA_SUCCESS(platform::dynload::cudnnActivationBackward( ctx_.cudnn_handle(), act_desc.desc(), platform::CudnnDataType::kOne(), out_desc.desc(), out.data(), dout_desc.desc(), dout.data(), x_desc.desc(), x.data(), -- GitLab