From 58026905ae4a608abac33f59a782beae590a8371 Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Wed, 25 May 2016 11:04:14 -0700 Subject: Added support for statically known lists of pairs of indices --- unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h | 14 ++++++++++++++ 1 file changed, 14 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 cd04716bd..9ae97ba42 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h @@ -112,6 +112,20 @@ bool operator!=(const Tuple& x, const Tuple& y) { } +// Can't use std::pairs on cuda devices +template struct IndexPair { + constexpr EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE IndexPair() : first(0), second(0) {} + constexpr EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE IndexPair(Idx f, Idx s) : first(f), second(s) {} + + EIGEN_DEVICE_FUNC void set(IndexPair val) { + first = val.first; + second = val.second; + } + + Idx first; + Idx second; +}; + #ifdef EIGEN_HAS_SFINAE namespace internal { -- cgit v1.2.3