• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef TENSORFLOW_CORE_KERNELS_STRIDED_SLICE_OP_GPU_IMPL_H_
17 #define TENSORFLOW_CORE_KERNELS_STRIDED_SLICE_OP_GPU_IMPL_H_
18 
19 #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM
20 
21 #define EIGEN_USE_GPU
22 
23 #include "tensorflow/core/kernels/strided_slice_op.h"
24 
25 #include "tensorflow/core/framework/register_types.h"
26 #include "tensorflow/core/framework/tensor_types.h"
27 #include "tensorflow/core/platform/types.h"
28 
29 namespace tensorflow {
30 
31 typedef Eigen::GpuDevice GPUDevice;
32 
33 #define DEFINE_GPU_KERNELS(T)                                   \
34   template struct functor::StridedSlice<GPUDevice, T, 1>;       \
35   template struct functor::StridedSlice<GPUDevice, T, 2>;       \
36   template struct functor::StridedSlice<GPUDevice, T, 3>;       \
37   template struct functor::StridedSlice<GPUDevice, T, 4>;       \
38   template struct functor::StridedSlice<GPUDevice, T, 5>;       \
39   template struct functor::StridedSlice<GPUDevice, T, 6>;       \
40   template struct functor::StridedSlice<GPUDevice, T, 7>;       \
41   template struct functor::StridedSlice<GPUDevice, T, 8>;       \
42   template struct functor::StridedSliceGrad<GPUDevice, T, 1>;   \
43   template struct functor::StridedSliceGrad<GPUDevice, T, 2>;   \
44   template struct functor::StridedSliceGrad<GPUDevice, T, 3>;   \
45   template struct functor::StridedSliceGrad<GPUDevice, T, 4>;   \
46   template struct functor::StridedSliceGrad<GPUDevice, T, 5>;   \
47   template struct functor::StridedSliceGrad<GPUDevice, T, 6>;   \
48   template struct functor::StridedSliceGrad<GPUDevice, T, 7>;   \
49   template struct functor::StridedSliceGrad<GPUDevice, T, 8>;   \
50   template struct functor::StridedSliceAssign<GPUDevice, T, 1>; \
51   template struct functor::StridedSliceAssign<GPUDevice, T, 2>; \
52   template struct functor::StridedSliceAssign<GPUDevice, T, 3>; \
53   template struct functor::StridedSliceAssign<GPUDevice, T, 4>; \
54   template struct functor::StridedSliceAssign<GPUDevice, T, 5>; \
55   template struct functor::StridedSliceAssign<GPUDevice, T, 6>; \
56   template struct functor::StridedSliceAssign<GPUDevice, T, 7>; \
57   template struct functor::StridedSliceAssign<GPUDevice, T, 8>; \
58   template struct functor::StridedSliceAssignScalar<GPUDevice, T>;
59 
60 }  // end namespace tensorflow
61 
62 #endif  // GOOGLE_CUDA || TENSORFLOW_USE_ROCM
63 #endif  // TENSORFLOW_CORE_KERNELS_STRIDED_SLICE_OP_GPU_IMPL_H_
64