Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
VariableViews.h
Go to the documentation of this file.
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* VariableViews.h (C) 2000-2025 */
9/* */
10/* Variable view management for accelerators. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_ACCELERATOR_VARIABLEVIEWS_H
13#define ARCANE_ACCELERATOR_VARIABLEVIEWS_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
19#include "arcane/core/ItemLocalId.h"
21#include "arcane/core/GroupIndexTable.h"
22
23#include "arcane/accelerator/core/ViewBuildInfo.h"
24#include "arcane/accelerator/AcceleratorGlobal.h"
26
27/*---------------------------------------------------------------------------*/
28/*---------------------------------------------------------------------------*/
29
30/*---------------------------------------------------------------------------*/
31/*---------------------------------------------------------------------------*/
32
33// TODO: Make the views ReadWrite for SIMD accessors
34
35namespace Arcane::Accelerator
36{
37template <typename DataType> class View1DGetterSetter;
38
39/*---------------------------------------------------------------------------*/
40/*---------------------------------------------------------------------------*/
41
45class ARCANE_ACCELERATOR_EXPORT VariableViewBase
46{
47 public:
48
49 VariableViewBase(const ViewBuildInfo& command, IVariable* var);
50};
51
52/*---------------------------------------------------------------------------*/
53/*---------------------------------------------------------------------------*/
54
58template <typename DataType>
59class View1DSetter
60{
61 // For accessing m_data;
62 friend class View1DGetterSetter<DataType>;
63
64 public:
65
66 using ValueType = DataType;
67 using DataTypeReturnReference = View1DSetter<DataType>;
68 explicit ARCCORE_HOST_DEVICE View1DSetter(SmallSpan<DataType> data)
69 : m_data(data)
70 {}
71 ARCCORE_HOST_DEVICE DataViewSetter<DataType> operator[](Int32 index) const
72 {
73 return DataViewSetter<DataType>(m_data.ptrAt(index));
74 }
75 ARCCORE_HOST_DEVICE DataViewSetter<DataType> operator()(Int32 index) const
76 {
77 return DataViewSetter<DataType>(m_data.ptrAt(index));
78 }
79 DataTypeReturnReference& operator=(const View1DSetter<DataType>& rhs) = delete;
80
81 public:
82
83 ARCCORE_HOST_DEVICE void copy(SmallSpan<const DataType> rhs)
84 {
85 m_data.copy(rhs);
86 }
87
88 private:
89
91};
92
93/*---------------------------------------------------------------------------*/
94/*---------------------------------------------------------------------------*/
95
99template <typename DataType>
100class View1DGetterSetter
101: public View1DSetter<DataType>
102{
103 using View1DSetter<DataType>::m_data;
104
105 public:
106
107 using ValueType = DataType;
108 using DataTypeReturnReference = View1DGetterSetter<DataType>;
109
110 public:
111
112 explicit ARCCORE_HOST_DEVICE View1DGetterSetter(SmallSpan<DataType> data)
113 : View1DSetter<DataType>(data)
114 {}
115 DataTypeReturnReference& operator=(const View1DGetterSetter<DataType>& rhs) = delete;
116
117 public:
118
119 ARCCORE_HOST_DEVICE DataViewGetterSetter<DataType> operator[](Int32 index) const
120 {
121 return DataViewGetterSetter<DataType>(m_data.ptrAt(index));
122 }
123
124 public:
125
126 ARCCORE_HOST_DEVICE SmallSpan<DataType> value() const { return m_data; }
127 ARCCORE_HOST_DEVICE operator SmallSpan<DataType>() { return m_data; }
128 ARCCORE_HOST_DEVICE operator SmallSpan<const DataType>() const { return m_data; }
129 ARCCORE_HOST_DEVICE operator Span<DataType>() { return { m_data.data(), m_data.size() }; }
130 ARCCORE_HOST_DEVICE operator Span<const DataType>() const { return { m_data.data(), m_data.size() }; }
131};
132
133/*---------------------------------------------------------------------------*/
134/*---------------------------------------------------------------------------*/
135
139template <typename _ItemType, typename _Accessor, typename _IndexerType, bool _HasSimd>
140class ItemVariableScalarOutViewBaseT
141: public VariableViewBase
142{
143 using Accessor = _Accessor;
144
145 public:
146
147 using ItemType = _ItemType;
148 using IndexerType = _IndexerType;
149 using DataType = typename _Accessor::ValueType;
150 using DataTypeReturnReference = DataType&;
151
152 public:
153
154 ItemVariableScalarOutViewBaseT(const ViewBuildInfo& command, IVariable* var, SmallSpan<DataType> v)
155 : VariableViewBase(command, var)
156 , m_values(v.data())
157 , m_size(v.size())
158 {}
159
161 SimdSetter<DataType> operator[](SimdItemIndexT<ItemType> simd_item) const requires(_HasSimd)
162 {
163 return SimdSetter<DataType>(m_values, simd_item.simdLocalIds());
164 }
165
168 {
169 return SimdDirectSetter<DataType>(m_values + simd_item.baseLocalId());
170 }
171
173 ARCCORE_HOST_DEVICE Accessor operator[](IndexerType item) const
174 {
175 ARCANE_CHECK_AT(item.asInt32(), m_size);
176 return Accessor(this->m_values + item.asInt32());
177 }
178
180 ARCCORE_HOST_DEVICE Accessor operator()(IndexerType item) const
181 {
182 ARCANE_CHECK_AT(item.asInt32(), m_size);
183 return Accessor(this->m_values + item.asInt32());
184 }
185
187 ARCCORE_HOST_DEVICE Accessor value(IndexerType item) const
188 {
189 ARCANE_CHECK_AT(item.asInt32(), m_size);
190 return Accessor(this->m_values + item.asInt32());
191 }
192
194 ARCCORE_HOST_DEVICE void setValue(IndexerType item, const DataType& v) const
195 {
196 ARCANE_CHECK_AT(item.asInt32(), m_size);
197 this->m_values[item.asInt32()] = v;
198 }
199
200 private:
201
202 DataType* m_values;
203 Int32 m_size;
204};
205
206/*---------------------------------------------------------------------------*/
207/*---------------------------------------------------------------------------*/
208
212template <typename _ItemType, typename _Accessor>
213class ItemVariableScalarOutViewT
214: public VariableViewBase
215{
216 public:
217
218 using DataType = typename _Accessor::ValueType;
219 using Accessor = _Accessor;
220 using ItemType = _ItemType;
221 using IndexerType = typename ItemLocalIdTraitsT<_ItemType>::LocalIdType;
222 using DataTypeReturnReference = DataType&;
223
224 public:
225
226 ItemVariableScalarOutViewT(const ViewBuildInfo& command, IVariable* var, SmallSpan<DataType> v)
227 : VariableViewBase(command, var)
228 , m_values(v.data())
229 , m_size(v.size())
230 {}
231
234 {
235 return SimdSetter<DataType>(m_values, simd_item.simdLocalIds());
236 }
237
240 {
241 return SimdDirectSetter<DataType>(m_values + simd_item.baseLocalId());
242 }
243
245 ARCCORE_HOST_DEVICE Accessor operator[](IndexerType item) const
246 {
247 ARCANE_CHECK_AT(item.asInt32(), m_size);
248 return Accessor(this->m_values + item.asInt32());
249 }
250
252 ARCCORE_HOST_DEVICE Accessor operator()(IndexerType item) const
253 {
254 ARCANE_CHECK_AT(item.asInt32(), m_size);
255 return Accessor(this->m_values + item.asInt32());
256 }
257
259 ARCCORE_HOST_DEVICE Accessor value(IndexerType item) const
260 {
261 ARCANE_CHECK_AT(item.asInt32(), m_size);
262 return Accessor(this->m_values + item.asInt32());
263 }
264
266 ARCCORE_HOST_DEVICE void setValue(IndexerType item, const DataType& v) const
267 {
268 ARCANE_CHECK_AT(item.asInt32(), m_size);
269 this->m_values[item.asInt32()] = v;
270 }
271
272 private:
273
274 DataType* m_values;
275 Int32 m_size;
276};
277
278/*---------------------------------------------------------------------------*/
279/*---------------------------------------------------------------------------*/
280
284template <typename _ItemType, typename _Accessor>
285class ItemPartialVariableScalarOutViewT
286: public VariableViewBase
287{
288 public:
289
290 using DataType = typename _Accessor::ValueType;
291 using Accessor = _Accessor;
292 using ItemType = _ItemType;
293 using IndexerType = ItemEnumeratorIndexT<_ItemType>;
294 using DataTypeReturnReference = DataType&;
295 using ItemLocalIdType = typename ItemTraitsT<_ItemType>::LocalIdType;
296
297 public:
298
299 ItemPartialVariableScalarOutViewT(const ViewBuildInfo& command, IVariable* var,
301 : VariableViewBase(command, var)
302 , m_values(v.data())
303 , m_size(v.size())
304 , m_table_view(table_view)
305 {}
306
308 ARCCORE_HOST_DEVICE Accessor operator[](IndexerType item) const
309 {
310 ARCANE_CHECK_AT(item.asInt32(), m_size);
311 return Accessor(this->m_values + item.asInt32());
312 }
313
315 ARCCORE_HOST_DEVICE Accessor operator()(IndexerType item) const
316 {
317 ARCANE_CHECK_AT(item.asInt32(), m_size);
318 return Accessor(this->m_values + item.asInt32());
319 }
320
322 ARCCORE_HOST_DEVICE Accessor value(IndexerType item) const
323 {
324 ARCANE_CHECK_AT(item.asInt32(), m_size);
325 return Accessor(this->m_values + item.asInt32());
326 }
327
329 ARCCORE_HOST_DEVICE void setValue(IndexerType item, const DataType& v) const
330 {
331 ARCANE_CHECK_AT(item.asInt32(), m_size);
332 this->m_values[item.asInt32()] = v;
333 }
334
335 public:
336
338 ARCCORE_HOST_DEVICE Accessor operator[](ItemLocalIdType lid) const
339 {
340 Int32 index = _toIndex(lid);
341 ARCANE_CHECK_AT(index, m_size);
342 return Accessor(m_values + index);
343 }
344
346 ARCCORE_HOST_DEVICE Accessor operator()(ItemLocalIdType lid) const
347 {
348 Int32 index = _toIndex(lid);
349 ARCANE_CHECK_AT(index, m_size);
350 return Accessor(m_values + index);
351 }
352
354 ARCCORE_HOST_DEVICE Accessor value(ItemLocalIdType lid) const
355 {
356 Int32 index = _toIndex(lid);
357 ARCANE_CHECK_AT(index, m_size);
358 return Accessor(m_values + index);
359 }
360
362 ARCCORE_HOST_DEVICE void setValue(ItemLocalIdType lid, const DataType& v) const
363 {
364 Int32 index = _toIndex(lid);
365 ARCANE_CHECK_AT(index, m_size);
366 this->m_values[index] = v;
367 }
368
369 private:
370
371 ARCCORE_HOST_DEVICE Int32 _toIndex(ItemLocalIdType lid) const
372 {
373 return m_table_view[lid];
374 }
375
376 private:
377
378 DataType* m_values;
379 Int32 m_size;
380 GroupIndexTableView m_table_view;
381};
382
383/*---------------------------------------------------------------------------*/
384/*---------------------------------------------------------------------------*/
385
386/*---------------------------------------------------------------------------*/
387/*---------------------------------------------------------------------------*/
388
392template <typename _ItemType, typename _DataType>
393class ItemVariableScalarInViewT
394: public VariableViewBase
395{
396 public:
397
398 using ItemType = _ItemType;
399 using DataType = _DataType;
400 using IndexerType = typename ItemLocalIdTraitsT<_ItemType>::LocalIdType;
401
402 public:
403
404 ItemVariableScalarInViewT(const ViewBuildInfo& command, IVariable* var, SmallSpan<const DataType> v)
405 : VariableViewBase(command, var)
406 , m_values(v)
407 {
408 }
409
410 public:
411
413 typename SimdTypeTraits<DataType>::SimdType
415 {
416 typedef typename SimdTypeTraits<DataType>::SimdType SimdType;
417 return SimdType(m_values.data(), simd_item.simdLocalIds());
418 }
419
421 typename SimdTypeTraits<DataType>::SimdType
423 {
424 typedef typename SimdTypeTraits<DataType>::SimdType SimdType;
425 return SimdType(m_values.data() + simd_item.baseLocalId());
426 }
427
429 ARCCORE_HOST_DEVICE const DataType& operator[](IndexerType item) const
430 {
431 return this->m_values[item.asInt32()];
432 }
433
435 ARCCORE_HOST_DEVICE const DataType& operator()(IndexerType item) const
436 {
437 return this->m_values[item.asInt32()];
438 }
439
441 ARCCORE_HOST_DEVICE const DataType& value(IndexerType item) const
442 {
443 return this->m_values[item.asInt32()];
444 }
445
446 private:
447
449};
450
451/*---------------------------------------------------------------------------*/
452/*---------------------------------------------------------------------------*/
453
457template <typename _ItemType, typename _DataType>
458class ItemPartialVariableScalarInViewT
459: public VariableViewBase
460{
461 public:
462
463 using ItemType = _ItemType;
464 using DataType = _DataType;
465 using IndexerType = ItemEnumeratorIndexT<_ItemType>;
466 using ItemLocalIdType = typename ItemTraitsT<_ItemType>::LocalIdType;
467
468 public:
469
470 ItemPartialVariableScalarInViewT(const ViewBuildInfo& command, IVariable* var,
472 : VariableViewBase(command, var)
473 , m_values(v)
474 , m_table_view(table_view)
475 {}
476
477 public:
478
480 ARCCORE_HOST_DEVICE const DataType& operator[](IndexerType item) const
481 {
482 return m_values[item.asInt32()];
483 }
484
486 ARCCORE_HOST_DEVICE const DataType& operator()(IndexerType item) const
487 {
488 return m_values[item.asInt32()];
489 }
490
492 ARCCORE_HOST_DEVICE const DataType& value(IndexerType item) const
493 {
494 return m_values[item.asInt32()];
495 }
496
498 ARCCORE_HOST_DEVICE const DataType& operator[](ItemLocalIdType lid) const
499 {
500 return m_values[_toIndex(lid)];
501 }
502
504 ARCCORE_HOST_DEVICE const DataType& operator()(ItemLocalIdType lid) const
505 {
506 return m_values[_toIndex(lid)];
507 }
508
510 ARCCORE_HOST_DEVICE const DataType& value(ItemLocalIdType lid) const
511 {
512 return m_values[_toIndex(lid)];
513 }
514
515 private:
516
517 ARCCORE_HOST_DEVICE Int32 _toIndex(ItemLocalIdType lid) const
518 {
519 return m_table_view[lid];
520 }
521
522 private:
523
525 GroupIndexTableView m_table_view;
526};
527
528/*---------------------------------------------------------------------------*/
529/*---------------------------------------------------------------------------*/
530
531/*---------------------------------------------------------------------------*/
532/*---------------------------------------------------------------------------*/
533
537template <typename _ItemType, typename _DataType>
538class ItemPartialVariableArrayInViewT
539: public VariableViewBase
540{
541 public:
542
543 using ItemType = _ItemType;
544 using DataType = _DataType;
545 using IndexerType = ItemEnumeratorIndexT<_ItemType>;
546 using ItemLocalIdType = typename ItemTraitsT<_ItemType>::LocalIdType;
547
548 public:
549
550 ItemPartialVariableArrayInViewT(const ViewBuildInfo& command, IVariable* var,
552 : VariableViewBase(command, var)
553 , m_values(v)
554 , m_table_view(table_view)
555 {}
556
558 ARCCORE_HOST_DEVICE const SmallSpan<const DataType> operator[](IndexerType i) const
559 {
560 return this->m_values[i.asInt32()];
561 }
562
564 ARCCORE_HOST_DEVICE const SmallSpan<const DataType> operator[](ItemLocalIdType lid) const
565 {
566 return m_values[_toIndex(lid)];
567 }
568
570 ARCCORE_HOST_DEVICE const DataType& operator()(IndexerType item, Int32 i) const
571 {
572 return m_values[item.asInt32()][i];
573 }
574
576 ARCCORE_HOST_DEVICE const DataType& operator()(ItemLocalIdType lid, Int32 i) const
577 {
578 return m_values[_toIndex(lid)][i];
579 }
580
582 ARCCORE_HOST_DEVICE const SmallSpan<const DataType> value(IndexerType i) const
583 {
584 return m_values[i.asInt32()];
585 }
586
588 ARCCORE_HOST_DEVICE const SmallSpan<const DataType> value(ItemLocalIdType lid) const
589 {
590 return m_values[_toIndex(lid)];
591 }
592
593 protected:
594
595 ARCCORE_HOST_DEVICE Int32 _toIndex(ItemLocalIdType lid) const
596 {
597 return m_table_view[lid];
598 }
599
600 private:
601
603 GroupIndexTableView m_table_view;
604};
605
606/*---------------------------------------------------------------------------*/
607/*---------------------------------------------------------------------------*/
608
612template <typename _ItemType, typename _DataType>
613class ItemVariableArrayInViewT
614: public VariableViewBase
615{
616 private:
617
618 using IndexerType = typename ItemTraitsT<_ItemType>::LocalIdType;
619
620 public:
621
622 using DataType = _DataType;
623
624 public:
625
626 ItemVariableArrayInViewT(const ViewBuildInfo& command, IVariable* var, SmallSpan2<const DataType> v)
627 : VariableViewBase(command, var)
628 , m_values(v)
629 {}
630
631 public:
632
634 ARCCORE_HOST_DEVICE const SmallSpan<const DataType> operator[](IndexerType i) const
635 {
636 return this->m_values[i.asInt32()];
637 }
638
640 ARCCORE_HOST_DEVICE const DataType& operator()(IndexerType item, Int32 i) const
641 {
642 return this->m_values[item.asInt32()][i];
643 }
644
646 ARCCORE_HOST_DEVICE const SmallSpan<const DataType> value(IndexerType i) const
647 {
648 return this->m_values[i.asInt32()];
649 }
650
651 private:
652
654};
655
656/*---------------------------------------------------------------------------*/
657/*---------------------------------------------------------------------------*/
658
659/*---------------------------------------------------------------------------*/
660/*---------------------------------------------------------------------------*/
661
665template <typename _ItemType, typename _Accessor, typename _Indexer>
666class ItemVariableArrayOutViewBaseT
667: public VariableViewBase
668{
669 private:
670
671 using ItemType = _ItemType;
672 using Accessor = _Accessor;
673 using IndexerType = _Indexer;
674 using DataType = typename Accessor::ValueType;
675 using DataTypeReturnType = typename Accessor::DataTypeReturnReference;
676
677 public:
678
679 ItemVariableArrayOutViewBaseT(const ViewBuildInfo& command, IVariable* var, SmallSpan2<DataType> v)
680 : VariableViewBase(command, var)
681 , m_values(v)
682 {}
683
685 ARCCORE_HOST_DEVICE DataTypeReturnType operator[](IndexerType item) const
686 {
687 return DataTypeReturnType(this->m_values[item.asInt32()]);
688 }
689
691 ARCCORE_HOST_DEVICE DataType& operator()(IndexerType item, Int32 i) const
692 {
693 return this->m_values[item.asInt32()][i];
694 }
695
697 ARCCORE_HOST_DEVICE SmallSpan<DataType> value(IndexerType item) const
698 {
699 return DataTypeReturnType(this->m_values[item.asInt32()]);
700 }
701
702 private:
703
704 SmallSpan2<DataType> m_values;
705};
706
707/*---------------------------------------------------------------------------*/
708/*---------------------------------------------------------------------------*/
709
713template <typename _ItemType, typename _Accessor>
714class ItemVariableArrayOutViewT
715: public VariableViewBase
716{
717 public:
718
719 using ItemType = _ItemType;
720 using Accessor = _Accessor;
721 using IndexerType = typename ItemTraitsT<_ItemType>::LocalIdType;
722 using DataType = typename Accessor::ValueType;
723 using DataTypeReturnType = typename Accessor::DataTypeReturnReference;
724
725 public:
726
727 ItemVariableArrayOutViewT(const ViewBuildInfo& command, IVariable* var, SmallSpan2<DataType> v)
728 : VariableViewBase(command, var)
729 , m_values(v)
730 {}
731
733 ARCCORE_HOST_DEVICE DataTypeReturnType operator[](IndexerType item) const
734 {
735 return DataTypeReturnType(this->m_values[item.asInt32()]);
736 }
737
739 ARCCORE_HOST_DEVICE DataType& operator()(IndexerType item, Int32 i) const
740 {
741 return this->m_values[item.asInt32()][i];
742 }
743
745 ARCCORE_HOST_DEVICE SmallSpan<DataType> value(IndexerType item) const
746 {
747 return DataTypeReturnType(this->m_values[item.asInt32()]);
748 }
749
750 private:
751
752 SmallSpan2<DataType> m_values;
753};
754
755/*---------------------------------------------------------------------------*/
756/*---------------------------------------------------------------------------*/
757
761template <typename _ItemType, typename _Accessor>
762class ItemPartialVariableArrayOutViewT
763: public VariableViewBase
764{
765 public:
766
767 using ItemType = _ItemType;
768 using Accessor = _Accessor;
769 using IndexerType = ItemEnumeratorIndexT<_ItemType>;
770 using DataType = typename Accessor::ValueType;
771 using DataTypeReturnType = typename Accessor::DataTypeReturnReference;
772 using ItemLocalIdType = typename ItemTraitsT<_ItemType>::LocalIdType;
773
774 public:
775
776 ItemPartialVariableArrayOutViewT(const ViewBuildInfo& command, IVariable* var,
778 : VariableViewBase(command, var)
779 , m_values(v)
780 , m_table_view(table_view)
781 {}
782
783 public:
784
786 ARCCORE_HOST_DEVICE DataTypeReturnType operator[](IndexerType item) const
787 {
788 return DataTypeReturnType(m_values[item.asInt32()]);
789 }
790
792 ARCCORE_HOST_DEVICE DataType& operator()(IndexerType item, Int32 i) const
793 {
794 return m_values[item.asInt32()][i];
795 }
796
798 ARCCORE_HOST_DEVICE SmallSpan<DataType> value(IndexerType item) const
799 {
800 return DataTypeReturnType(m_values[item.asInt32()]);
801 }
802
803 public:
804
806 ARCCORE_HOST_DEVICE DataTypeReturnType operator[](ItemLocalIdType lid) const
807 {
808 return DataTypeReturnType(m_values[_toIndex(lid)]);
809 }
810
812 ARCCORE_HOST_DEVICE DataType& operator()(ItemLocalIdType lid, Int32 i) const
813 {
814 return m_values[_toIndex(lid)][i];
815 }
816
818 ARCCORE_HOST_DEVICE SmallSpan<DataType> value(ItemLocalIdType lid) const
819 {
820 return DataTypeReturnType(m_values[_toIndex(lid)]);
821 }
822
823 private:
824
825 ARCCORE_HOST_DEVICE Int32 _toIndex(ItemLocalIdType lid) const
826 {
827 return m_table_view[lid];
828 }
829
830 private:
831
832 SmallSpan2<DataType> m_values;
833 GroupIndexTableView m_table_view;
834};
835
836/*---------------------------------------------------------------------------*/
837/*---------------------------------------------------------------------------*/
838
858template <typename _ItemType, typename _Accessor>
860: public VariableViewBase
861{
862 public:
863
864 using ItemType = _ItemType;
865 using Accessor = _Accessor;
866 using IndexerType = typename ItemTraitsT<_ItemType>::LocalIdType;
867 using DataType = typename _Accessor::ValueType;
868 using DataTypeReturnReference = DataType&;
869
870 public:
871
874 : VariableViewBase(command, var)
875 , m_values(v.data())
876 , m_size(v.size())
877 {}
878
881 {
882 return SimdSetter<DataType>(m_values, simd_item.simdLocalIds());
883 }
884
887 {
888 return SimdSetter<DataType>(m_values, simd_item.simdLocalIds());
889 }
890
893 {
894 return SimdDirectSetter<DataType>(m_values + simd_item.baseLocalId());
895 }
896
899 {
900 return SimdDirectSetter<DataType>(m_values + simd_item.baseLocalId());
901 }
902
904 ARCCORE_HOST_DEVICE Accessor operator[](IndexerType item) const
905 {
906 ARCANE_CHECK_AT(item.asInt32(), m_size);
907 return Accessor(m_values + item.asInt32());
908 }
909
911 ARCCORE_HOST_DEVICE Accessor operator()(IndexerType item) const
912 {
913 ARCANE_CHECK_AT(item.asInt32(), m_size);
914 return Accessor(m_values + item.asInt32());
915 }
916
918 ARCCORE_HOST_DEVICE Accessor value(IndexerType item) const
919 {
920 ARCANE_CHECK_AT(item.asInt32(), m_size);
921 return Accessor(m_values + item.asInt32());
922 }
923
925 ARCCORE_HOST_DEVICE void setValue(IndexerType item, const DataType& v) const
926 {
927 ARCANE_CHECK_AT(item.asInt32(), m_size);
928 this->m_values[item.asInt32()] = v;
929 }
930
931 private:
932
933 DataType* m_values;
934 Int32 m_size;
935};
936
937/*---------------------------------------------------------------------------*/
938/*---------------------------------------------------------------------------*/
939
940template <typename _ItemType, typename _Accessor>
942: public VariableViewBase
943{
944 public:
945
946 using ItemType = _ItemType;
947 using Accessor = _Accessor;
948 using IndexerType = ItemEnumeratorIndexT<_ItemType>;
949 using DataType = typename _Accessor::ValueType;
950 using DataTypeReturnReference = DataType&;
951 using ItemLocalIdType = typename ItemTraitsT<_ItemType>::LocalIdType;
952
953 public:
954
958 : VariableViewBase(command, var)
959 , m_values(v.data())
960 , m_size(v.size())
961 , m_table_view(table_view)
962 {}
963
964 public:
965
967 ARCCORE_HOST_DEVICE Accessor operator[](IndexerType item) const
968 {
969 ARCANE_CHECK_AT(item.asInt32(), m_size);
970 return Accessor(this->m_values + item.asInt32());
971 }
972
974 ARCCORE_HOST_DEVICE Accessor operator()(IndexerType item) const
975 {
976 ARCANE_CHECK_AT(item.asInt32(), m_size);
977 return Accessor(this->m_values + item.asInt32());
978 }
979
981 ARCCORE_HOST_DEVICE Accessor value(IndexerType item) const
982 {
983 ARCANE_CHECK_AT(item.asInt32(), m_size);
984 return Accessor(this->m_values + item.asInt32());
985 }
986
988 ARCCORE_HOST_DEVICE void setValue(IndexerType item, const DataType& v) const
989 {
990 ARCANE_CHECK_AT(item.asInt32(), m_size);
991 this->m_values[item.asInt32()] = v;
992 }
993
994 public:
995
997 ARCCORE_HOST_DEVICE Accessor operator[](ItemLocalIdType lid) const
998 {
999 Int32 index = _toIndex(lid);
1000 ARCANE_CHECK_AT(index, m_size);
1001 return Accessor(m_values + index);
1002 }
1003
1005 ARCCORE_HOST_DEVICE Accessor operator()(ItemLocalIdType lid) const
1006 {
1007 Int32 index = _toIndex(lid);
1008 ARCANE_CHECK_AT(index, m_size);
1009 return Accessor(m_values + index);
1010 }
1011
1013 ARCCORE_HOST_DEVICE Accessor value(ItemLocalIdType lid) const
1014 {
1015 Int32 index = _toIndex(lid);
1016 ARCANE_CHECK_AT(index, m_size);
1017 return Accessor(m_values + index);
1018 }
1019
1021 ARCCORE_HOST_DEVICE void setValue(ItemLocalIdType lid, const DataType& v) const
1022 {
1023 Int32 index = _toIndex(lid);
1024 ARCANE_CHECK_AT(index, m_size);
1025 m_values[index] = v;
1026 }
1027
1028 private:
1029
1030 ARCCORE_HOST_DEVICE Int32 _toIndex(ItemLocalIdType lid) const
1031 {
1032 return m_table_view[lid];
1033 }
1034
1035 private:
1036
1037 DataType* m_values = nullptr;
1038 Int32 m_size = 0;
1039 GroupIndexTableView m_table_view;
1040};
1041
1042/*---------------------------------------------------------------------------*/
1043/*---------------------------------------------------------------------------*/
1044
1045/*---------------------------------------------------------------------------*/
1046/*---------------------------------------------------------------------------*/
1047
1051template <typename DataType> auto
1053{
1054 using Accessor = DataViewSetter<DataType>;
1055 return ItemVariableScalarOutViewT<Item, Accessor>(command, var.variable(), var.asArray());
1056}
1057
1061template <typename ItemType, typename DataType> auto
1063{
1064 using Accessor = DataViewSetter<DataType>;
1065 return ItemVariableScalarOutViewT<ItemType, Accessor>(command, var.variable(), var.asArray());
1066}
1067
1071template <typename ItemType, typename DataType> auto
1073{
1074 using Accessor = DataViewSetter<DataType>;
1076 return ViewType(command, var.variable(), var.asArray(), var.tableView());
1077}
1078
1082template <typename ItemType> auto
1084{
1085 using Accessor = DataViewSetter<Real3>;
1086 return ItemVariableRealNScalarOutViewT<ItemType, Accessor>(command, var.variable(), var.asArray());
1087}
1088
1092template <typename ItemType> auto
1094{
1095 using Accessor = DataViewSetter<Real3>;
1097 return ViewType(command, var.variable(), var.asArray(), var.tableView());
1098}
1099
1103template <typename ItemType> auto
1105{
1106 using Accessor = DataViewSetter<Real2>;
1107 return ItemVariableRealNScalarOutViewT<ItemType, Accessor>(command, var.variable(), var.asArray());
1108}
1109
1113template <typename ItemType> auto
1115{
1116 using Accessor = DataViewSetter<Real2>;
1118 return ViewType(command, var.variable(), var.asArray(), var.tableView());
1119}
1120
1124template <typename ItemType, typename DataType> auto
1126{
1127 using Accessor = View1DSetter<DataType>;
1128 return ItemVariableArrayOutViewT<ItemType, Accessor>(command, var.variable(), var.asArray());
1129}
1130
1134template <typename ItemType, typename DataType> auto
1136{
1137 using Accessor = View1DSetter<DataType>;
1139 return ViewType(command, var.variable(), var.asArray(), var.tableView());
1140}
1141
1142/*---------------------------------------------------------------------------*/
1143/*---------------------------------------------------------------------------*/
1144
1148template <typename DataType> auto
1150{
1151 using Accessor = DataViewGetterSetter<DataType>;
1152 return ItemVariableScalarOutViewT<Item, Accessor>(command, var.variable(), var.asArray());
1153}
1154
1158template <typename ItemType, typename DataType> auto
1160{
1161 using Accessor = DataViewGetterSetter<DataType>;
1162 return ItemVariableScalarOutViewT<ItemType, Accessor>(command, var.variable(), var.asArray());
1163}
1164
1168template <typename ItemType, typename DataType> auto
1170{
1171 using Accessor = DataViewGetterSetter<DataType>;
1172 return ItemPartialVariableScalarOutViewT<ItemType, Accessor>(command, var.variable(), var.asArray());
1173}
1174
1178template <typename ItemType> auto
1180{
1181 using Accessor = DataViewGetterSetter<Real3>;
1182 return ItemVariableRealNScalarOutViewT<ItemType, Accessor>(command, var.variable(), var.asArray());
1183}
1184
1188template <typename ItemType> auto
1190{
1191 using Accessor = DataViewGetterSetter<Real3>;
1193 return ViewType(command, var.variable(), var.asArray(), var.tableView());
1194}
1195
1199template <typename ItemType> auto
1201{
1202 using Accessor = DataViewGetterSetter<Real2>;
1203 return ItemVariableRealNScalarOutViewT<ItemType, Accessor>(command, var.variable(), var.asArray());
1204}
1205
1209template <typename ItemType> auto
1211{
1212 using Accessor = DataViewGetterSetter<Real2>;
1214 return ViewType(command, var.variable(), var.asArray(), var.tableView());
1215}
1216
1220template <typename ItemType, typename DataType> auto
1222{
1223 using Accessor = View1DGetterSetter<DataType>;
1224 return ItemVariableArrayOutViewT<ItemType, Accessor>(command, var.variable(), var.asArray());
1225}
1226
1230template <typename ItemType, typename DataType> auto
1232{
1233 using Accessor = View1DGetterSetter<DataType>;
1235 return ViewType(command, var.variable(), var.asArray(), var.tableView());
1236}
1237
1238/*---------------------------------------------------------------------------*/
1239/*---------------------------------------------------------------------------*/
1240
1244template <typename ItemType, typename DataType> auto
1246{
1247 return ItemPartialVariableScalarInViewT<ItemType, DataType>(command, var.variable(), var.asArray(), var.tableView());
1248}
1249
1253template <typename ItemType, typename DataType> auto
1255{
1256 return ItemVariableScalarInViewT<ItemType, DataType>(command, var.variable(), var.asArray());
1257}
1258
1262template <typename DataType> auto
1264{
1265 return ItemVariableScalarInViewT<Item, DataType>(command, var.variable(), var.asArray());
1266}
1267
1271template <typename ItemType, typename DataType> auto
1273{
1274 return ItemPartialVariableArrayInViewT<ItemType, DataType>(command, var.variable(), var.asArray(), var.tableView());
1275}
1276
1280template <typename ItemType, typename DataType> auto
1282{
1283 return ItemVariableArrayInViewT<ItemType, DataType>(command, var.variable(), var.asArray());
1284}
1285
1286/*---------------------------------------------------------------------------*/
1287/*---------------------------------------------------------------------------*/
1288
1289typedef ItemVariableScalarInViewT<Node, Byte> VariableNodeByteInView;
1290typedef ItemVariableScalarInViewT<Edge, Byte> VariableEdgeByteInView;
1291typedef ItemVariableScalarInViewT<Face, Byte> VariableFaceByteInView;
1292typedef ItemVariableScalarInViewT<Cell, Byte> VariableCellByteInView;
1293typedef ItemVariableScalarInViewT<Particle, Byte> VariableParticleByteInView;
1294typedef ItemVariableScalarInViewT<DoF, Byte> VariableDoFByteInView;
1295
1296typedef ItemVariableScalarInViewT<Node, Int16> VariableNodeInt16InView;
1297typedef ItemVariableScalarInViewT<Edge, Int16> VariableEdgeInt16InView;
1298typedef ItemVariableScalarInViewT<Face, Int16> VariableFaceInt16InView;
1299typedef ItemVariableScalarInViewT<Cell, Int16> VariableCellInt16InView;
1300typedef ItemVariableScalarInViewT<Particle, Int16> VariableParticleInt16InView;
1301typedef ItemVariableScalarInViewT<DoF, Int16> VariableDoFInt16InView;
1302
1303typedef ItemVariableScalarInViewT<Node, Int32> VariableNodeInt32InView;
1304typedef ItemVariableScalarInViewT<Edge, Int32> VariableEdgeInt32InView;
1305typedef ItemVariableScalarInViewT<Face, Int32> VariableFaceInt32InView;
1306typedef ItemVariableScalarInViewT<Cell, Int32> VariableCellInt32InView;
1307typedef ItemVariableScalarInViewT<Particle, Int32> VariableParticleInt32InView;
1308typedef ItemVariableScalarInViewT<DoF, Int32> VariableDoFInt32InView;
1309
1310typedef ItemVariableScalarInViewT<Node, Int64> VariableNodeInt64InView;
1311typedef ItemVariableScalarInViewT<Edge, Int64> VariableEdgeInt64InView;
1312typedef ItemVariableScalarInViewT<Face, Int64> VariableFaceInt64InView;
1313typedef ItemVariableScalarInViewT<Cell, Int64> VariableCellInt64InView;
1314typedef ItemVariableScalarInViewT<Particle, Int64> VariableParticleInt64InView;
1315typedef ItemVariableScalarInViewT<DoF, Int64> VariableDoFInt64InView;
1316
1317typedef ItemVariableScalarInViewT<Node, Real> VariableNodeRealInView;
1318typedef ItemVariableScalarInViewT<Edge, Real> VariableEdgeRealInView;
1319typedef ItemVariableScalarInViewT<Face, Real> VariableFaceRealInView;
1320typedef ItemVariableScalarInViewT<Cell, Real> VariableCellRealInView;
1321typedef ItemVariableScalarInViewT<Particle, Real> VariableParticleRealInView;
1322typedef ItemVariableScalarInViewT<DoF, Real> VariableDoFRealInView;
1323
1324typedef ItemVariableScalarInViewT<Node, Real2> VariableNodeReal2InView;
1325typedef ItemVariableScalarInViewT<Edge, Real2> VariableEdgeReal2InView;
1326typedef ItemVariableScalarInViewT<Face, Real2> VariableFaceReal2InView;
1327typedef ItemVariableScalarInViewT<Cell, Real2> VariableCellReal2InView;
1328typedef ItemVariableScalarInViewT<Particle, Real2> VariableParticleReal2InView;
1329typedef ItemVariableScalarInViewT<DoF, Real2> VariableDoFReal2InView;
1330
1331typedef ItemVariableScalarInViewT<Node, Real3> VariableNodeReal3InView;
1332typedef ItemVariableScalarInViewT<Edge, Real3> VariableEdgeReal3InView;
1333typedef ItemVariableScalarInViewT<Face, Real3> VariableFaceReal3InView;
1334typedef ItemVariableScalarInViewT<Cell, Real3> VariableCellReal3InView;
1335typedef ItemVariableScalarInViewT<Particle, Real3> VariableParticleReal3InView;
1336typedef ItemVariableScalarInViewT<DoF, Real3> VariableDoFReal3InView;
1337
1338/*---------------------------------------------------------------------------*/
1339/*---------------------------------------------------------------------------*/
1340
1341typedef ItemVariableScalarOutViewT<Node, DataViewSetter<Byte>> VariableNodeByteOutView;
1342typedef ItemVariableScalarOutViewT<Edge, DataViewSetter<Byte>> VariableEdgeByteOutView;
1343typedef ItemVariableScalarOutViewT<Face, DataViewSetter<Byte>> VariableFaceByteOutView;
1344typedef ItemVariableScalarOutViewT<Cell, DataViewSetter<Byte>> VariableCellByteOutView;
1345typedef ItemVariableScalarOutViewT<Particle, DataViewSetter<Byte>> VariableParticleByteOutView;
1346typedef ItemVariableScalarOutViewT<DoF, DataViewSetter<Byte>> VariableDoFByteOutView;
1347
1348typedef ItemVariableScalarOutViewT<Node, DataViewSetter<Int16>> VariableNodeInt16OutView;
1349typedef ItemVariableScalarOutViewT<Edge, DataViewSetter<Int16>> VariableEdgeInt16OutView;
1350typedef ItemVariableScalarOutViewT<Face, DataViewSetter<Int16>> VariableFaceInt16OutView;
1351typedef ItemVariableScalarOutViewT<Cell, DataViewSetter<Int16>> VariableCellInt16OutView;
1352typedef ItemVariableScalarOutViewT<Particle, DataViewSetter<Int16>> VariableParticleInt16OutView;
1353typedef ItemVariableScalarOutViewT<DoF, DataViewSetter<Int16>> VariableDoFInt16OutView;
1354
1355typedef ItemVariableScalarOutViewT<Node, DataViewSetter<Int32>> VariableNodeInt32OutView;
1356typedef ItemVariableScalarOutViewT<Edge, DataViewSetter<Int32>> VariableEdgeInt32OutView;
1357typedef ItemVariableScalarOutViewT<Face, DataViewSetter<Int32>> VariableFaceInt32OutView;
1358typedef ItemVariableScalarOutViewT<Cell, DataViewSetter<Int32>> VariableCellInt32OutView;
1359typedef ItemVariableScalarOutViewT<Particle, DataViewSetter<Int32>> VariableParticleInt32OutView;
1360typedef ItemVariableScalarOutViewT<DoF, DataViewSetter<Int32>> VariableDoFInt32OutView;
1361
1362typedef ItemVariableScalarOutViewT<Node, DataViewSetter<Int64>> VariableNodeInt64OutView;
1363typedef ItemVariableScalarOutViewT<Edge, DataViewSetter<Int64>> VariableEdgeInt64OutView;
1364typedef ItemVariableScalarOutViewT<Face, DataViewSetter<Int64>> VariableFaceInt64OutView;
1365typedef ItemVariableScalarOutViewT<Cell, DataViewSetter<Int64>> VariableCellInt64OutView;
1366typedef ItemVariableScalarOutViewT<Particle, DataViewSetter<Int64>> VariableParticleInt64OutView;
1367typedef ItemVariableScalarOutViewT<DoF, DataViewSetter<Int64>> VariableDoFInt64OutView;
1368
1369typedef ItemVariableScalarOutViewT<Node, DataViewSetter<Real>> VariableNodeRealOutView;
1370typedef ItemVariableScalarOutViewT<Edge, DataViewSetter<Real>> VariableEdgeRealOutView;
1371typedef ItemVariableScalarOutViewT<Face, DataViewSetter<Real>> VariableFaceRealOutView;
1372typedef ItemVariableScalarOutViewT<Cell, DataViewSetter<Real>> VariableCellRealOutView;
1373typedef ItemVariableScalarOutViewT<Particle, DataViewSetter<Real>> VariableParticleRealOutView;
1374typedef ItemVariableScalarOutViewT<DoF, DataViewSetter<Real>> VariableDoFRealOutView;
1375
1376typedef ItemVariableRealNScalarOutViewT<Node, DataViewSetter<Real2>> VariableNodeReal2OutView;
1377typedef ItemVariableRealNScalarOutViewT<Edge, DataViewSetter<Real2>> VariableEdgeReal2OutView;
1378typedef ItemVariableRealNScalarOutViewT<Face, DataViewSetter<Real2>> VariableFaceReal2OutView;
1379typedef ItemVariableRealNScalarOutViewT<Cell, DataViewSetter<Real2>> VariableCellReal2OutView;
1380typedef ItemVariableRealNScalarOutViewT<Particle, DataViewSetter<Real2>> VariableParticleReal2OutView;
1381typedef ItemVariableRealNScalarOutViewT<DoF, DataViewSetter<Real2>> VariableDoFReal2OutView;
1382
1383typedef ItemVariableRealNScalarOutViewT<Node, DataViewSetter<Real3>> VariableNodeReal3OutView;
1384typedef ItemVariableRealNScalarOutViewT<Edge, DataViewSetter<Real3>> VariableEdgeReal3OutView;
1385typedef ItemVariableRealNScalarOutViewT<Face, DataViewSetter<Real3>> VariableFaceReal3OutView;
1386typedef ItemVariableRealNScalarOutViewT<Cell, DataViewSetter<Real3>> VariableCellReal3OutView;
1387typedef ItemVariableRealNScalarOutViewT<Particle, DataViewSetter<Real3>> VariableParticleReal3OutView;
1388typedef ItemVariableRealNScalarOutViewT<DoF, DataViewSetter<Real3>> VariableDoFReal3OutView;
1389
1390/*---------------------------------------------------------------------------*/
1391/*---------------------------------------------------------------------------*/
1392
1393} // End namespace Arcane::Accelerator
1394
1395/*---------------------------------------------------------------------------*/
1396/*---------------------------------------------------------------------------*/
1397
1398#endif
Declarations of types on entities.
Read-only view on a partial array variable of the mesh.
__host__ __device__ const DataType & operator()(IndexerType item, Int32 i) const
Access operator for the i-th value of entity item.
__host__ __device__ const SmallSpan< const DataType > operator[](IndexerType i) const
Access operator for entity item.
__host__ __device__ const SmallSpan< const DataType > operator[](ItemLocalIdType lid) const
Access operator for entity item.
__host__ __device__ const SmallSpan< const DataType > value(ItemLocalIdType lid) const
Access operator for entity item.
__host__ __device__ const DataType & operator()(ItemLocalIdType lid, Int32 i) const
Access operator for the i-th value of entity item.
__host__ __device__ const SmallSpan< const DataType > value(IndexerType i) const
Access operator for entity item.
Write-only view on a partial array variable of the mesh.
__host__ __device__ DataTypeReturnType operator[](ItemLocalIdType lid) const
Access operator for local ID entity lid.
__host__ __device__ DataTypeReturnType operator[](IndexerType item) const
Access operator for entity item.
__host__ __device__ SmallSpan< DataType > value(IndexerType item) const
Access operator for entity item.
__host__ __device__ SmallSpan< DataType > value(ItemLocalIdType lid) const
Access operator for the i-th value of entity item.
__host__ __device__ DataType & operator()(ItemLocalIdType lid, Int32 i) const
Access operator for local ID entity lid.
__host__ __device__ DataType & operator()(IndexerType item, Int32 i) const
Access operator for the i-th value of entity item.
__host__ __device__ void setValue(IndexerType item, const DataType &v) const
Sets the value for entity item at v.
__host__ __device__ Accessor operator[](IndexerType item) const
Access operator for entity item.
__host__ __device__ void setValue(ItemLocalIdType lid, const DataType &v) const
Sets the value for entity item at v.
__host__ __device__ Accessor value(ItemLocalIdType lid) const
Access operator for entity item.
__host__ __device__ Accessor operator()(ItemLocalIdType lid) const
Access operator for entity item.
__host__ __device__ Accessor operator[](ItemLocalIdType lid) const
Access operator for entity item.
ItemPartialVariableRealNScalarOutViewT(const ViewBuildInfo &command, IVariable *var, SmallSpan< DataType > v, GroupIndexTableView table_view)
Constructs the view.
__host__ __device__ Accessor operator()(IndexerType item) const
Access operator for entity item.
__host__ __device__ Accessor value(IndexerType item) const
Access operator for entity item.
Read view on a partial scalar variable of the mesh.
__host__ __device__ const DataType & operator()(ItemLocalIdType lid) const
Access operator for entity item.
__host__ __device__ const DataType & operator[](IndexerType item) const
Access operator for entity item.
__host__ __device__ const DataType & value(IndexerType item) const
Access operator for entity item.
__host__ __device__ const DataType & value(ItemLocalIdType lid) const
Access operator for entity item.
__host__ __device__ const DataType & operator[](ItemLocalIdType lid) const
Access operator for entity item.
__host__ __device__ const DataType & operator()(IndexerType item) const
Access operator for entity item.
Write view on a partial scalar variable of the mesh.
__host__ __device__ Accessor operator[](IndexerType item) const
Access operator for the entity item.
__host__ __device__ void setValue(ItemLocalIdType lid, const DataType &v) const
Positions the value for the local ID entity lid at v.
__host__ __device__ Accessor operator()(IndexerType item) const
Access operator for the entity item.
__host__ __device__ Accessor value(ItemLocalIdType lid) const
Access operator for the local ID entity lid.
__host__ __device__ Accessor value(IndexerType item) const
Access operator for the entity item.
__host__ __device__ void setValue(IndexerType item, const DataType &v) const
Positions the value for the entity item at v.
__host__ __device__ Accessor operator()(ItemLocalIdType lid) const
Access operator for the local ID entity lid.
__host__ __device__ Accessor operator[](ItemLocalIdType lid) const
Access operator for the local ID entity lid.
Read-only view on a mesh array variable.
__host__ __device__ const SmallSpan< const DataType > operator[](IndexerType i) const
Access operator for entity item.
__host__ __device__ const SmallSpan< const DataType > value(IndexerType i) const
Access operator for entity item.
__host__ __device__ const DataType & operator()(IndexerType item, Int32 i) const
Access operator for the i-th value of entity item.
__host__ __device__ DataTypeReturnType operator[](IndexerType item) const
Access operator for entity item.
__host__ __device__ SmallSpan< DataType > value(IndexerType item) const
Access operator for entity item.
__host__ __device__ DataType & operator()(IndexerType item, Int32 i) const
Access operator for the i-th value of entity item.
Write-only view on a mesh array variable.
__host__ __device__ DataTypeReturnType operator[](IndexerType item) const
Access operator for entity item.
__host__ __device__ SmallSpan< DataType > value(IndexerType item) const
Access operator for entity item.
__host__ __device__ DataType & operator()(IndexerType item, Int32 i) const
Access operator for the i-th value of entity item.
Write-only view on a scalar variable of type 'RealN' of the mesh.
ItemVariableRealNScalarOutViewT(const ViewBuildInfo &command, IVariable *var, SmallSpan< DataType > v)
Constructs the view.
SimdDirectSetter< DataType > operator()(SimdItemDirectIndexT< ItemType > simd_item) const
Vector access operator without indirection.
SimdDirectSetter< DataType > operator[](SimdItemDirectIndexT< ItemType > simd_item) const
Vector access operator without indirection.
__host__ __device__ Accessor operator()(IndexerType item) const
Access operator for entity item.
__host__ __device__ Accessor value(IndexerType item) const
Access operator for entity item.
SimdSetter< DataType > operator()(SimdItemIndexT< ItemType > simd_item) const
Vector access operator with indirection.
__host__ __device__ Accessor operator[](IndexerType item) const
Access operator for entity item.
__host__ __device__ void setValue(IndexerType item, const DataType &v) const
Positions the value for entity item at v.
SimdSetter< DataType > operator[](SimdItemIndexT< ItemType > simd_item) const
Vector access operator with indirection.
Read view on a scalar variable of the mesh.
SimdTypeTraits< DataType >::SimdType operator[](SimdItemIndexT< ItemType > simd_item) const
Vector access operator with indirection.
__host__ __device__ const DataType & operator[](IndexerType item) const
Access operator for the entity item.
__host__ __device__ const DataType & operator()(IndexerType item) const
Access operator for the entity item.
SimdTypeTraits< DataType >::SimdType operator[](SimdItemDirectIndexT< ItemType > simd_item) const
Vector access operator with indirection.
__host__ __device__ const DataType & value(IndexerType item) const
Access operator for the entity item.
__host__ __device__ void setValue(IndexerType item, const DataType &v) const
Positions the value for the entity item at v.
__host__ __device__ Accessor value(IndexerType item) const
Access operator for the entity item.
__host__ __device__ Accessor operator()(IndexerType item) const
Access operator for the entity item.
SimdSetter< DataType > operator[](SimdItemIndexT< ItemType > simd_item) const
Vector access operator with indirection.
SimdDirectSetter< DataType > operator[](SimdItemDirectIndexT< ItemType > simd_item) const
Vector access operator without indirection.
__host__ __device__ Accessor operator[](IndexerType item) const
Access operator for the entity item.
Write view on a scalar variable of the mesh.
__host__ __device__ Accessor value(IndexerType item) const
Access operator for the entity item.
SimdSetter< DataType > operator[](SimdItemIndexT< ItemType > simd_item) const
Vector access operator with indirection.
__host__ __device__ void setValue(IndexerType item, const DataType &v) const
Positions the value for the entity item at v.
__host__ __device__ Accessor operator()(IndexerType item) const
Access operator for the entity item.
__host__ __device__ Accessor operator[](IndexerType item) const
Access operator for the entity item.
SimdDirectSetter< DataType > operator[](SimdItemDirectIndexT< ItemType > simd_item) const
Vector access operator without indirection.
Class to access a 1D array of a read/write view.
Class to access a 1D array of a read/write view.
Interface of a variable.
Definition IVariable.h:40
Represents an index of an enumeration over an entity ItemType.
typename ItemTraitsT< ItemType >::LocalIdType LocalIdType
Type of the localId().
Definition ItemTypes.h:825
GroupIndexTableView tableView() const
View of the group indirection table.
GroupIndexTableView tableView() const
View of the group's redirection table.
Characteristics of mesh elements.
Definition ItemTypes.h:625
Scalar variable on a mesh entity type.
Scalar partial variable on a mesh entity type.
Scalar variable on a mesh entity type.
Array variable on a mesh entity type.
Scalar variable on a mesh entity type.
Object allowing positioning of values in a SIMD vector.
Definition SimdItem.h:400
Vector index without indirection for an entity type.
Definition SimdItem.h:214
Vector index with indirection for an entity type. TODO: store the indices in a vector register to be ...
Definition SimdItem.h:182
const SimdIndexType &ARCANE_RESTRICT simdLocalIds() const
List of local IDs of the instance entities.
Definition SimdItem.h:199
Object allowing positioning of values in a SIMD vector.
Definition SimdItem.h:361
View for a 2D array whose size is an 'Int32'.
Definition Span2.h:249
View of an array of elements of type T.
Definition Span.h:805
constexpr __host__ __device__ pointer data() const noexcept
Pointer to the start of the view.
Definition Span.h:539
constexpr __host__ __device__ SizeType size() const noexcept
Returns the size of the array.
Definition Span.h:327
View of an array of elements of type T.
Definition Span.h:635
IVariable * variable() const
Associated variable.
auto viewInOut(const ViewBuildInfo &vbi, CellMaterialVariableScalarRef< DataType > &var)
Read/write view for scalar material variables.
auto viewOut(const ViewBuildInfo &vbi, CellMaterialVariableScalarRef< DataType > &var)
Write view for scalar material variables.
auto viewIn(const ViewBuildInfo &vbi, const CellMaterialVariableScalarRef< DataType > &var)
Read view for scalar material variables.
std::int32_t Int32
Signed integer type of 32 bits.