diff options
author | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2014-05-16 15:08:05 -0700 |
---|---|---|
committer | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2014-05-16 15:08:05 -0700 |
commit | 7402fea0a8e63e3ea248257047c584afee8f8bde (patch) | |
tree | 429aee7ea314c579ed62c1c5e1ff84850b14370a /unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h | |
parent | 0320f7e3a71406b9a03d1bab0d168fd76e63d457 (diff) |
Vectorized the evaluation of tensor expression (using SSE, AVX, NEON, ...)
Added the ability to parallelize the evaluation of a tensor expression over multiple cpu cores.
Added the ability to offload the evaluation of a tensor expression to a GPU.
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h')
-rw-r--r-- | unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h index bd3bd5aca..43e9d6550 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h @@ -79,16 +79,16 @@ struct Sizes : internal::numeric_list<std::size_t, Indices...> { Sizes() { } template <typename DenseIndex> - explicit Sizes(const array<DenseIndex, Base::count>&/* indices*/) { + explicit Sizes(const array<DenseIndex, Base::count>& /*indices*/) { // todo: add assertion } #ifdef EIGEN_HAS_VARIADIC_TEMPLATES - explicit Sizes(std::initializer_list<std::size_t>/* l*/) { + explicit Sizes(std::initializer_list<std::size_t> /*l*/) { // todo: add assertion } #endif - template <typename T> Sizes& operator = (const T&/* other*/) { + template <typename T> Sizes& operator = (const T& /*other*/) { // add assertion failure if the size of other is different return *this; } @@ -119,7 +119,7 @@ template <std::size_t V1=0, std::size_t V2=0, std::size_t V3=0, std::size_t V4=0 static const size_t count = Base::count; static const std::size_t total_size = internal::arg_prod<Base>::value; - static const size_t TotalSize() { + static size_t TotalSize() { return internal::arg_prod<Base>::value; } @@ -181,14 +181,11 @@ template <typename DenseIndex, std::size_t NumDims> struct DSizes : array<DenseIndex, NumDims> { typedef array<DenseIndex, NumDims> Base; - size_t TotalSize() const { + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE size_t TotalSize() const { return internal::array_prod(*static_cast<const Base*>(this)); } DSizes() { } -#ifdef EIGEN_HAS_VARIADIC_TEMPLATES - // explicit DSizes(std::initializer_list<DenseIndex> l) : Base(l) { } -#endif explicit DSizes(const array<DenseIndex, NumDims>& a) : Base(a) { } DSizes& operator = (const array<DenseIndex, NumDims>& other) { @@ -203,7 +200,6 @@ struct DSizes : array<DenseIndex, NumDims> { size_t IndexOfRowMajor(const array<DenseIndex, NumDims>& indices) const { return internal::tensor_index_linearization_helper<DenseIndex, NumDims, NumDims - 1, true>::run(indices, *static_cast<const Base*>(this)); } - }; |