From 42621d70df5278e45dc03628327350b144af704d Mon Sep 17 00:00:00 2001 From: Jeffrey Poznanovic Date: Tue, 19 Mar 2019 02:08:24 +0000 Subject: [PATCH] Added ROCm support for the pad op --- tensorflow/core/kernels/pad_op.cc | 4 ++-- tensorflow/core/kernels/pad_op_gpu.cu.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tensorflow/core/kernels/pad_op.cc b/tensorflow/core/kernels/pad_op.cc index 691430ebaff..d215756e9b8 100644 --- a/tensorflow/core/kernels/pad_op.cc +++ b/tensorflow/core/kernels/pad_op.cc @@ -294,7 +294,7 @@ TF_CALL_POD_TYPES(REGISTER_KERNEL); TF_CALL_string(REGISTER_KERNEL); #undef REGISTER_KERNEL -#if GOOGLE_CUDA +#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM // Forward declarations of the functor specializations for GPU. namespace functor { #define DECLARE_GPU_SPEC(T, Dims) \ @@ -395,7 +395,7 @@ REGISTER_KERNEL_BUILDER(Name("PadV2") .HostMemory("constant_values") .HostMemory("output"), PadOp); -#endif +#endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM #ifdef TENSORFLOW_USE_SYCL // Registration of the GPU implementations. diff --git a/tensorflow/core/kernels/pad_op_gpu.cu.cc b/tensorflow/core/kernels/pad_op_gpu.cu.cc index 0cd8ef17ba2..bd4b0f04e70 100644 --- a/tensorflow/core/kernels/pad_op_gpu.cu.cc +++ b/tensorflow/core/kernels/pad_op_gpu.cu.cc @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#if GOOGLE_CUDA +#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM #define EIGEN_USE_GPU @@ -45,4 +45,4 @@ TF_CALL_uint8(DEFINE_GPU_SPECS); } // namespace tensorflow -#endif // GOOGLE_CUDA +#endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM