Home | History | Annotate | Download | only in kernels
      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_double(DEFINE_TYPE);
     37 TF_CALL_int16(DEFINE_TYPE);
     38 TF_CALL_int32(DEFINE_TYPE);
     39 TF_CALL_int64(DEFINE_TYPE);
     40 TF_CALL_half(DEFINE_TYPE);
     41 TF_CALL_complex64(DEFINE_TYPE);
     42 TF_CALL_complex128(DEFINE_TYPE);
     43 
     44 #undef DEFINE_DIM
     45 #undef DEFINE_TYPE
     46 
     47 #ifdef TENSORFLOW_USE_SYCL
     48 typedef Eigen::SyclDevice SYCLDevice;
     49 
     50 // Register functors used for TileGradientOp.
     51 #define DEFINE_DIM(T, NDIM)                      \
     52   template struct TileGrad<SYCLDevice, T, NDIM>; \
     53   template struct ReduceAndReshape<SYCLDevice, T, NDIM, 1>;
     54 #define DEFINE_TYPE(T) DEFINE_DIM(T, CPU_PROVIDED_IXDIM)
     55 
     56 TF_CALL_bool(DEFINE_TYPE);
     57 TF_CALL_float(DEFINE_TYPE);
     58 TF_CALL_double(DEFINE_TYPE);
     59 TF_CALL_uint8(DEFINE_TYPE);
     60 TF_CALL_int16(DEFINE_TYPE);
     61 TF_CALL_int32(DEFINE_TYPE);
     62 TF_CALL_int64(DEFINE_TYPE);
     63 
     64 #undef DEFINE_DIM
     65 #undef DEFINE_TYPE
     66 #endif  // TENSORFLOW_USE_SYCL
     67 
     68 }  // end namespace functor
     69 }  // end namespace tensorflow
     70 
     71 #endif  // TENSORFLOW_CORE_KERNELS_TILE_OPS_CPU_IMPL_H_
     72