From f41959ccb2d9d4c722fe8fc3351401d53bcf4900 Mon Sep 17 00:00:00 2001 From: Manjunath Kudlur Date: Fri, 6 Nov 2015 16:27:58 -0800 Subject: TensorFlow: Initial commit of TensorFlow library. TensorFlow is an open source software library for numerical computation using data flow graphs. Base CL: 107276108 --- tensorflow/core/kernels/cast_op_gpu.cu.cc | 45 +++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 tensorflow/core/kernels/cast_op_gpu.cu.cc (limited to 'tensorflow/core/kernels/cast_op_gpu.cu.cc') diff --git a/tensorflow/core/kernels/cast_op_gpu.cu.cc b/tensorflow/core/kernels/cast_op_gpu.cu.cc new file mode 100644 index 0000000000..cd198c752b --- /dev/null +++ b/tensorflow/core/kernels/cast_op_gpu.cu.cc @@ -0,0 +1,45 @@ +#if GOOGLE_CUDA + +#define EIGEN_USE_GPU + +#include "tensorflow/core/framework/bfloat16.h" +#include "tensorflow/core/kernels/cast_op.h" + +namespace tensorflow { +namespace functor { + +typedef Eigen::GpuDevice GPUDevice; + +template +struct CastFunctor { + void operator()(const GPUDevice& d, typename TTypes::Flat o, + typename TTypes::ConstFlat i) { + Cast(d, o, i); + } +}; + +#define DEFINE(O, I) template struct CastFunctor; +DEFINE(float, double); +DEFINE(float, int32); +DEFINE(float, int64); +DEFINE(double, float); +DEFINE(double, int32); +DEFINE(double, int64); +DEFINE(int32, float); +DEFINE(int32, double); +DEFINE(int32, int64); +DEFINE(int64, float); +DEFINE(int64, double); +DEFINE(int64, int32); +DEFINE(int32, bool); +DEFINE(float, bool); +DEFINE(float, uint8); +DEFINE(uint8, float); +DEFINE(float, bfloat16); +DEFINE(bfloat16, float); +#undef DEFINE + +} // end namespace functor +} // end namespace tensorflow + +#endif // GOOGLE_CUDA -- cgit v1.2.3