mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user