7#include <gtest/gtest.h>
28 std::vector<Int32> buf(nb_x * nb_y);
29 for (
size_t i = 0, n = buf.size(); i < n; ++i)
30 buf[i] = (Int32)(i + 1);
34 ASSERT_EQ(v0.data(), buf.data());
35 ASSERT_EQ(const_v0.data(), v0.data());
37 ASSERT_EQ(v0.unguardedBasePointer(), buf.data());
38 ASSERT_EQ(const_v0.unguardedBasePointer(), v0.data());
42 for (
Integer x = 0, xn = v.dim1Size(); x < xn; ++x) {
43 for (
Integer y = 0, yn = v.dim2Size(); y < yn; ++y) {
46 Int32 val2 = v.item(x, y);
47 std::cout <<
" V=" << val1 <<
" x=" << x <<
" y=" << y;
48 ASSERT_TRUE(val1 == val2) <<
"Différence des valeurs v1=" << val1 <<
" v2=" << val2;
49 ASSERT_TRUE(val1 == global_index) <<
"Mauvaise valeur v1=" << val1 <<
" attendue=" << global_index;
50 ASSERT_EQ(v(x, y), val1);
51#ifdef ARCCORE_HAS_MULTI_SUBSCRIPT
52 bool is_ok = v[x, y] == val1;
68 std::vector<Int32> buf(nb_x * nb_y * nb_z);
69 for (
size_t i = 0, n = buf.size(); i < n; ++i)
70 buf[i] = (Int32)(i + 1);
74 for (
Integer x = 0, xn = v.dim1Size(); x < xn; ++x) {
75 for (
Integer y = 0, yn = v.dim2Size(); y < yn; ++y) {
76 for (
Integer z = 0, zn = v.dim3Size(); z < zn; ++z) {
78 Int32 val1 = v[x][y][z];
79 Int32 val2 = v.item(x, y, z);
80 std::cout <<
" V=" << val1 <<
" x=" << x <<
" y=" << y <<
" z=" << z <<
'\n';
81 ASSERT_TRUE(val1 == val2) <<
"Différence des valeurs v1=" << val1 <<
" v2=" << val2;
82 ASSERT_TRUE(val1 == global_index) <<
"Mauvaise valeur v1=" << val1 <<
" attendue=" << global_index;
83 ASSERT_EQ(v(x, y, z), val1);
84#ifdef ARCCORE_HAS_MULTI_SUBSCRIPT
85 bool is_ok = v[x, y, z] == val1;
103 std::vector<Int32> buf(nb_x * nb_y * nb_z * nb_a);
104 for (
size_t i = 0, n = buf.size(); i < n; ++i)
105 buf[i] = (Int32)(i + 1);
109 for (
Integer x = 0, xn = v.dim1Size(); x < xn; ++x) {
110 for (
Integer y = 0, yn = v.dim2Size(); y < yn; ++y) {
111 for (
Integer z = 0, zn = v.dim3Size(); z < zn; ++z) {
112 for (
Integer a = 0, an = v.dim4Size(); a < an; ++a) {
114 Int32 val1 = v[x][y][z][a];
115 Int32 val2 = v.item(x, y, z, a);
116 std::cout <<
" V=" << val1 <<
" x=" << x <<
" y=" << y <<
" z=" << z <<
" a=" << a <<
'\n';
117 ASSERT_TRUE(val1 == val2) <<
"Différence des valeurs v1=" << val1 <<
" v2=" << val2;
118 ASSERT_TRUE(val1 == global_index) <<
"Mauvaise valeur v1=" << val1 <<
" attendue=" << global_index;
119 ASSERT_EQ(v(x, y, z, a), val1);
120#ifdef ARCCORE_HAS_MULTI_SUBSCRIPT
121 bool is_ok = v[x, y, z, a] == val1;
135template <
typename T>
void
136_testIterator(T values)
139 auto r1 = std::make_reverse_iterator(values.end());
140 auto r2 = std::make_reverse_iterator(values.begin());
141 for (; r1 != r2; ++r1) {
142 std::cout <<
"RVALUE = " << *r1 <<
'\n';
146 auto r1 = values.rbegin();
163 std::vector<Arccore::Int32> vector_values = { 4, 9, 7 };
167 _testIterator(values1);
170 _testIterator(values2);
172 Span<Int32> values3(vector_values.data(), vector_values.size());
173 _testIterator(values3);
176 _testIterator(values4);
181 static_assert(std::random_access_iterator<ArrayView<Int32>::iterator>);
182 static_assert(std::random_access_iterator<ArrayView<Int32>::const_iterator>);
183 std::sort(values1.begin(),values1.end());
192 std::vector<Int64> vector_values = { 5, 7, 11 };
193 Int32 vector_size =
static_cast<Int32
>(vector_values.size());
195 ASSERT_EQ(a_view.size(), vector_size) <<
"Taille incorrecte de a_view";
196 ASSERT_EQ(a_view[0], vector_values[0]) <<
"a_view[0] incorrect";
197 ASSERT_EQ(a_view[1], vector_values[1]) <<
"a_view[1] incorrect";
198 ASSERT_EQ(a_view[2], vector_values[2]) <<
"a_view[2] incorrect";
201 ASSERT_EQ(a_const_view.size(), vector_size) <<
"Taille incorrecte de a_const_view";
202 ASSERT_EQ(a_const_view[0], vector_values[0]) <<
"a_const_view[0] incorrect";
203 ASSERT_EQ(a_const_view[1], vector_values[1]) <<
"a_const_view[1] incorrect";
204 ASSERT_EQ(a_const_view[2], vector_values[2]) <<
"a_const_view[2] incorrect";
207 Span<Int64> a_span(vector_values.data(), vector_values.size());
208 ByteConstSpan a_const_bytes =
asBytes(a_const_span);
210 ByteConstSpan a_const_bytes2 =
asBytes(a_span);
212 ASSERT_EQ(a_const_bytes.size(), 24) <<
"Taille incorrecte de a_const_bytes (1)";
213 ASSERT_EQ(a_const_bytes2.size(), 24) <<
"Taille incorrecte de a_const_bytes2 (1)";
214 ASSERT_EQ(a_bytes.size(), 24) <<
"Taille incorrecte de a_bytes (2)";
218 ASSERT_EQ(span2.size(), a_view.size()) <<
"Taille incorrecte de span2";
219 ASSERT_EQ(span3.size(), a_view.size()) <<
"Taille incorrecte de span3";
220 ASSERT_EQ(span4.size(), a_const_view.size()) <<
"Taille incorrecte de span4";
221 span3 = a_const_view;
224 ASSERT_EQ(span2.size(), a_view.size()) <<
"Taille incorrecte de span2 (2)";
225 ASSERT_EQ(span3.size(), a_view.size()) <<
"Taille incorrecte de span3 (2)";
226 std::cout <<
"View=" << a_view <<
'\n';
227 std::cout <<
"ConstView=" << a_const_view <<
'\n';
228 std::cout <<
"Span3=" << span3 <<
'\n';
235template <
typename A1,
typename A2>
236void _checkSame(A1& a1, A2& a2,
const char* message)
239 using size_type =
typename A1::size_type;
240 Int64 s1 = a1.size();
241 Int64 s2 = a2.size();
242 ASSERT_EQ(s1, s2) <<
"Taille incorrecte " << message;
243 for (size_type i = 0, n = a1.size(); i < n; ++i)
244 ASSERT_EQ(a1[i], a2[i]) <<
"Valeur incorrecte[" << i <<
"]" << message;
251template <
typename A1,
typename A2>
252void _checkSame2(A1& a1, A2& a2,
const char* message)
255 using size_type =
typename A1::size_type;
256 const Int64 s1_dim1 = a1.dim1Size();
257 const Int64 s2_dim1 = a2.dim1Size();
258 ASSERT_EQ(s1_dim1, s2_dim1) <<
"Taille incorrecte " << message;
259 const Int64 s1_dim2 = a1.dim2Size();
260 const Int64 s2_dim2 = a2.dim2Size();
261 ASSERT_EQ(s1_dim2, s2_dim2) <<
"Taille incorrecte " << message;
262 for (size_type i = 0; i < s1_dim1; ++i)
263 for (size_type j = 0; j < s1_dim2; ++j)
264 ASSERT_EQ(a1[i][j], a2[i][j]) <<
"Valeur incorrecte[" << i <<
',' << j <<
"]" << message;
273 std::array<Int64, 0> v0;
274 std::array<Int64, 2> v1{ 5, 7 };
275 std::array<Int64, 3> v2{ 2, 4, -2 };
276 std::array<const Int64, 4> v3{ 9, 13, 32, 27 };
280 _checkSame(view0, v0,
"view0==v0");
283 _checkSame(view1, v1,
"view1==v1");
286 _checkSame(view0, v2,
"view0==v2");
291 _checkSame(view0, v0,
"const view0==v0");
294 _checkSame(view1, v1,
"const view1==v1");
297 _checkSame(view0, v2,
"const view0==v2");
300 _checkSame(view2, v3,
"const view2==v3");
303 _checkSame(view1, v3,
"const view1==v3");
310template <
typename SpanType,
typename ConstSpanType>
void
314 std::array<Int64, 0> v0;
315 std::array<Int64, 2> v1{ 5, 7 };
316 std::array<Int64, 3> v2{ 2, 4, -2 };
317 std::array<const Int64, 4> v3{ 9, 13, 32, 27 };
320 SpanType span0{ v0 };
321 _checkSame(span0, v0,
"span0==v0");
323 SpanType span1{ v1 };
324 _checkSame(span1, v1,
"span1==v1");
326 SpanType span2{ v1 };
330 SpanType const_span2{ v1 };
335 _checkSame(span0, v2,
"span0==v2");
339 ConstSpanType span0{ v0 };
340 _checkSame(span0, v0,
"const span0==v0");
342 ConstSpanType span1{ v1 };
343 _checkSame(span1, v1,
"const span1==v1");
346 _checkSame(span0, v2,
"const span0==v2");
348 ConstSpanType span2{ v3 };
349 _checkSame(span2, v3,
"const span2==v3");
351 ConstSpanType span3{ v3 };
356 _checkSame(span1, v3,
"const span1==v3");
359 SpanType span1{ v1 };
360 ConstSpanType const_span1{ v1 };
363 SpanType span2{ v2 };
364 ConstSpanType const_span3{ v3 };
377 std::array<Int64, 0> v0;
378 std::array<Int64, 2> v1{ 5, 7 };
379 std::array<Int64, 3> v2{ 2, 4, -2 };
381 _checkSame(s0, v0,
"s0==v0");
383 _checkSame(s1, v1,
"s1==v1");
385 _checkSame(s2, v2,
"s2==v2");
388 _checkSame(sp0, v0,
"s0==v0");
390 _checkSame(sp1, v1,
"s1==v1");
392 _checkSame(sp2, v2,
"s2==v2");
398 ASSERT_EQ(x.data(),
nullptr);
399 ASSERT_EQ(x.size(), 0);
405 ASSERT_EQ(x.data(),
nullptr);
406 ASSERT_EQ(x.size(), 0);
412 _checkSame(x, v1,
"x==v1");
418 _checkSame(x, v2,
"x==v2");
426 _checkSame(x, v2,
"x==v2");
432 std::array<Int64, 2> v1{ 5, 7 };
433 std::array<Int64, 3> v2{ 2, 4, -2 };
439 LargeSpan<const Int64> s1_a(s1);
443 std::array<Real, 3> v2r{ 2.0, 4.1, -2.3 };
445 LargeSpan<const std::byte> small_fb2(
asBytes(small2));
464template <
typename SpanType,
typename ConstSpanType>
void
469 std::array<Int64, 6> v1{ 5, 7, 9, 32, -5, -6 };
470 std::array<Int64, 5> v2{ 1, 9, 32, 41, -5 };
471 std::array<const Int64, 12> v3{ 12, 33, 47, 55, 36, 13, 9, 7, 5, 1, 45, 38 };
474 SpanType s1{ v1.data(), 3, 2 };
475 SpanType s2{ v2.data(), 1, 5 };
476 ConstSpanType s3{ v3.data(), 4, 3 };
478 ASSERT_EQ(s1[2][1], s1(2, 1));
480#ifdef ARCCORE_HAS_MULTI_SUBSCRIPT
482 bool is_ok = s1[2, 1] == s1(2, 1);
488 SpanType span0{ s0 };
489 _checkSame2(span0, s0,
"span0==s0");
491 SpanType span1{ s1 };
492 _checkSame2(span1, s1,
"span1==s1");
494 SpanType span2{ s1 };
498 SpanType const_span2{ s1 };
504 ConstSpanType span0{ s0 };
505 _checkSame2(span0, s0,
"const span0==s0");
507 ConstSpanType span1{ s1 };
508 _checkSame2(span1, s1,
"const span1==s1");
511 _checkSame2(span0, s2,
"const span0==s2");
513 ConstSpanType span2{ s3 };
514 _checkSame2(span2, s3,
"const span2==s3");
516 ConstSpanType span3{ s3 };
521 _checkSame2(span1, s3,
"const span1==s3");
546template <
typename ViewType>
void
547_testSubViewInterval()
551 std::array<Int64, 12> vlist{ 9, 13, 32, 27, 43, -5, 2, -7, 8, 11, 25, 48 };
552 ViewType view{ vlist };
556 ViewType sub_view0{ view.subViewInterval(1, 0) };
557 ViewType sub_view1{ view.subViewInterval(-1, 2) };
558 ViewType sub_view2{ view.subViewInterval(2, 2) };
559 ViewType sub_view3{ view.subViewInterval(0, 0) };
560 std::cout <<
"SUBVIEW0=" << sub_view1 <<
'\n';
561 _checkSame(sub_view0, null_view,
"sub_view0_null");
562 _checkSame(sub_view1, null_view,
"sub_view1_null");
563 _checkSame(sub_view2, null_view,
"sub_view2_null");
564 _checkSame(sub_view3, null_view,
"sub_view3_null");
568 std::array<Int64, 4> vlist0{ 9, 13, 32, 27 };
569 std::array<Int64, 4> vlist1{ 43, -5, 2, -7 };
570 std::array<Int64, 4> vlist2{ 8, 11, 25, 48 };
572 ViewType sub_view0{ view.subViewInterval(0, 3) };
573 ViewType sub_view1{ view.subViewInterval(1, 3) };
574 ViewType sub_view2{ view.subViewInterval(2, 3) };
575 std::cout <<
"SUBVIEW1=" << sub_view1 <<
'\n';
576 _checkSame(sub_view0, vlist0,
"sub_view0");
577 _checkSame(sub_view1, vlist1,
"sub_view1");
578 _checkSame(sub_view2, vlist2,
"sub_view2");
582 std::array<Int64, 2> vlist0{ 9, 13 };
583 std::array<Int64, 2> vlist1{ 32, 27 };
584 std::array<Int64, 2> vlist2{ 43, -5 };
585 std::array<Int64, 2> vlist3{ 2, -7 };
586 std::array<Int64, 4> vlist4{ 8, 11, 25, 48 };
588 ViewType sub_view0{ view.subViewInterval(0, 5) };
589 ViewType sub_view1{ view.subViewInterval(1, 5) };
590 ViewType sub_view2{ view.subViewInterval(2, 5) };
591 ViewType sub_view3{ view.subViewInterval(3, 5) };
592 ViewType sub_view4{ view.subViewInterval(4, 5) };
593 std::cout <<
"SUBVIEW2=" << sub_view1 <<
'\n';
594 _checkSame(sub_view0, vlist0,
"sub_view0");
595 _checkSame(sub_view1, vlist1,
"sub_view1");
596 _checkSame(sub_view2, vlist2,
"sub_view2");
597 _checkSame(sub_view3, vlist3,
"sub_view3");
598 _checkSame(sub_view4, vlist4,
"sub_view4");
605template <
typename ViewType>
void
606_testSubSpanInterval()
610 std::array<Int64, 12> vlist{ 9, 13, 32, 27, 43, -5, 2, -7, 8, 11, 25, 48 };
611 ViewType view{ vlist };
615 ViewType sub_view0{ view.subSpanInterval(1, 0) };
616 ViewType sub_view1{ view.subSpanInterval(-1, 2) };
617 ViewType sub_view2{ view.subSpanInterval(2, 2) };
618 ViewType sub_view3{ view.subSpanInterval(0, 0) };
619 std::cout <<
"SUBVIEW0=" << sub_view1 <<
'\n';
620 _checkSame(sub_view0, null_view,
"sub_view0_null");
621 _checkSame(sub_view1, null_view,
"sub_view1_null");
622 _checkSame(sub_view2, null_view,
"sub_view2_null");
623 _checkSame(sub_view3, null_view,
"sub_view3_null");
627 std::array<Int64, 4> vlist0{ 9, 13, 32, 27 };
628 std::array<Int64, 4> vlist1{ 43, -5, 2, -7 };
629 std::array<Int64, 4> vlist2{ 8, 11, 25, 48 };
631 ViewType sub_view0{ view.subSpanInterval(0, 3) };
632 ViewType sub_view1{ view.subSpanInterval(1, 3) };
633 ViewType sub_view2{ view.subSpanInterval(2, 3) };
634 std::cout <<
"SUBVIEW1=" << sub_view1 <<
'\n';
635 _checkSame(sub_view0, vlist0,
"sub_view0");
636 _checkSame(sub_view1, vlist1,
"sub_view1");
637 _checkSame(sub_view2, vlist2,
"sub_view2");
641 std::array<Int64, 2> vlist0{ 9, 13 };
642 std::array<Int64, 2> vlist1{ 32, 27 };
643 std::array<Int64, 2> vlist2{ 43, -5 };
644 std::array<Int64, 2> vlist3{ 2, -7 };
645 std::array<Int64, 4> vlist4{ 8, 11, 25, 48 };
647 ViewType sub_view0{ view.subSpanInterval(0, 5) };
648 ViewType sub_view1{ view.subSpanInterval(1, 5) };
649 ViewType sub_view2{ view.subSpanInterval(2, 5) };
650 ViewType sub_view3{ view.subSpanInterval(3, 5) };
651 ViewType sub_view4{ view.subSpanInterval(4, 5) };
652 std::cout <<
"SUBVIEW2=" << sub_view1 <<
'\n';
653 _checkSame(sub_view0, vlist0,
"sub_view0");
654 _checkSame(sub_view1, vlist1,
"sub_view1");
655 _checkSame(sub_view2, vlist2,
"sub_view2");
656 _checkSame(sub_view3, vlist3,
"sub_view3");
657 _checkSame(sub_view4, vlist4,
"sub_view4");
664template <
typename ViewType>
void
665_testSubPartInterval()
669 std::array<Int64, 12> vlist{ 9, 13, 32, 27, 43, -5, 2, -7, 8, 11, 25, 48 };
670 ViewType view{ vlist };
674 ViewType sub_view0{ view.subPartInterval(1, 0) };
675 ViewType sub_view1{ view.subPartInterval(-1, 2) };
676 ViewType sub_view2{ view.subPartInterval(2, 2) };
677 ViewType sub_view3{ view.subPartInterval(0, 0) };
678 std::cout <<
"SUBVIEW0=" << sub_view1 <<
'\n';
679 _checkSame(sub_view0, null_view,
"sub_view0_null");
680 _checkSame(sub_view1, null_view,
"sub_view1_null");
681 _checkSame(sub_view2, null_view,
"sub_view2_null");
682 _checkSame(sub_view3, null_view,
"sub_view3_null");
686 std::array<Int64, 4> vlist0{ 9, 13, 32, 27 };
687 std::array<Int64, 4> vlist1{ 43, -5, 2, -7 };
688 std::array<Int64, 4> vlist2{ 8, 11, 25, 48 };
690 ViewType sub_view0{ view.subPartInterval(0, 3) };
691 ViewType sub_view1{ view.subPartInterval(1, 3) };
692 ViewType sub_view2{ view.subPartInterval(2, 3) };
693 std::cout <<
"SUBVIEW1=" << sub_view1 <<
'\n';
694 _checkSame(sub_view0, vlist0,
"sub_view0");
695 _checkSame(sub_view1, vlist1,
"sub_view1");
696 _checkSame(sub_view2, vlist2,
"sub_view2");
700 std::array<Int64, 2> vlist0{ 9, 13 };
701 std::array<Int64, 2> vlist1{ 32, 27 };
702 std::array<Int64, 2> vlist2{ 43, -5 };
703 std::array<Int64, 2> vlist3{ 2, -7 };
704 std::array<Int64, 4> vlist4{ 8, 11, 25, 48 };
706 ViewType sub_view0{ view.subPartInterval(0, 5) };
707 ViewType sub_view1{ view.subPartInterval(1, 5) };
708 ViewType sub_view2{ view.subPartInterval(2, 5) };
709 ViewType sub_view3{ view.subPartInterval(3, 5) };
710 ViewType sub_view4{ view.subPartInterval(4, 5) };
711 std::cout <<
"SUBVIEW2=" << sub_view1 <<
'\n';
712 _checkSame(sub_view0, vlist0,
"sub_view0");
713 _checkSame(sub_view1, vlist1,
"sub_view1");
714 _checkSame(sub_view2, vlist2,
"sub_view2");
715 _checkSame(sub_view3, vlist3,
"sub_view3");
716 _checkSame(sub_view4, vlist4,
"sub_view4");
726 _testSubViewInterval<ArrayView<Int64>>();
727 _testSubViewInterval<ConstArrayView<Int64>>();
728 _testSubSpanInterval<Span<Int64>>();
729 _testSubSpanInterval<SmallSpan<Int64>>();
731 _testSubPartInterval<ArrayView<Int64>>();
732 _testSubPartInterval<ConstArrayView<Int64>>();
733 _testSubPartInterval<Span<Int64>>();
734 _testSubPartInterval<SmallSpan<Int64>>();
759TEST(
Span, FixedValue)
762 std::cout <<
"sizeof(Span<Int32,1>) = " <<
sizeof(
Span<Int32, 1>) <<
"\n";
764 std::cout <<
"sizeof(Span<Int64,1>) = " <<
sizeof(
Span<Int64, 1>) <<
"\n";
772 std::array<Int64, 12> vlist{ 9, 13, 32, 27, 43, -5, 2, -7, 8, 11, 25, 48 };
774 Int32 sub_view_size = 5;
776 ASSERT_EQ(sub_view1.
size(), sub_view_size);
779 ASSERT_EQ(fixed_span_only_ptr.data(), vlist.data());
781 ASSERT_EQ(fixed_span_only_const_ptr.data(), vlist.data());
787 Int32 v1[4] = { 1, 3, -5, 2 };
790 ASSERT_EQ(mdspan1.
extent0(),0);
793 ASSERT_EQ(mdspan1.
extent0(),4);
794 ASSERT_EQ(mdspan1.
data(),v1);
795 ASSERT_EQ(mdspan1[0],1);
796 ASSERT_EQ(mdspan1[1],3);
797 ASSERT_EQ(mdspan1[2],-5);
798 ASSERT_EQ(mdspan1[3],2);
801 ASSERT_EQ(const_mdspan1.data(), mdspan1.
data());
802 ASSERT_EQ(const_mdspan1.extent0(), mdspan1.
extent0());
809 ASSERT_EQ(mdspan2.data(), mdspan1.
data());
810 ASSERT_EQ(mdspan2.extent0(), mdspan1.
extent0());
813 ASSERT_EQ(const_mdspan2.data(), mdspan1.
data());
814 ASSERT_EQ(const_mdspan2.extent0(), mdspan1.
extent0());
816 mdspan2 = arrayview1;
817 ASSERT_EQ(mdspan2.data(), mdspan1.
data());
818 ASSERT_EQ(mdspan2.extent0(), mdspan1.
extent0());
820 const_mdspan2 = arrayview1;
821 ASSERT_EQ(const_mdspan2.data(), mdspan1.
data());
822 ASSERT_EQ(const_mdspan2.extent0(), mdspan1.
extent0());
830 ASSERT_EQ(const_mdspan2.data(), mdspan1.
data());
831 ASSERT_EQ(const_mdspan2.extent0(), mdspan1.
extent0());
833 const_mdspan2 = const_arrayview1;
834 ASSERT_EQ(const_mdspan2.data(), mdspan1.
data());
835 ASSERT_EQ(const_mdspan2.extent0(), mdspan1.
extent0());
#define ASSERT_FALSE(condition)
Vérifie que condition est faux.
#define ASSERT_TRUE(condition)
Vérifie que condition est vrai.
Types et fonctions associés aux classes Span2Impl, Small2Span et Span2.
Types et fonctions associés aux classes SpanImpl, SmallSpan et Span.
Types et fonctions associés aux classes Array3View et ConstArray3View.
Types et fonctions associés aux classes Array4View et ConstArray4View.
Types et fonctions associés aux classes ArrayView et ConstArrayView.
Types et fonctions associés à la classe MDSpan.
Vue modifiable pour un tableau 2D.
Vue modifiable d'un tableau d'un type T.
Vue pour un tableau 2D constant.
Vue pour un tableau 3D constant.
Vue constante pour un tableau 4D.
Vue constante d'un tableau de type T.
Classe de base des vues multi-dimensionnelles.
constexpr DataType * data() noexcept
Pointeur de base pour la mémoire allouée.
constexpr ExtentIndexType extent0() const
Valeur de la première dimension.
Vue pour un tableau 2D dont la taille est un 'Int32'.
Vue d'un tableau d'éléments de type T.
Vue pour un tableau 2D dont la taille est un 'Int64'.
constexpr __host__ __device__ SizeType size() const noexcept
Retourne la taille du tableau.
Vue d'un tableau d'éléments de type T.
constexpr __host__ __device__ Span< T, DynExtent > subspan(Int64 abegin, Int64 asize) const
Sous-vue à partir de l'élément abegin et contenant asize éléments.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type représentant un entier.
Espace de nom de Arccore.
constexpr __host__ __device__ Integer arccoreCheckArraySize(unsigned long long size)
Vérifie que size peut être converti dans un 'Integer' pour servir de taille à un tableau....
SmallSpan< DataType > asSmallSpan(SmallSpan< std::byte, Extent > bytes)
Convertit un SmallSpan<std::byte> en un SmallSpan<DataType>.
Span< DataType > asSpan(Span< std::byte, Extent > bytes)
Convertit un Span<std::byte> en un Span<DataType>.
Impl::SpanTypeFromSize< conststd::byte, SizeType >::SpanType asBytes(const SpanImpl< DataType, SizeType, Extent > &s)
Convertit la vue en un tableau d'octets non modifiables.
Impl::SpanTypeFromSize< std::byte, SizeType >::SpanType asWritableBytes(const SpanImpl< DataType, SizeType, Extent > &s)
Convertit la vue en un tableau d'octets modifiables.