• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright 2016 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 #ifndef TENSORFLOW_CORE_KERNELS_TILE_OPS_CPU_IMPL_H_
16 #define TENSORFLOW_CORE_KERNELS_TILE_OPS_CPU_IMPL_H_
17 
18 #define EIGEN_USE_THREADS
19 
20 #include "tensorflow/core/framework/register_types.h"
21 #include "tensorflow/core/kernels/tile_ops_impl.h"
22 
23 namespace tensorflow {
24 
25 namespace functor {
26 
27 typedef Eigen::ThreadPoolDevice CPUDevice;
28 
29 // Register functors used for TileGradientOp.
30 #define DEFINE_DIM(T, NDIM)                     \
31   template struct TileGrad<CPUDevice, T, NDIM>; \
32   template struct ReduceAndReshape<CPUDevice, T, NDIM, 1>;
33 #define DEFINE_TYPE(T) DEFINE_DIM(T, CPU_PROVIDED_IXDIM)
34 
35 TF_CALL_float(DEFINE_TYPE);
36 TF_CALL_bfloat16(DEFINE_TYPE);
37 TF_CALL_double(DEFINE_TYPE);
38 TF_CALL_int16(DEFINE_TYPE);
39 TF_CALL_int32(DEFINE_TYPE);
40 TF_CALL_int64(DEFINE_TYPE);
41 TF_CALL_half(DEFINE_TYPE);
42 TF_CALL_complex64(DEFINE_TYPE);
43 TF_CALL_complex128(DEFINE_TYPE);
44 
45 #undef DEFINE_DIM
46 #undef DEFINE_TYPE
47 
48 #ifdef TENSORFLOW_USE_SYCL
49 typedef Eigen::SyclDevice SYCLDevice;
50 
51 // Register functors used for TileGradientOp.
52 #define DEFINE_DIM(T, NDIM)                      \
53   template struct TileGrad<SYCLDevice, T, NDIM>; \
54   template struct ReduceAndReshape<SYCLDevice, T, NDIM, 1>;
55 #define DEFINE_TYPE(T) DEFINE_DIM(T, CPU_PROVIDED_IXDIM)
56 
57 TF_CALL_bool(DEFINE_TYPE);
58 TF_CALL_float(DEFINE_TYPE);
59 TF_CALL_bfloat16(DEFINE_TYPE);
60 TF_CALL_double(DEFINE_TYPE);
61 TF_CALL_uint8(DEFINE_TYPE);
62 TF_CALL_int16(DEFINE_TYPE);
63 TF_CALL_int32(DEFINE_TYPE);
64 TF_CALL_int64(DEFINE_TYPE);
65 
66 #undef DEFINE_DIM
67 #undef DEFINE_TYPE
68 #endif  // TENSORFLOW_USE_SYCL
69 
70 }  // end namespace functor
71 }  // end namespace tensorflow
72 
73 #endif  // TENSORFLOW_CORE_KERNELS_TILE_OPS_CPU_IMPL_H_
74