aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/kernels/split_op_gpu.cu.cc
blob: f8931d6a89892bcda746a41b3baf411eead915af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#if GOOGLE_CUDA

#define EIGEN_USE_GPU

#include <stdio.h>

#include "tensorflow/core/kernels/split_op.h"

#include "tensorflow/core/framework/register_types.h"
#include "tensorflow/core/framework/tensor_types.h"

namespace tensorflow {
namespace functor {

template <typename Device, typename T>
void Split<Device, T>::operator()(
    const Device& d, typename TTypes<T, 3>::Tensor output,
    typename TTypes<T, 3>::ConstTensor input,
    const Eigen::DSizes<ptrdiff_t, 3>& slice_indices,
    const Eigen::DSizes<ptrdiff_t, 3>& slice_sizes) {
  output.device(d) = input.slice(slice_indices, slice_sizes);
}

#define DEFINE_GPU_KERNELS(T) template struct Split<Eigen::GpuDevice, T>;

TF_CALL_GPU_NUMBER_TYPES(DEFINE_GPU_KERNELS);

}  // namespace functor
}  // namespace tensorflow

#endif  // GOOGLE_CUDA