8#include <gtest/gtest.h>
10#include "arccore/base/ForLoopRanges.h"
13#include "arccore/common/SequentialFor.h"
14#include "arccore/common/Array.h"
15#include "arccore/common/NumArray.h"
22template <
typename IndexType_>
27 using IndexType = IndexType_;
33 IndexType nb_dim1 = 20;
37 sum_array2.
resize(nb_dim1);
38 IndexType ref_sum = {};
39 IndexType numarray_index = {};
43 sum_array2[numarray_index] = i;
49 for (IndexType x : sum_array) {
53 for (IndexType x : sum_array2) {
56 ASSERT_EQ(ref_sum,sum2);
60TEST(SequentialFor, Misc)
63 int32_tester.doTest();
66 int64_tester.doTest();
69 size_t_tester.doTest();
Types and functions associated with the MDSpan class.
void add(ConstReferenceType val)
Adds element val to the end of the array.
Multi-dimensional arrays for numerical types accessible on accelerators.
void resize(ExtentIndexType dim1_size)
Resizes the array without keeping current values.
1D data vector with value semantics (STL style).
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
void arccoreSequentialFor(LoopBoundType< 1, IndexType > bounds, Lambda func, RemainingArgs... remaining_args)
Applies the functor func over a 1D loop.