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 GOOGLE_CUDA 17 18 #define EIGEN_USE_GPU 19 20 #include "tensorflow/core/kernels/reverse_op.h" 21 22 #include "tensorflow/core/framework/register_types.h" 23 24 namespace tensorflow { 25 26 typedef Eigen::GpuDevice GPUDevice; 27 28 #define DEFINE_REVERSE(T, DIM) \ 29 template struct functor::Reverse<GPUDevice, T, DIM>; 30 #define DEFINE_REVERSE_ALL_DIMS(T) \ 31 DEFINE_REVERSE(T, 0) \ 32 DEFINE_REVERSE(T, 1) \ 33 DEFINE_REVERSE(T, 2) \ 34 DEFINE_REVERSE(T, 3) \ 35 DEFINE_REVERSE(T, 4) \ 36 DEFINE_REVERSE(T, 5) \ 37 DEFINE_REVERSE(T, 6) \ 38 DEFINE_REVERSE(T, 7) \ 39 DEFINE_REVERSE(T, 8) 40 41 TF_CALL_uint8(DEFINE_REVERSE_ALL_DIMS); 42 TF_CALL_int8(DEFINE_REVERSE_ALL_DIMS); 43 TF_CALL_bool(DEFINE_REVERSE_ALL_DIMS); 44 TF_CALL_half(DEFINE_REVERSE_ALL_DIMS); 45 TF_CALL_float(DEFINE_REVERSE_ALL_DIMS); 46 TF_CALL_double(DEFINE_REVERSE_ALL_DIMS); 47 TF_CALL_complex64(DEFINE_REVERSE_ALL_DIMS); 48 TF_CALL_complex128(DEFINE_REVERSE_ALL_DIMS); 49 #undef DEFINE_REVERSE 50 #undef DEFINE_REVERSE_ALL_DIMS 51 52 } // namespace tensorflow 53 54 #endif // GOOGLE_CUDA 55