diff --git a/paddle/fluid/operators/math/pooling.h b/paddle/fluid/operators/math/pooling.h index fa732f96d4..923babd4c2 100644 --- a/paddle/fluid/operators/math/pooling.h +++ b/paddle/fluid/operators/math/pooling.h @@ -82,7 +82,7 @@ class AvgPoolGrad { * This is different from average pooling. So we rewrite the max_pool_grad: * MaxPool2dGradFunctor, MaxPool3dGradFunctor. */ - +#ifdef PADDLE_WITH_CUDA template class Pool2dDirectCUDAFunctor { public: @@ -93,6 +93,7 @@ class Pool2dDirectCUDAFunctor { const std::vector& paddings, PoolProcess pool_compute, bool exclusive, T* output, cudaStream_t stream); }; +#endif template class Pool2dFunctor {