diff options
author | 2018-09-20 18:33:54 +0200 | |
---|---|---|
committer | 2018-09-20 18:33:54 +0200 | |
commit | e04faca930c8a94dd6459c7510eaaf15590b0b64 (patch) | |
tree | 2089a69db724e9fd4f005b01e0608083e2c1e6bd /unsupported | |
parent | d37188b9c193aaf087f67e21e654f36855b88ac0 (diff) | |
parent | a0166ab6514d47bad8db2502c460953af811ea38 (diff) |
merge
Diffstat (limited to 'unsupported')
-rw-r--r-- | unsupported/Eigen/CXX11/src/util/EmulateArray.h | 4 | ||||
-rw-r--r-- | unsupported/test/cxx11_tensor_shuffling.cpp | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/unsupported/Eigen/CXX11/src/util/EmulateArray.h b/unsupported/Eigen/CXX11/src/util/EmulateArray.h index d5c000e08..39c255791 100644 --- a/unsupported/Eigen/CXX11/src/util/EmulateArray.h +++ b/unsupported/Eigen/CXX11/src/util/EmulateArray.h @@ -21,9 +21,9 @@ namespace Eigen { template <typename T, size_t n> class array { public: EIGEN_DEVICE_FUNC - EIGEN_STRONG_INLINE T& operator[] (size_t index) { return values[index]; } + EIGEN_STRONG_INLINE T& operator[] (size_t index) { eigen_internal_assert(index < size()); return values[index]; } EIGEN_DEVICE_FUNC - EIGEN_STRONG_INLINE const T& operator[] (size_t index) const { return values[index]; } + EIGEN_STRONG_INLINE const T& operator[] (size_t index) const { eigen_internal_assert(index < size()); return values[index]; } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T& at(size_t index) { eigen_assert(index < size()); return values[index]; } diff --git a/unsupported/test/cxx11_tensor_shuffling.cpp b/unsupported/test/cxx11_tensor_shuffling.cpp index 062dd1c0f..2ec85d2d4 100644 --- a/unsupported/test/cxx11_tensor_shuffling.cpp +++ b/unsupported/test/cxx11_tensor_shuffling.cpp @@ -83,10 +83,10 @@ static void test_expr_shuffling() Tensor<float, 4, DataLayout> result(5, 7, 3, 2); - array<ptrdiff_t, 4> src_slice_dim({2, 3, 1, 7}); - array<ptrdiff_t, 4> src_slice_start({0, 0, 0, 0}); - array<ptrdiff_t, 4> dst_slice_dim({1, 7, 3, 2}); - array<ptrdiff_t, 4> dst_slice_start({0, 0, 0, 0}); + array<ptrdiff_t, 4> src_slice_dim{{2, 3, 1, 7}}; + array<ptrdiff_t, 4> src_slice_start{{0, 0, 0, 0}}; + array<ptrdiff_t, 4> dst_slice_dim{{1, 7, 3, 2}}; + array<ptrdiff_t, 4> dst_slice_start{{0, 0, 0, 0}}; for (int i = 0; i < 5; ++i) { result.slice(dst_slice_start, dst_slice_dim) = |