1 /* Copyright 2015 The TensorFlow Authors. All Rights Reserved. 2 3 Licensed under the Apache License, Version 2.0 (the "License"); 4 you may not use this file except in compliance with the License. 5 You may obtain a copy of the License at 6 7 http://www.apache.org/licenses/LICENSE-2.0 8 9 Unless required by applicable law or agreed to in writing, software 10 distributed under the License is distributed on an "AS IS" BASIS, 11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 See the License for the specific language governing permissions and 13 limitations under the License. 14 ==============================================================================*/ 15 16 #if (defined(GOOGLE_CUDA) && GOOGLE_CUDA) || \ 17 (defined(TENSORFLOW_USE_ROCM) && TENSORFLOW_USE_ROCM) 18 19 #define EIGEN_USE_GPU 20 21 #include "tensorflow/core/kernels/pad_op.h" 22 23 #include "tensorflow/core/framework/register_types.h" 24 25 namespace tensorflow { 26 27 typedef Eigen::GpuDevice GPUDevice; 28 29 // Definition of the GPU implementations declared in pad_op.cc. 30 #define DEFINE_GPU_PAD_SPECS(T, Tpadding) \ 31 template struct functor::Pad<GPUDevice, T, Tpadding, 0>; \ 32 template struct functor::Pad<GPUDevice, T, Tpadding, 1>; \ 33 template struct functor::Pad<GPUDevice, T, Tpadding, 2>; \ 34 template struct functor::Pad<GPUDevice, T, Tpadding, 3>; \ 35 template struct functor::Pad<GPUDevice, T, Tpadding, 4>; \ 36 template struct functor::Pad<GPUDevice, T, Tpadding, 5>; \ 37 template struct functor::Pad<GPUDevice, T, Tpadding, 6>; \ 38 template struct functor::Pad<GPUDevice, T, Tpadding, 7>; \ 39 template struct functor::Pad<GPUDevice, T, Tpadding, 8>; 40 41 #define DEFINE_GPU_SPECS(T) \ 42 DEFINE_GPU_PAD_SPECS(T, int32) \ 43 DEFINE_GPU_PAD_SPECS(T, int64) 44 45 TF_CALL_GPU_ALL_TYPES(DEFINE_GPU_SPECS); 46 TF_CALL_int8(DEFINE_GPU_SPECS); 47 TF_CALL_uint8(DEFINE_GPU_SPECS); 48 49 } // namespace tensorflow 50 51 #endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM 52