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) <<
"Difference values v1=" << val1 <<
" v2=" << val2;
49 ASSERT_TRUE(val1 == global_index) <<
"Bad value v1=" << val1 <<
" expected=" << 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) <<
"Difference values v1=" << val1 <<
" v2=" << val2;
82 ASSERT_TRUE(val1 == global_index) <<
"Bad value v1=" << val1 <<
" expected=" << 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) <<
"Difference values v1=" << val1 <<
" v2=" << val2;
118 ASSERT_TRUE(val1 == global_index) <<
"Bad value v1=" << val1 <<
" expected=" << 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) <<
"Bad a_view size";
196 ASSERT_EQ(a_view[0], vector_values[0]) <<
"Bad a_view[0]";
197 ASSERT_EQ(a_view[1], vector_values[1]) <<
"Bad a_view[1]";
198 ASSERT_EQ(a_view[2], vector_values[2]) <<
"Bad a_view[2]";
201 ASSERT_EQ(a_const_view.size(), vector_size) <<
"Bad a_const_view size";
202 ASSERT_EQ(a_const_view[0], vector_values[0]) <<
"Bad a_const_view[0]";
203 ASSERT_EQ(a_const_view[1], vector_values[1]) <<
"Bad a_const_view[1]";
204 ASSERT_EQ(a_const_view[2], vector_values[2]) <<
"Bad a_const_view[2]";
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) <<
"Bad a_const_bytes_size (1)";
213 ASSERT_EQ(a_const_bytes2.size(), 24) <<
"Bad a_const_bytes2_size (1)";
214 ASSERT_EQ(a_bytes.size(), 24) <<
"Bad a_bytes_size (2)";
218 ASSERT_EQ(span2.size(), a_view.size()) <<
"Bad span2 size";
219 ASSERT_EQ(span3.size(), a_view.size()) <<
"Bad span3 size";
220 ASSERT_EQ(span4.size(), a_const_view.size()) <<
"Bad span4 size";
221 span3 = a_const_view;
224 ASSERT_EQ(span2.size(), a_view.size()) <<
"Bad span2 (2) size";
225 ASSERT_EQ(span3.size(), a_view.size()) <<
"Bad span3 (2) size";
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) <<
"Bad size " << message;
243 for (size_type i = 0, n = a1.size(); i < n; ++i)
244 ASSERT_EQ(a1[i], a2[i]) <<
"Bad value[" << 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) <<
"Bad size " << message;
259 const Int64 s1_dim2 = a1.dim2Size();
260 const Int64 s2_dim2 = a2.dim2Size();
261 ASSERT_EQ(s1_dim2, s2_dim2) <<
"Bad size " << 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]) <<
"Bad value[" << 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);
444 std::array<Real, 3> v2r{ 2.0, 4.1, -2.3 };
446 LargeSpan<const std::byte> small_fb2(
asBytes(small2));
465template <
typename SpanType,
typename ConstSpanType>
void
470 std::array<Int64, 6> v1{ 5, 7, 9, 32, -5, -6 };
471 std::array<Int64, 5> v2{ 1, 9, 32, 41, -5 };
472 std::array<const Int64, 12> v3{ 12, 33, 47, 55, 36, 13, 9, 7, 5, 1, 45, 38 };
475 SpanType s1{ v1.data(), 3, 2 };
476 SpanType s2{ v2.data(), 1, 5 };
477 ConstSpanType s3{ v3.data(), 4, 3 };
479 ASSERT_EQ(s1[2][1], s1(2, 1));
481#ifdef ARCCORE_HAS_MULTI_SUBSCRIPT
483 bool is_ok = s1[2, 1] == s1(2, 1);
489 SpanType span0{ s0 };
490 _checkSame2(span0, s0,
"span0==s0");
492 SpanType span1{ s1 };
493 _checkSame2(span1, s1,
"span1==s1");
495 SpanType span2{ s1 };
499 SpanType const_span2{ s1 };
505 ConstSpanType span0{ s0 };
506 _checkSame2(span0, s0,
"const span0==s0");
508 ConstSpanType span1{ s1 };
509 _checkSame2(span1, s1,
"const span1==s1");
512 _checkSame2(span0, s2,
"const span0==s2");
514 ConstSpanType span2{ s3 };
515 _checkSame2(span2, s3,
"const span2==s3");
517 ConstSpanType span3{ s3 };
522 _checkSame2(span1, s3,
"const span1==s3");
547template <
typename ViewType>
void
548_testSubViewInterval()
552 std::array<Int64, 12> vlist{ 9, 13, 32, 27, 43, -5, 2, -7, 8, 11, 25, 48 };
553 ViewType view{ vlist };
557 ViewType sub_view0{ view.subViewInterval(1, 0) };
558 ViewType sub_view1{ view.subViewInterval(-1, 2) };
559 ViewType sub_view2{ view.subViewInterval(2, 2) };
560 ViewType sub_view3{ view.subViewInterval(0, 0) };
561 std::cout <<
"SUBVIEW0=" << sub_view1 <<
'\n';
562 _checkSame(sub_view0, null_view,
"sub_view0_null");
563 _checkSame(sub_view1, null_view,
"sub_view1_null");
564 _checkSame(sub_view2, null_view,
"sub_view2_null");
565 _checkSame(sub_view3, null_view,
"sub_view3_null");
569 std::array<Int64, 4> vlist0{ 9, 13, 32, 27 };
570 std::array<Int64, 4> vlist1{ 43, -5, 2, -7 };
571 std::array<Int64, 4> vlist2{ 8, 11, 25, 48 };
573 ViewType sub_view0{ view.subViewInterval(0, 3) };
574 ViewType sub_view1{ view.subViewInterval(1, 3) };
575 ViewType sub_view2{ view.subViewInterval(2, 3) };
576 std::cout <<
"SUBVIEW1=" << sub_view1 <<
'\n';
577 _checkSame(sub_view0, vlist0,
"sub_view0");
578 _checkSame(sub_view1, vlist1,
"sub_view1");
579 _checkSame(sub_view2, vlist2,
"sub_view2");
583 std::array<Int64, 2> vlist0{ 9, 13 };
584 std::array<Int64, 2> vlist1{ 32, 27 };
585 std::array<Int64, 2> vlist2{ 43, -5 };
586 std::array<Int64, 2> vlist3{ 2, -7 };
587 std::array<Int64, 4> vlist4{ 8, 11, 25, 48 };
589 ViewType sub_view0{ view.subViewInterval(0, 5) };
590 ViewType sub_view1{ view.subViewInterval(1, 5) };
591 ViewType sub_view2{ view.subViewInterval(2, 5) };
592 ViewType sub_view3{ view.subViewInterval(3, 5) };
593 ViewType sub_view4{ view.subViewInterval(4, 5) };
594 std::cout <<
"SUBVIEW2=" << sub_view1 <<
'\n';
595 _checkSame(sub_view0, vlist0,
"sub_view0");
596 _checkSame(sub_view1, vlist1,
"sub_view1");
597 _checkSame(sub_view2, vlist2,
"sub_view2");
598 _checkSame(sub_view3, vlist3,
"sub_view3");
599 _checkSame(sub_view4, vlist4,
"sub_view4");
606template <
typename ViewType>
void
607_testSubSpanInterval()
611 std::array<Int64, 12> vlist{ 9, 13, 32, 27, 43, -5, 2, -7, 8, 11, 25, 48 };
612 ViewType view{ vlist };
616 ViewType sub_view0{ view.subSpanInterval(1, 0) };
617 ViewType sub_view1{ view.subSpanInterval(-1, 2) };
618 ViewType sub_view2{ view.subSpanInterval(2, 2) };
619 ViewType sub_view3{ view.subSpanInterval(0, 0) };
620 std::cout <<
"SUBVIEW0=" << sub_view1 <<
'\n';
621 _checkSame(sub_view0, null_view,
"sub_view0_null");
622 _checkSame(sub_view1, null_view,
"sub_view1_null");
623 _checkSame(sub_view2, null_view,
"sub_view2_null");
624 _checkSame(sub_view3, null_view,
"sub_view3_null");
628 std::array<Int64, 4> vlist0{ 9, 13, 32, 27 };
629 std::array<Int64, 4> vlist1{ 43, -5, 2, -7 };
630 std::array<Int64, 4> vlist2{ 8, 11, 25, 48 };
632 ViewType sub_view0{ view.subSpanInterval(0, 3) };
633 ViewType sub_view1{ view.subSpanInterval(1, 3) };
634 ViewType sub_view2{ view.subSpanInterval(2, 3) };
635 std::cout <<
"SUBVIEW1=" << sub_view1 <<
'\n';
636 _checkSame(sub_view0, vlist0,
"sub_view0");
637 _checkSame(sub_view1, vlist1,
"sub_view1");
638 _checkSame(sub_view2, vlist2,
"sub_view2");
642 std::array<Int64, 2> vlist0{ 9, 13 };
643 std::array<Int64, 2> vlist1{ 32, 27 };
644 std::array<Int64, 2> vlist2{ 43, -5 };
645 std::array<Int64, 2> vlist3{ 2, -7 };
646 std::array<Int64, 4> vlist4{ 8, 11, 25, 48 };
648 ViewType sub_view0{ view.subSpanInterval(0, 5) };
649 ViewType sub_view1{ view.subSpanInterval(1, 5) };
650 ViewType sub_view2{ view.subSpanInterval(2, 5) };
651 ViewType sub_view3{ view.subSpanInterval(3, 5) };
652 ViewType sub_view4{ view.subSpanInterval(4, 5) };
653 std::cout <<
"SUBVIEW2=" << sub_view1 <<
'\n';
654 _checkSame(sub_view0, vlist0,
"sub_view0");
655 _checkSame(sub_view1, vlist1,
"sub_view1");
656 _checkSame(sub_view2, vlist2,
"sub_view2");
657 _checkSame(sub_view3, vlist3,
"sub_view3");
658 _checkSame(sub_view4, vlist4,
"sub_view4");
665template <
typename ViewType>
void
666_testSubPartInterval()
670 std::array<Int64, 12> vlist{ 9, 13, 32, 27, 43, -5, 2, -7, 8, 11, 25, 48 };
671 ViewType view{ vlist };
675 ViewType sub_view0{ view.subPartInterval(1, 0) };
676 ViewType sub_view1{ view.subPartInterval(-1, 2) };
677 ViewType sub_view2{ view.subPartInterval(2, 2) };
678 ViewType sub_view3{ view.subPartInterval(0, 0) };
679 std::cout <<
"SUBVIEW0=" << sub_view1 <<
'\n';
680 _checkSame(sub_view0, null_view,
"sub_view0_null");
681 _checkSame(sub_view1, null_view,
"sub_view1_null");
682 _checkSame(sub_view2, null_view,
"sub_view2_null");
683 _checkSame(sub_view3, null_view,
"sub_view3_null");
687 std::array<Int64, 4> vlist0{ 9, 13, 32, 27 };
688 std::array<Int64, 4> vlist1{ 43, -5, 2, -7 };
689 std::array<Int64, 4> vlist2{ 8, 11, 25, 48 };
691 ViewType sub_view0{ view.subPartInterval(0, 3) };
692 ViewType sub_view1{ view.subPartInterval(1, 3) };
693 ViewType sub_view2{ view.subPartInterval(2, 3) };
694 std::cout <<
"SUBVIEW1=" << sub_view1 <<
'\n';
695 _checkSame(sub_view0, vlist0,
"sub_view0");
696 _checkSame(sub_view1, vlist1,
"sub_view1");
697 _checkSame(sub_view2, vlist2,
"sub_view2");
701 std::array<Int64, 2> vlist0{ 9, 13 };
702 std::array<Int64, 2> vlist1{ 32, 27 };
703 std::array<Int64, 2> vlist2{ 43, -5 };
704 std::array<Int64, 2> vlist3{ 2, -7 };
705 std::array<Int64, 4> vlist4{ 8, 11, 25, 48 };
707 ViewType sub_view0{ view.subPartInterval(0, 5) };
708 ViewType sub_view1{ view.subPartInterval(1, 5) };
709 ViewType sub_view2{ view.subPartInterval(2, 5) };
710 ViewType sub_view3{ view.subPartInterval(3, 5) };
711 ViewType sub_view4{ view.subPartInterval(4, 5) };
712 std::cout <<
"SUBVIEW2=" << sub_view1 <<
'\n';
713 _checkSame(sub_view0, vlist0,
"sub_view0");
714 _checkSame(sub_view1, vlist1,
"sub_view1");
715 _checkSame(sub_view2, vlist2,
"sub_view2");
716 _checkSame(sub_view3, vlist3,
"sub_view3");
717 _checkSame(sub_view4, vlist4,
"sub_view4");
727 _testSubViewInterval<ArrayView<Int64>>();
728 _testSubViewInterval<ConstArrayView<Int64>>();
729 _testSubSpanInterval<Span<Int64>>();
730 _testSubSpanInterval<SmallSpan<Int64>>();
732 _testSubPartInterval<ArrayView<Int64>>();
733 _testSubPartInterval<ConstArrayView<Int64>>();
734 _testSubPartInterval<Span<Int64>>();
735 _testSubPartInterval<SmallSpan<Int64>>();
760TEST(
Span, FixedValue)
763 std::cout <<
"sizeof(Span<Int32,1>) = " <<
sizeof(
Span<Int32, 1>) <<
"\n";
765 std::cout <<
"sizeof(Span<Int64,1>) = " <<
sizeof(
Span<Int64, 1>) <<
"\n";
773 std::array<Int64, 12> vlist{ 9, 13, 32, 27, 43, -5, 2, -7, 8, 11, 25, 48 };
775 Int32 sub_view_size = 5;
777 ASSERT_EQ(sub_view1.
size(), sub_view_size);
780 ASSERT_EQ(fixed_span_only_ptr.data(), vlist.data());
782 ASSERT_EQ(fixed_span_only_const_ptr.data(), vlist.data());
788 Int32 v1[4] = { 1, 3, -5, 2 };
791 ASSERT_EQ(mdspan1.
extent0(),0);
794 ASSERT_EQ(mdspan1.
extent0(),4);
795 ASSERT_EQ(mdspan1.
data(),v1);
796 ASSERT_EQ(mdspan1[0],1);
797 ASSERT_EQ(mdspan1[1],3);
798 ASSERT_EQ(mdspan1[2],-5);
799 ASSERT_EQ(mdspan1[3],2);
802 ASSERT_EQ(const_mdspan1.data(), mdspan1.
data());
803 ASSERT_EQ(const_mdspan1.extent0(), mdspan1.
extent0());
810 ASSERT_EQ(mdspan2.data(), mdspan1.
data());
811 ASSERT_EQ(mdspan2.extent0(), mdspan1.
extent0());
814 ASSERT_EQ(const_mdspan2.data(), mdspan1.
data());
815 ASSERT_EQ(const_mdspan2.extent0(), mdspan1.
extent0());
817 mdspan2 = arrayview1;
818 ASSERT_EQ(mdspan2.data(), mdspan1.
data());
819 ASSERT_EQ(mdspan2.extent0(), mdspan1.
extent0());
821 const_mdspan2 = arrayview1;
822 ASSERT_EQ(const_mdspan2.data(), mdspan1.
data());
823 ASSERT_EQ(const_mdspan2.extent0(), mdspan1.
extent0());
831 ASSERT_EQ(const_mdspan2.data(), mdspan1.
data());
832 ASSERT_EQ(const_mdspan2.extent0(), mdspan1.
extent0());
834 const_mdspan2 = const_arrayview1;
835 ASSERT_EQ(const_mdspan2.data(), mdspan1.
data());
836 ASSERT_EQ(const_mdspan2.extent0(), mdspan1.
extent0());
#define ASSERT_FALSE(condition)
Checks that condition is false.
#define ASSERT_TRUE(condition)
Checks that condition is true.
Types and functions associated with the classes Span2Impl, Small2Span and Span2.
Types and functions associated with the classes SpanImpl, SmallSpan and Span.
Types and functions associated with the classes Array3View and ConstArray3View.
Types and functions associated with the classes Array4View and ConstArray4View.
Types and functions associated with the classes ArrayView and ConstArrayView.
Types and functions associated with the MDSpan class.
Mutable view for a 2D array.
Modifiable view of an array of type T.
View for a constant 2D array.
View for a constant 3D array.
Constant view for a 4D array.
Constant view of an array of type T.
Base class for multidimensional views.
constexpr DataType * data() noexcept
Base pointer for allocated memory.
constexpr ExtentIndexType extent0() const
Value of the first dimension.
View for a 2D array whose size is an 'Int32'.
View of an array of elements of type T.
View for a 2D array whose size is an 'Int64'.
constexpr __host__ __device__ SizeType size() const noexcept
Returns the size of the array.
View of an array of elements of type T.
constexpr __host__ __device__ Span< T, DynExtent > subspan(Int64 abegin, Int64 asize) const
Sub-view starting from element abegin and containing asize elements.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
constexpr __host__ __device__ Integer arccoreCheckArraySize(unsigned long long size)
Checks that size can be converted into an 'Integer' to serve as an array size. If possible,...
SmallSpan< DataType > asSmallSpan(SmallSpan< std::byte, Extent > bytes)
Converts a SmallSpan<std::byte> into a SmallSpan<DataType>.
Span< DataType > asSpan(Span< std::byte, Extent > bytes)
Converts a Span<std::byte> into a Span<DataType>.
Impl::SpanTypeFromSize< conststd::byte, SizeType >::SpanType asBytes(const SpanImpl< DataType, SizeType, Extent > &s)
Converts the view into an array of non-modifiable bytes.
Impl::SpanTypeFromSize< std::byte, SizeType >::SpanType asWritableBytes(const SpanImpl< DataType, SizeType, Extent > &s)
Converts the view into an array of modifiable bytes.