Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions paddle/fluid/operators/activation_op.cu
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,8 @@ namespace plat = paddle::platform;
ops::grad_functor<plat::float16>>);
FOR_EACH_ACTIVATION_OP(REGISTER_ACTIVATION_CUDA_KERNEL);

#define REGISTER_ACTIVATION_GPU_KERNEL(act_type, op_name, functor, \
grad_functor) \
#define REGISTER_ACTIVATION_HIGH_PERFORMANCE_KERNEL(act_type, op_name, \
functor, grad_functor) \
REGISTER_OP_CUDA_KERNEL( \
act_type, ops::ActivationGPUKernel<paddle::platform::CUDADeviceContext, \
ops::functor<float>>, \
Expand All @@ -430,8 +430,9 @@ FOR_EACH_ACTIVATION_OP(REGISTER_ACTIVATION_CUDA_KERNEL);
ops::grad_functor<plat::float16>>);

/* ======================== leaky relu register ============================ */
REGISTER_ACTIVATION_GPU_KERNEL(leaky_relu, LeakyRelu, LeakyReluGPUFunctor,
LeakyReluGradGPUFunctor);
REGISTER_ACTIVATION_HIGH_PERFORMANCE_KERNEL(leaky_relu, LeakyRelu,
LeakyReluGPUFunctor,
LeakyReluGradGPUFunctor);

REGISTER_OP_CUDA_KERNEL(
leaky_relu_grad_grad,
Expand All @@ -454,9 +455,9 @@ REGISTER_OP_CUDA_KERNEL(
ops::ELUDoubleGradKernel<plat::CUDADeviceContext,
ops::ELUGradGradFunctor<plat::float16>>);
/* ========================================================================== */

/* =========================== relu register ============================ */
REGISTER_ACTIVATION_GPU_KERNEL(relu, Relu, ReluGPUFunctor, ReluGradGPUFunctor);
REGISTER_ACTIVATION_HIGH_PERFORMANCE_KERNEL(relu, Relu, ReluGPUFunctor,
ReluGradGPUFunctor);

REGISTER_OP_CUDA_KERNEL(
relu_grad_grad,
Expand Down