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 for (
Integer x = 0, xn = v.dim1Size(); x < xn; ++x) {
35 for (
Integer y = 0, yn = v.dim2Size(); y < yn; ++y) {
38 Int32 val2 = v.item(x, y);
39 std::cout <<
" V=" << val1 <<
" x=" << x <<
" y=" << y;
40 ASSERT_TRUE(val1 == val2) <<
"Difference values v1=" << val1 <<
" v2=" << val2;
41 ASSERT_TRUE(val1 == global_index) <<
"Bad value v1=" << val1 <<
" expected=" << global_index;
42 ASSERT_EQ(v(x, y), val1);
43#ifdef ARCCORE_HAS_MULTI_SUBSCRIPT
44 bool is_ok = v[x, y] == val1;
60 std::vector<Int32> buf(nb_x * nb_y * nb_z);
61 for (
size_t i = 0, n = buf.size(); i < n; ++i)
62 buf[i] = (Int32)(i + 1);
66 for (
Integer x = 0, xn = v.dim1Size(); x < xn; ++x) {
67 for (
Integer y = 0, yn = v.dim2Size(); y < yn; ++y) {
68 for (
Integer z = 0, zn = v.dim3Size(); z < zn; ++z) {
70 Int32 val1 = v[x][y][z];
71 Int32 val2 = v.item(x, y, z);
72 std::cout <<
" V=" << val1 <<
" x=" << x <<
" y=" << y <<
" z=" << z <<
'\n';
73 ASSERT_TRUE(val1 == val2) <<
"Difference values v1=" << val1 <<
" v2=" << val2;
74 ASSERT_TRUE(val1 == global_index) <<
"Bad value v1=" << val1 <<
" expected=" << global_index;
75 ASSERT_EQ(v(x, y, z), val1);
76#ifdef ARCCORE_HAS_MULTI_SUBSCRIPT
77 bool is_ok = v[x, y, z] == val1;
95 std::vector<Int32> buf(nb_x * nb_y * nb_z * nb_a);
96 for (
size_t i = 0, n = buf.size(); i < n; ++i)
97 buf[i] = (Int32)(i + 1);
101 for (
Integer x = 0, xn = v.dim1Size(); x < xn; ++x) {
102 for (
Integer y = 0, yn = v.dim2Size(); y < yn; ++y) {
103 for (
Integer z = 0, zn = v.dim3Size(); z < zn; ++z) {
104 for (
Integer a = 0, an = v.dim4Size(); a < an; ++a) {
106 Int32 val1 = v[x][y][z][a];
107 Int32 val2 = v.item(x, y, z, a);
108 std::cout <<
" V=" << val1 <<
" x=" << x <<
" y=" << y <<
" z=" << z <<
" a=" << a <<
'\n';
109 ASSERT_TRUE(val1 == val2) <<
"Difference values v1=" << val1 <<
" v2=" << val2;
110 ASSERT_TRUE(val1 == global_index) <<
"Bad value v1=" << val1 <<
" expected=" << global_index;
111 ASSERT_EQ(v(x, y, z, a), val1);
112#ifdef ARCCORE_HAS_MULTI_SUBSCRIPT
113 bool is_ok = v[x, y, z, a] == val1;
127template <
typename T>
void
128_testIterator(T values)
131 auto r1 = std::make_reverse_iterator(values.end());
132 auto r2 = std::make_reverse_iterator(values.begin());
133 for (; r1 != r2; ++r1) {
134 std::cout <<
"RVALUE = " << *r1 <<
'\n';
138 auto r1 = values.rbegin();
155 std::vector<Arccore::Int32> vector_values = { 4, 9, 7 };
159 _testIterator(values1);
162 _testIterator(values2);
164 Span<Int32> values3(vector_values.data(), vector_values.size());
165 _testIterator(values3);
168 _testIterator(values4);
173 static_assert(std::random_access_iterator<ArrayView<Int32>::iterator>);
174 static_assert(std::random_access_iterator<ArrayView<Int32>::const_iterator>);
175 std::sort(values1.begin(),values1.end());
184 std::vector<Int64> vector_values = { 5, 7, 11 };
185 Int32 vector_size =
static_cast<Int32
>(vector_values.size());
187 ASSERT_EQ(a_view.size(), vector_size) <<
"Bad a_view size";
188 ASSERT_EQ(a_view[0], vector_values[0]) <<
"Bad a_view[0]";
189 ASSERT_EQ(a_view[1], vector_values[1]) <<
"Bad a_view[1]";
190 ASSERT_EQ(a_view[2], vector_values[2]) <<
"Bad a_view[2]";
193 ASSERT_EQ(a_const_view.size(), vector_size) <<
"Bad a_const_view size";
194 ASSERT_EQ(a_const_view[0], vector_values[0]) <<
"Bad a_const_view[0]";
195 ASSERT_EQ(a_const_view[1], vector_values[1]) <<
"Bad a_const_view[1]";
196 ASSERT_EQ(a_const_view[2], vector_values[2]) <<
"Bad a_const_view[2]";
199 Span<Int64> a_span(vector_values.data(), vector_values.size());
200 ByteConstSpan a_const_bytes =
asBytes(a_const_span);
202 ByteConstSpan a_const_bytes2 =
asBytes(a_span);
204 ASSERT_EQ(a_const_bytes.size(), 24) <<
"Bad a_const_bytes_size (1)";
205 ASSERT_EQ(a_const_bytes2.size(), 24) <<
"Bad a_const_bytes2_size (1)";
206 ASSERT_EQ(a_bytes.size(), 24) <<
"Bad a_bytes_size (2)";
210 ASSERT_EQ(span2.size(), a_view.size()) <<
"Bad span2 size";
211 ASSERT_EQ(span3.size(), a_view.size()) <<
"Bad span3 size";
212 ASSERT_EQ(span4.size(), a_const_view.size()) <<
"Bad span4 size";
213 span3 = a_const_view;
216 ASSERT_EQ(span2.size(), a_view.size()) <<
"Bad span2 (2) size";
217 ASSERT_EQ(span3.size(), a_view.size()) <<
"Bad span3 (2) size";
218 std::cout <<
"View=" << a_view <<
'\n';
219 std::cout <<
"ConstView=" << a_const_view <<
'\n';
220 std::cout <<
"Span3=" << span3 <<
'\n';
227template <
typename A1,
typename A2>
228void _checkSame(A1& a1, A2& a2,
const char* message)
231 using size_type =
typename A1::size_type;
232 Int64 s1 = a1.size();
233 Int64 s2 = a2.size();
234 ASSERT_EQ(s1, s2) <<
"Bad size " << message;
235 for (size_type i = 0, n = a1.size(); i < n; ++i)
236 ASSERT_EQ(a1[i], a2[i]) <<
"Bad value[" << i <<
"]" << message;
243template <
typename A1,
typename A2>
244void _checkSame2(A1& a1, A2& a2,
const char* message)
247 using size_type =
typename A1::size_type;
248 const Int64 s1_dim1 = a1.dim1Size();
249 const Int64 s2_dim1 = a2.dim1Size();
250 ASSERT_EQ(s1_dim1, s2_dim1) <<
"Bad size " << message;
251 const Int64 s1_dim2 = a1.dim2Size();
252 const Int64 s2_dim2 = a2.dim2Size();
253 ASSERT_EQ(s1_dim2, s2_dim2) <<
"Bad size " << message;
254 for (size_type i = 0; i < s1_dim1; ++i)
255 for (size_type j = 0; j < s1_dim2; ++j)
256 ASSERT_EQ(a1[i][j], a2[i][j]) <<
"Bad value[" << i <<
',' << j <<
"]" << message;
265 std::array<Int64, 0> v0;
266 std::array<Int64, 2> v1{ 5, 7 };
267 std::array<Int64, 3> v2{ 2, 4, -2 };
268 std::array<const Int64, 4> v3{ 9, 13, 32, 27 };
272 _checkSame(view0, v0,
"view0==v0");
275 _checkSame(view1, v1,
"view1==v1");
278 _checkSame(view0, v2,
"view0==v2");
283 _checkSame(view0, v0,
"const view0==v0");
286 _checkSame(view1, v1,
"const view1==v1");
289 _checkSame(view0, v2,
"const view0==v2");
292 _checkSame(view2, v3,
"const view2==v3");
295 _checkSame(view1, v3,
"const view1==v3");
302template <
typename SpanType,
typename ConstSpanType>
void
306 std::array<Int64, 0> v0;
307 std::array<Int64, 2> v1{ 5, 7 };
308 std::array<Int64, 3> v2{ 2, 4, -2 };
309 std::array<const Int64, 4> v3{ 9, 13, 32, 27 };
312 SpanType span0{ v0 };
313 _checkSame(span0, v0,
"span0==v0");
315 SpanType span1{ v1 };
316 _checkSame(span1, v1,
"span1==v1");
318 SpanType span2{ v1 };
322 SpanType const_span2{ v1 };
327 _checkSame(span0, v2,
"span0==v2");
331 ConstSpanType span0{ v0 };
332 _checkSame(span0, v0,
"const span0==v0");
334 ConstSpanType span1{ v1 };
335 _checkSame(span1, v1,
"const span1==v1");
338 _checkSame(span0, v2,
"const span0==v2");
340 ConstSpanType span2{ v3 };
341 _checkSame(span2, v3,
"const span2==v3");
343 ConstSpanType span3{ v3 };
348 _checkSame(span1, v3,
"const span1==v3");
351 SpanType span1{ v1 };
352 ConstSpanType const_span1{ v1 };
355 SpanType span2{ v2 };
356 ConstSpanType const_span3{ v3 };
369 std::array<Int64, 0> v0;
370 std::array<Int64, 2> v1{ 5, 7 };
371 std::array<Int64, 3> v2{ 2, 4, -2 };
373 _checkSame(s0, v0,
"s0==v0");
375 _checkSame(s1, v1,
"s1==v1");
377 _checkSame(s2, v2,
"s2==v2");
380 _checkSame(sp0, v0,
"s0==v0");
382 _checkSame(sp1, v1,
"s1==v1");
384 _checkSame(sp2, v2,
"s2==v2");
390 ASSERT_EQ(x.data(),
nullptr);
391 ASSERT_EQ(x.size(), 0);
397 ASSERT_EQ(x.data(),
nullptr);
398 ASSERT_EQ(x.size(), 0);
404 _checkSame(x, v1,
"x==v1");
410 _checkSame(x, v2,
"x==v2");
418 _checkSame(x, v2,
"x==v2");
424 std::array<Int64, 2> v1{ 5, 7 };
425 std::array<Int64, 3> v2{ 2, 4, -2 };
431 LargeSpan<const Int64> s1_a(s1);
436 std::array<Real, 3> v2r{ 2.0, 4.1, -2.3 };
438 LargeSpan<const std::byte> small_fb2(
asBytes(small2));
457template <
typename SpanType,
typename ConstSpanType>
void
462 std::array<Int64, 6> v1{ 5, 7, 9, 32, -5, -6 };
463 std::array<Int64, 5> v2{ 1, 9, 32, 41, -5 };
464 std::array<const Int64, 12> v3{ 12, 33, 47, 55, 36, 13, 9, 7, 5, 1, 45, 38 };
467 SpanType s1{ v1.data(), 3, 2 };
468 SpanType s2{ v2.data(), 1, 5 };
469 ConstSpanType s3{ v3.data(), 4, 3 };
471 ASSERT_EQ(s1[2][1], s1(2, 1));
473#ifdef ARCCORE_HAS_MULTI_SUBSCRIPT
475 bool is_ok = s1[2, 1] == s1(2, 1);
481 SpanType span0{ s0 };
482 _checkSame2(span0, s0,
"span0==s0");
484 SpanType span1{ s1 };
485 _checkSame2(span1, s1,
"span1==s1");
487 SpanType span2{ s1 };
491 SpanType const_span2{ s1 };
497 ConstSpanType span0{ s0 };
498 _checkSame2(span0, s0,
"const span0==s0");
500 ConstSpanType span1{ s1 };
501 _checkSame2(span1, s1,
"const span1==s1");
504 _checkSame2(span0, s2,
"const span0==s2");
506 ConstSpanType span2{ s3 };
507 _checkSame2(span2, s3,
"const span2==s3");
509 ConstSpanType span3{ s3 };
514 _checkSame2(span1, s3,
"const span1==s3");
539template <
typename ViewType>
void
540_testSubViewInterval()
544 std::array<Int64, 12> vlist{ 9, 13, 32, 27, 43, -5, 2, -7, 8, 11, 25, 48 };
545 ViewType view{ vlist };
549 ViewType sub_view0{ view.subViewInterval(1, 0) };
550 ViewType sub_view1{ view.subViewInterval(-1, 2) };
551 ViewType sub_view2{ view.subViewInterval(2, 2) };
552 ViewType sub_view3{ view.subViewInterval(0, 0) };
553 std::cout <<
"SUBVIEW0=" << sub_view1 <<
'\n';
554 _checkSame(sub_view0, null_view,
"sub_view0_null");
555 _checkSame(sub_view1, null_view,
"sub_view1_null");
556 _checkSame(sub_view2, null_view,
"sub_view2_null");
557 _checkSame(sub_view3, null_view,
"sub_view3_null");
561 std::array<Int64, 4> vlist0{ 9, 13, 32, 27 };
562 std::array<Int64, 4> vlist1{ 43, -5, 2, -7 };
563 std::array<Int64, 4> vlist2{ 8, 11, 25, 48 };
565 ViewType sub_view0{ view.subViewInterval(0, 3) };
566 ViewType sub_view1{ view.subViewInterval(1, 3) };
567 ViewType sub_view2{ view.subViewInterval(2, 3) };
568 std::cout <<
"SUBVIEW1=" << sub_view1 <<
'\n';
569 _checkSame(sub_view0, vlist0,
"sub_view0");
570 _checkSame(sub_view1, vlist1,
"sub_view1");
571 _checkSame(sub_view2, vlist2,
"sub_view2");
575 std::array<Int64, 2> vlist0{ 9, 13 };
576 std::array<Int64, 2> vlist1{ 32, 27 };
577 std::array<Int64, 2> vlist2{ 43, -5 };
578 std::array<Int64, 2> vlist3{ 2, -7 };
579 std::array<Int64, 4> vlist4{ 8, 11, 25, 48 };
581 ViewType sub_view0{ view.subViewInterval(0, 5) };
582 ViewType sub_view1{ view.subViewInterval(1, 5) };
583 ViewType sub_view2{ view.subViewInterval(2, 5) };
584 ViewType sub_view3{ view.subViewInterval(3, 5) };
585 ViewType sub_view4{ view.subViewInterval(4, 5) };
586 std::cout <<
"SUBVIEW2=" << sub_view1 <<
'\n';
587 _checkSame(sub_view0, vlist0,
"sub_view0");
588 _checkSame(sub_view1, vlist1,
"sub_view1");
589 _checkSame(sub_view2, vlist2,
"sub_view2");
590 _checkSame(sub_view3, vlist3,
"sub_view3");
591 _checkSame(sub_view4, vlist4,
"sub_view4");
598template <
typename ViewType>
void
599_testSubSpanInterval()
603 std::array<Int64, 12> vlist{ 9, 13, 32, 27, 43, -5, 2, -7, 8, 11, 25, 48 };
604 ViewType view{ vlist };
608 ViewType sub_view0{ view.subSpanInterval(1, 0) };
609 ViewType sub_view1{ view.subSpanInterval(-1, 2) };
610 ViewType sub_view2{ view.subSpanInterval(2, 2) };
611 ViewType sub_view3{ view.subSpanInterval(0, 0) };
612 std::cout <<
"SUBVIEW0=" << sub_view1 <<
'\n';
613 _checkSame(sub_view0, null_view,
"sub_view0_null");
614 _checkSame(sub_view1, null_view,
"sub_view1_null");
615 _checkSame(sub_view2, null_view,
"sub_view2_null");
616 _checkSame(sub_view3, null_view,
"sub_view3_null");
620 std::array<Int64, 4> vlist0{ 9, 13, 32, 27 };
621 std::array<Int64, 4> vlist1{ 43, -5, 2, -7 };
622 std::array<Int64, 4> vlist2{ 8, 11, 25, 48 };
624 ViewType sub_view0{ view.subSpanInterval(0, 3) };
625 ViewType sub_view1{ view.subSpanInterval(1, 3) };
626 ViewType sub_view2{ view.subSpanInterval(2, 3) };
627 std::cout <<
"SUBVIEW1=" << sub_view1 <<
'\n';
628 _checkSame(sub_view0, vlist0,
"sub_view0");
629 _checkSame(sub_view1, vlist1,
"sub_view1");
630 _checkSame(sub_view2, vlist2,
"sub_view2");
634 std::array<Int64, 2> vlist0{ 9, 13 };
635 std::array<Int64, 2> vlist1{ 32, 27 };
636 std::array<Int64, 2> vlist2{ 43, -5 };
637 std::array<Int64, 2> vlist3{ 2, -7 };
638 std::array<Int64, 4> vlist4{ 8, 11, 25, 48 };
640 ViewType sub_view0{ view.subSpanInterval(0, 5) };
641 ViewType sub_view1{ view.subSpanInterval(1, 5) };
642 ViewType sub_view2{ view.subSpanInterval(2, 5) };
643 ViewType sub_view3{ view.subSpanInterval(3, 5) };
644 ViewType sub_view4{ view.subSpanInterval(4, 5) };
645 std::cout <<
"SUBVIEW2=" << sub_view1 <<
'\n';
646 _checkSame(sub_view0, vlist0,
"sub_view0");
647 _checkSame(sub_view1, vlist1,
"sub_view1");
648 _checkSame(sub_view2, vlist2,
"sub_view2");
649 _checkSame(sub_view3, vlist3,
"sub_view3");
650 _checkSame(sub_view4, vlist4,
"sub_view4");
657template <
typename ViewType>
void
658_testSubPartInterval()
662 std::array<Int64, 12> vlist{ 9, 13, 32, 27, 43, -5, 2, -7, 8, 11, 25, 48 };
663 ViewType view{ vlist };
667 ViewType sub_view0{ view.subPartInterval(1, 0) };
668 ViewType sub_view1{ view.subPartInterval(-1, 2) };
669 ViewType sub_view2{ view.subPartInterval(2, 2) };
670 ViewType sub_view3{ view.subPartInterval(0, 0) };
671 std::cout <<
"SUBVIEW0=" << sub_view1 <<
'\n';
672 _checkSame(sub_view0, null_view,
"sub_view0_null");
673 _checkSame(sub_view1, null_view,
"sub_view1_null");
674 _checkSame(sub_view2, null_view,
"sub_view2_null");
675 _checkSame(sub_view3, null_view,
"sub_view3_null");
679 std::array<Int64, 4> vlist0{ 9, 13, 32, 27 };
680 std::array<Int64, 4> vlist1{ 43, -5, 2, -7 };
681 std::array<Int64, 4> vlist2{ 8, 11, 25, 48 };
683 ViewType sub_view0{ view.subPartInterval(0, 3) };
684 ViewType sub_view1{ view.subPartInterval(1, 3) };
685 ViewType sub_view2{ view.subPartInterval(2, 3) };
686 std::cout <<
"SUBVIEW1=" << sub_view1 <<
'\n';
687 _checkSame(sub_view0, vlist0,
"sub_view0");
688 _checkSame(sub_view1, vlist1,
"sub_view1");
689 _checkSame(sub_view2, vlist2,
"sub_view2");
693 std::array<Int64, 2> vlist0{ 9, 13 };
694 std::array<Int64, 2> vlist1{ 32, 27 };
695 std::array<Int64, 2> vlist2{ 43, -5 };
696 std::array<Int64, 2> vlist3{ 2, -7 };
697 std::array<Int64, 4> vlist4{ 8, 11, 25, 48 };
699 ViewType sub_view0{ view.subPartInterval(0, 5) };
700 ViewType sub_view1{ view.subPartInterval(1, 5) };
701 ViewType sub_view2{ view.subPartInterval(2, 5) };
702 ViewType sub_view3{ view.subPartInterval(3, 5) };
703 ViewType sub_view4{ view.subPartInterval(4, 5) };
704 std::cout <<
"SUBVIEW2=" << sub_view1 <<
'\n';
705 _checkSame(sub_view0, vlist0,
"sub_view0");
706 _checkSame(sub_view1, vlist1,
"sub_view1");
707 _checkSame(sub_view2, vlist2,
"sub_view2");
708 _checkSame(sub_view3, vlist3,
"sub_view3");
709 _checkSame(sub_view4, vlist4,
"sub_view4");
719 _testSubViewInterval<ArrayView<Int64>>();
720 _testSubViewInterval<ConstArrayView<Int64>>();
721 _testSubSpanInterval<Span<Int64>>();
722 _testSubSpanInterval<SmallSpan<Int64>>();
724 _testSubPartInterval<ArrayView<Int64>>();
725 _testSubPartInterval<ConstArrayView<Int64>>();
726 _testSubPartInterval<Span<Int64>>();
727 _testSubPartInterval<SmallSpan<Int64>>();
752TEST(
Span, FixedValue)
755 std::cout <<
"sizeof(Span<Int32,1>) = " <<
sizeof(
Span<Int32, 1>) <<
"\n";
757 std::cout <<
"sizeof(Span<Int64,1>) = " <<
sizeof(
Span<Int64, 1>) <<
"\n";
765 std::array<Int64, 12> vlist{ 9, 13, 32, 27, 43, -5, 2, -7, 8, 11, 25, 48 };
767 Int32 sub_view_size = 5;
769 ASSERT_EQ(sub_view1.
size(), sub_view_size);
772 ASSERT_EQ(fixed_span_only_ptr.data(), vlist.data());
774 ASSERT_EQ(fixed_span_only_const_ptr.data(), vlist.data());
780 Int32 v1[4] = { 1, 3, -5, 2 };
783 ASSERT_EQ(mdspan1.
extent0(),0);
786 ASSERT_EQ(mdspan1.
extent0(),4);
787 ASSERT_EQ(mdspan1.
data(),v1);
788 ASSERT_EQ(mdspan1[0],1);
789 ASSERT_EQ(mdspan1[1],3);
790 ASSERT_EQ(mdspan1[2],-5);
791 ASSERT_EQ(mdspan1[3],2);
794 ASSERT_EQ(const_mdspan1.data(), mdspan1.
data());
795 ASSERT_EQ(const_mdspan1.extent0(), mdspan1.
extent0());
802 ASSERT_EQ(mdspan2.data(), mdspan1.
data());
803 ASSERT_EQ(mdspan2.extent0(), mdspan1.
extent0());
806 ASSERT_EQ(const_mdspan2.data(), mdspan1.
data());
807 ASSERT_EQ(const_mdspan2.extent0(), mdspan1.
extent0());
809 mdspan2 = arrayview1;
810 ASSERT_EQ(mdspan2.data(), mdspan1.
data());
811 ASSERT_EQ(mdspan2.extent0(), mdspan1.
extent0());
813 const_mdspan2 = arrayview1;
814 ASSERT_EQ(const_mdspan2.data(), mdspan1.
data());
815 ASSERT_EQ(const_mdspan2.extent0(), mdspan1.
extent0());
823 ASSERT_EQ(const_mdspan2.data(), mdspan1.
data());
824 ASSERT_EQ(const_mdspan2.extent0(), mdspan1.
extent0());
826 const_mdspan2 = const_arrayview1;
827 ASSERT_EQ(const_mdspan2.data(), mdspan1.
data());
828 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.