aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h
diff options
context:
space:
mode:
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h')
-rw-r--r--unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h23
1 files changed, 23 insertions, 0 deletions
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 <typename Scalar, typename Device>
+struct PacketType {
+ typedef typename internal::packet_traits<Scalar>::type type;
+ static const int size = internal::unpacket_traits<type>::size;
+};
+
+// For CUDA packet types when using a GpuDevice
+#if defined(EIGEN_USE_GPU) && defined(__CUDACC__)
+template <>
+struct PacketType<float, GpuDevice> {
+ typedef float4 type;
+ static const int size = 4;
+};
+template <>
+struct PacketType<double, GpuDevice> {
+ typedef double2 type;
+ static const int size = 2;
+};
+#endif
+
+
+
// Tuple mimics std::pair but works on e.g. nvcc.
template <typename U, typename V> struct Tuple {
public: