From 151ebd0bc676e0b5f3b3fb574ff180f8fdda37f3 Mon Sep 17 00:00:00 2001 From: Deven Desai Date: Mon, 13 May 2019 18:23:18 +0000 Subject: [PATCH] Fix for the broken `--config=rocm` build The --config=rocm build was broken by the merge for PR #26840 This commit backs out the ROCm support in the file avgpooling_op.cc (added by the above PR). This is because the the template instantiations required for GPU support of the average pooling operator (which are in avgpooling_op_gpu.cu.cc) also need to be enabled for ROCm at the same time (as the code in avgpooling_op.cc) in order to avoid link errors with the `--config=rocm` build. Enabling ROCm support for the code in avgpooling_op_gpu.cu.cc requires other PRs (the set spwaned from PR #28343) to be merged first. Once those PRs are merged, we will file another PR to re-enable ROCm support in the avgpooling*.cc files. --- tensorflow/core/kernels/avgpooling_op.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tensorflow/core/kernels/avgpooling_op.cc b/tensorflow/core/kernels/avgpooling_op.cc index 1cc5a2d8a3e..ba38e1a188f 100644 --- a/tensorflow/core/kernels/avgpooling_op.cc +++ b/tensorflow/core/kernels/avgpooling_op.cc @@ -36,10 +36,10 @@ limitations under the License. #include "tensorflow/core/util/padding.h" #include "tensorflow/core/util/tensor_format.h" -#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM +#if GOOGLE_CUDA #include "tensorflow/core/kernels/maxpooling_op_gpu.h" #include "tensorflow/core/kernels/pooling_ops_common_gpu.h" -#endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM +#endif // GOOGLE_CUDA namespace tensorflow { @@ -112,7 +112,7 @@ REGISTER_KERNEL_BUILDER( Name("AvgPool").Device(DEVICE_CPU).TypeConstraint("T"), AvgPoolingOp); -#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM +#if GOOGLE_CUDA template class AvgPoolingOp : public UnaryOp { public: @@ -205,7 +205,7 @@ REGISTER_KERNEL_BUILDER( REGISTER_KERNEL_BUILDER( Name("AvgPool").Device(DEVICE_GPU).TypeConstraint("T"), AvgPoolingOp); -#endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM +#endif // GOOGLE_CUDA // The operation to compute AvgPool gradients. // It takes two inputs: @@ -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 || TENSORFLOW_USE_ROCM +#if GOOGLE_CUDA // A CUDNN based AvgPoolingGrad implementation. It includes the padding as the // candidates for the pooling operation. @@ -577,6 +577,6 @@ REGISTER_KERNEL_BUILDER(Name("AvgPoolGrad") .HostMemory("orig_input_shape"), AvgPoolingGradOpCustomGPUKernel); -#endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM +#endif // GOOGLE_CUDA } // namespace tensorflow