Skip to content

Commit

Permalink
[ROCm] Re-enabling ROCm support for the average pooling op
Browse files Browse the repository at this point in the history
ROCm support for the average pooling op was disabled in PR #, because it was leading to a compiler error in the `--config=rocm` build. That issue has now been fixed and hence filign this PR to re-enable ROCm support for the average pooling op.
  • Loading branch information
deven-amd committed Jul 11, 2019
1 parent b694b7d commit f021805
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tensorflow/core/kernels/avgpooling_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ limitations under the License.
#include "tensorflow/core/util/padding.h"
#include "tensorflow/core/util/tensor_format.h"

#if GOOGLE_CUDA
#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM
#include "tensorflow/core/kernels/maxpooling_op_gpu.h"
#include "tensorflow/core/kernels/pooling_ops_common_gpu.h"
#endif // GOOGLE_CUDA
#endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM

namespace tensorflow {

Expand Down Expand Up @@ -112,7 +112,7 @@ REGISTER_KERNEL_BUILDER(
Name("AvgPool").Device(DEVICE_CPU).TypeConstraint<Eigen::half>("T"),
AvgPoolingOp<CPUDevice, Eigen::half>);

#if GOOGLE_CUDA
#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM
template <typename T>
class AvgPoolingOp<GPUDevice, T> : public UnaryOp<T> {
public:
Expand Down Expand Up @@ -205,7 +205,7 @@ REGISTER_KERNEL_BUILDER(
REGISTER_KERNEL_BUILDER(
Name("AvgPool").Device(DEVICE_GPU).TypeConstraint<double>("T"),
AvgPoolingOp<GPUDevice, double>);
#endif // GOOGLE_CUDA
#endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM

// The operation to compute AvgPool gradients.
// It takes two inputs:
Expand Down Expand Up @@ -368,7 +368,7 @@ TF_CALL_float(REGISTER_CPU_KERNEL);
TF_CALL_double(REGISTER_CPU_KERNEL);
TF_CALL_half(REGISTER_CPU_KERNEL);

#if GOOGLE_CUDA
#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM

// A CUDNN based AvgPoolingGrad implementation. It includes the padding as the
// candidates for the pooling operation.
Expand Down Expand Up @@ -577,6 +577,6 @@ REGISTER_KERNEL_BUILDER(Name("AvgPoolGrad")
.HostMemory("orig_input_shape"),
AvgPoolingGradOpCustomGPUKernel<Eigen::half>);

#endif // GOOGLE_CUDA
#endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM

} // namespace tensorflow

0 comments on commit f021805

Please sign in to comment.