Created the IndexPair type to store pair of tensor indices. CUDA doesn't support std::pair so we can't use them when targeting GPUs.

Improved the performance on tensor contractions
This commit is contained in:
Benoit Steiner
2014-10-03 10:16:59 -07:00
parent b7271dffb5
commit 1269392822
3 changed files with 662 additions and 90 deletions

View File

@@ -29,6 +29,13 @@ namespace Eigen {
* \sa Tensor
*/
// Can't use std::pairs on cuda devices
template <typename Index> struct IndexPair {
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE IndexPair() : first(0), second(0) { }
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE IndexPair(Index f, Index s) : first(f), second(s) { }
Index first;
Index second;
};
// Boiler plate code