From 2dd944661380875b5536658185041acbd459a225 Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Thu, 22 Oct 2015 16:53:36 -0700 Subject: Added mapping between a specific device and the corresponding packet type --- unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h') diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h b/unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h index 07735fa5f..3952e733c 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h @@ -32,6 +32,29 @@ template <> struct max_n_1<0> { }; +// Default packet types +template +struct PacketType { + typedef typename internal::packet_traits::type type; + static const int size = internal::unpacket_traits::size; +}; + +// For CUDA packet types when using a GpuDevice +#if defined(EIGEN_USE_GPU) && defined(__CUDACC__) +template <> +struct PacketType { + typedef float4 type; + static const int size = 4; +}; +template <> +struct PacketType { + typedef double2 type; + static const int size = 2; +}; +#endif + + + // Tuple mimics std::pair but works on e.g. nvcc. template struct Tuple { public: -- cgit v1.2.3