TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
TRUSTArray.h
1/****************************************************************************
2* Copyright (c) 2026, CEA
3* All rights reserved.
4*
5* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9*
10* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
11* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
12* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13*
14*****************************************************************************/
15
16#ifndef TRUSTArray_included
17#define TRUSTArray_included
18
19#include <Array_base.h>
20#include <TVAlloc.h> // Custom allocator
21#include <Double.h>
22#include <span.hpp>
23#include <memory>
24#include <climits>
25#include <vector>
26#include <TRUSTTabs_forward.h>
27
28#include <Device.h>
29
30//Booleans for checking if an execution space is host or device
31#ifndef LATATOOLS
32
33#include <View_Types.h> // Kokkos stuff
34//When compiled on CPU, DefaultExecutionSpace=DefaultHostExecutionSpace = serial or OpenMP
35//When compiled on GPU, DefaultExecutionSpace=Cuda, DefaultHostExecutionSpace=serial or OpenMP
36
37//Checking if ExecSpace is Kokkos::DefaultExecutionSpace
38//GPU compiled: True if Exec=Device
39//CPU compiled: Always true
40template <typename EXEC_SPACE >
41constexpr bool is_default_exec_space = std::is_same<EXEC_SPACE, Kokkos::DefaultExecutionSpace>::value;
42
43//Checking if GPU enabled, and if so, checking if ExecSpace is Kokkos::DefaultExecutionSpace
44//GPU compiled: true is Exec=Host
45//CPU compiled: Always false
46template <typename EXEC_SPACE >
47constexpr bool gpu_enabled_is_host_exec_space = std::is_same<EXEC_SPACE, Kokkos::DefaultHostExecutionSpace>::value &&
48 !std::is_same<Kokkos::DefaultHostExecutionSpace, Kokkos::DefaultExecutionSpace>::value;
49#endif
50
51/*! @brief Represents a an array of int/int64/double/... values.
52 *
53 * The two main members are mem_ and span_:
54 * - 'mem_' is the (shared) pointer to the actual underlying data. The block of data itself is a std::vector. This
55 * block of data can be shared among several arrays (see below) or can be null if we reference external data (ref_data)
56 * - 'span_' is a view on the actual data, and can point to a sub-part of *mem_.
57 *
58 * We can have 3 states for the array:
59 * - "detached": meaning mem_==nullptr, span_.empty() == true (state obtained with the default ctor and detach_array())
60 * - "normal" : in this case mem_ is a non-null shared pointer to a std::vector holding the data. 'span_' then typically represents the entire span of the vector.
61 * The array is always initialised with 0.
62 * When the array is destroyed, the shared_ptr 'mem_' is destroyed too, and if this was the last reference to the underlying data, the std::vector itself
63 * is freed.
64 * The memory space of the array can be shared among several TRUSTArray ('mem_' has the same underlying value in several instances).
65 * This is typically produced by ref_array().
66 * Note that when this happens, we have two instances pointing to the same underlying block of data, but *none* of them has precedence over the other one (none
67 * of them is 'the' owner of the data). Ownership is shared, and when the last owner is destroyed, memory is released.
68 * - "ref_data" : this is used to point to an exterior existing memory zone (not managed by TRUSTArray - for example data provided by an external Fortran func)
69 * In this case, mem_ remains nullptr, just the span_ is correctly filled, and no memory is released when the array is destroyed.
70 *
71 * Finally, in case of a "XXTrav" array, the memory allocation is special:
72 * - a Trav array is allocated once, but when released, memory is kept in a pool so that another request for a new Trav might re-use it without having
73 * to perform the allocation again.
74 * - a Trav may not be ref_data or ref_array.
75 * - see implementation details of this mechanism in the TRUSTTravPool class.
76 *
77 * In the template parameters below, _TYPE_ is the value type (what it contains), _SIZE_ is the extent type (how many items).
78 */
79template <typename _TYPE_, typename _SIZE_>
80class TRUSTArray : public Array_base
81{
82protected:
83 unsigned taille_memoire() const override { return sizeof(TRUSTArray<_TYPE_, _SIZE_>); }
84
85 int duplique() const override
86 {
87 TRUSTArray* xxx = new TRUSTArray(*this);
88 if(!xxx) Process::exit("Not enough memory ");
89 return xxx->numero();
90 }
91 Sortie& printOn(Sortie& os) const override;
92 Entree& readOn(Entree& is) override;
93
94 //From TRUSTTab.h; now here
95 int nb_dim_ = 1;
96
97public:
98 using Value_type_ = _TYPE_;
99 using int_t = _SIZE_;
100 using Iterator_ = typename tcb::span<_TYPE_>::iterator;
101 using Vector_ = std::vector<_TYPE_, TVAlloc<_TYPE_> >;
102 using Span_ = tcb::span<_TYPE_>;
103
104 // Tests can inspect whatever they want:
105 friend class TRUSTArrayKokkos;
106
107 // One instanciation with given template parameter may see all other template versions (useful in ref_as_big())
108 template<typename _TYPE2_, typename _SIZE2_> friend class TRUSTArray;
109
110 // Iterators
111 inline Iterator_ begin() { return span_.begin(); }
112 inline Iterator_ end() { return span_.end(); }
113 inline const Iterator_ begin() const { return span_.begin(); }
114 inline const Iterator_ end() const { return span_.end(); }
115
116 inline virtual ~TRUSTArray();
117
119
120 TRUSTArray(_SIZE_ n) : storage_type_(STORAGE::STANDARD)
121 {
122 if (n)
123 {
124 // Initialize underlying std::vector<> with 0:
125 mem_ = std::make_shared<Vector_>(Vector_(n, (_TYPE_)0));
126 span_ = Span_(*mem_);
127 data_location_ = std::make_shared<DataLocation>(DataLocation::HostOnly);
128 }
129 }
130
131 /**
132 * Copy ctor. Performs a deep copy.
133 *
134 * It is forbidden to deep copy a ref_data.
135 */
137 Array_base(), storage_type_(A.storage_type_)
138 {
139 assert(A.mem_ != nullptr || A.span_.empty());
140 const _SIZE_ size = A.size_array();
141 if (size > 0)
142 {
143 // storage_type_ must be set properly before invoking this! So that Trav mechanism works:
144 resize_array_(size, RESIZE_OPTIONS::NOCOPY_NOINIT);
145 if (A.get_data_location() != DataLocation::HostOnly) // Only allocate *this on device if A is on the device
146 // Not a Trav already allocated on device (avoid double alloc on device for Trav)
147 if(!(storage_type_ == STORAGE::TEMP_STORAGE && isAllocatedOnDevice(mem_->data())))
148 allocateOnDevice(*this);
149 // Set new location AFTER possible allocation
150 data_location_ = std::make_shared<DataLocation>(A.get_data_location());
151 inject_array(A);
152 }
153 }
154
155 // Resizing methods
156 inline void resize(_SIZE_ new_size, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT) { resize_array(new_size, opt); }
157 inline void resize_array(_SIZE_ new_size, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT);
158
159 // Conversion method - from a small array (_SIZE_=int) of TID (_TYPE_=trustIdType), return a big one (_SIZE_=long).
160 // No data copied! This behaves somewhat like a ref_array:
162
163 // The other way around compared to ref_as_big! From big to small. In debug, size limit is checked.
165
166 // Conversion from a BigArrOfTID to an ArrOfInt - see also similar method in TRUSTTab
168
169 /*! Memory allocation type - TEMP arrays (i.e. Trav) have a different allocation mechanism - see TRUSTTravPool.h) */
170 inline void set_mem_storage(const STORAGE storage);
171 inline STORAGE get_mem_storage() const { return storage_type_; }
172
173 inline std::shared_ptr<Vector_> get_mem() {return mem_;}
174
176
177 inline _TYPE_& operator[](_SIZE_ i);
178 inline const _TYPE_& operator[](_SIZE_ i) const;
179
180 inline _TYPE_& operator()(_SIZE_ i) { return operator[](i); }
181 inline const _TYPE_& operator()(_SIZE_ i) const { return operator[](i); }
182
183 // Ces methodes renvoient un pointeur vers le premier element du tableau pour une utilisation sur le host
184 inline _TYPE_ * addr();
185 inline const _TYPE_ * addr() const;
186 // Les memes methodes pour une utilisation sur le device
187 inline _TYPE_ *data();
188
189 inline const _TYPE_ *data() const;
190
191 /*! Return the size of the span on the data (not the full underlying allocated size) */
192 inline _SIZE_ size_array() const;
193
194 /*! Returns the number of owners of the data, i.e. the number of Arrays pointing to the same underlying data */
195 inline int ref_count() const;
196
197#ifdef TRUST_GTEST
198 inline int nb_dim() const;
199#endif
200
201 /*! Add a slot at the end of the array and store it valeur -> similar to vector<>::push_back */
202 inline void append_array(_TYPE_ valeur);
203
204 /*! Assign 'x' to all slots in the array */
206
207 /*! Addition case a case sur toutes les cases du tableau : la taille de y doit etre au moins egale a la taille de this */
209
210 /*! ajoute la meme valeur a toutes les cases du tableau */
211 TRUSTArray& operator+=(const _TYPE_ dy);
212
213 /*! Soustraction case a case sur toutes les cases du tableau : tableau de meme taille que *this */
215
216 /*! soustrait la meme valeur a toutes les cases */
217 TRUSTArray& operator-=(const _TYPE_ dy);
218
219 /*! muliplie toutes les cases par dy */
220 TRUSTArray& operator*= (const _TYPE_ dy);
221
222 /*! divise toutes les cases par dy (pas pour TRUSTArray<int>) */
223 TRUSTArray& operator/= (const _TYPE_ dy);
224
225 TRUSTArray& inject_array(const TRUSTArray& source, _SIZE_ nb_elements=-1, _SIZE_ first_element_dest=0, _SIZE_ first_element_source=0);
226
228 {
229 operator=(a);
230 return *this;
231 }
232
233 inline void ordonne_array();
234
235 // methodes virtuelles
236
237 /*! Construction de tableaux qui pointent vers des donnees existantes !!! Utiliser ref_data avec precaution */
238 inline virtual void ref_data(_TYPE_* ptr, _SIZE_ size);
239 /*! Remet le tableau dans l'etat obtenu avec le constructeur par defaut (libere la memoire mais conserve le mode d'allocation memoire actuel) */
240 inline virtual void reset() { detach_array(); }
241 inline virtual void ref_array(TRUSTArray&, _SIZE_ start=0, _SIZE_ sz=-1);
242 inline virtual void resize_tab(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT);
243
244 // Host/Device methods:
245 inline DataLocation get_data_location() { return data_location_ == nullptr ? DataLocation::HostOnly : *data_location_; }
246 inline DataLocation get_data_location() const { return data_location_ == nullptr ? DataLocation::HostOnly : *data_location_; }
247 inline void set_data_location(DataLocation flag) { if (data_location_ != nullptr) *data_location_ = flag; }
248 inline void set_data_location(DataLocation flag) const { if (data_location_ != nullptr) *data_location_ = flag; }
249 inline int size_mem() { return mem_ == nullptr ? 0 : (int)mem_->size(); };
250
251 inline void ensureDataOnHost();
252 inline void ensureDataOnHost() const;
253 inline bool isDataOnDevice() const;
254 inline bool checkDataOnDevice();
255 inline bool checkDataOnDevice() const;
256 inline bool checkDataOnDevice(const TRUSTArray& arr);
257
258 inline virtual Span_ get_span() { return span_; }
259 inline virtual Span_ get_span_tot() { return span_; }
260 inline virtual const Span_ get_span() const { return span_; }
261 inline virtual const Span_ get_span_tot() const { return span_; }
262
263 //From TRUSTArray.h, now also here and overridden in TRUSTTab
264 inline virtual _SIZE_ dimension_tot(int) const;
265
266#ifdef KOKKOS
267
268 template<int _SHAPE_>
269 inline bool check_flattened() const;
270
271 template<int _SHAPE_>
272 std::array<_SIZE_, 4> getDims() const;
273
274 //Clean the internal view of the Trust Array in case it is needed, if the Array is static to avoid it's destruction after Kokkos::finalize
275 inline void CleanMyView()
276 {
277 device_view_1_=DeviceView<_TYPE_,1>();
278 device_view_2_=DeviceView<_TYPE_,2>();
279 device_view_3_=DeviceView<_TYPE_,3>();
280 device_view_4_=DeviceView<_TYPE_,4>();
281 }
282
283 // Kokkos accessors (brace yourself!)
284 // See implementation in TRUSTArray_kokkos.h
285
286 // ** Informations for Arrays **
287 // Default value of _SHAPE_ is 1.
288 // You can only use use _SHAPE_ = 1 on a TRUSTArray
289
290 // ** Informations for Tabs **
291 // It is not allowed to have a multi-D view of different shape than a multi-D tab
292 // It is allowed to have a 1D view on a multi-D tab. In this case, the view is flattened
293 // It is allowed to have a multi-D View on a 1D Tab (type: tab, nb_dim_=1)
294 // This last case happens in Op_Conv_VEF_Face.cpp where a default constructed tab (nb_dim=1)
295 // Is pointed to other tabs and used in kokkos (weird case)
296
297 //See test/UnitTests/unit_array_kokkos.cpp for examples
298
299 // Read-only
300 template <int _SHAPE_ = 1, typename EXEC_SPACE = Kokkos::DefaultExecutionSpace>
301 inline std::enable_if_t<is_default_exec_space<EXEC_SPACE>, ConstView<_TYPE_,_SHAPE_> >
302 view_ro() const;
303
304 template <int _SHAPE_ = 1, typename EXEC_SPACE = Kokkos::DefaultExecutionSpace>
305 inline std::enable_if_t<gpu_enabled_is_host_exec_space<EXEC_SPACE>, ConstHostView<_TYPE_,_SHAPE_> >
306 view_ro() const;
307
308 // Write-only
309 template <int _SHAPE_ = 1, typename EXEC_SPACE=Kokkos::DefaultExecutionSpace>
310 inline std::enable_if_t<is_default_exec_space<EXEC_SPACE>, View<_TYPE_,_SHAPE_> >
311 view_wo();
312
313 template <int _SHAPE_ = 1, typename EXEC_SPACE=Kokkos::DefaultExecutionSpace>
314 inline std::enable_if_t<gpu_enabled_is_host_exec_space<EXEC_SPACE>, HostView<_TYPE_,_SHAPE_> >
315 view_wo();
316
317 // Read-write
318 template <int _SHAPE_ = 1, typename EXEC_SPACE=Kokkos::DefaultExecutionSpace>
319 inline std::enable_if_t<is_default_exec_space<EXEC_SPACE>, View<_TYPE_,_SHAPE_> >
320 view_rw();
321
322 template <int _SHAPE_ = 1, typename EXEC_SPACE=Kokkos::DefaultExecutionSpace>
323 inline std::enable_if_t<gpu_enabled_is_host_exec_space<EXEC_SPACE>, HostView<_TYPE_,_SHAPE_> >
324 view_rw();
325
326#endif
327
328protected:
329 inline void attach_array(const TRUSTArray& a, _SIZE_ start=0, _SIZE_ size=-1);
330 inline bool detach_array();
331
332 void resize_array_(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT);
333
334#ifdef KOKKOS
335 // Kokkos members
336 template<int _SHAPE_> inline void init_device_view() const;
337
338 mutable DeviceView<_TYPE_, 1> device_view_1_;
339 mutable DeviceView<_TYPE_, 2> device_view_2_;
340 mutable DeviceView<_TYPE_, 3> device_view_3_;
341 mutable DeviceView<_TYPE_, 4> device_view_4_;
342
343#endif
344
345private:
346
347 /*! Shared pointer to the actual underlying memory block:
348 * - shared_ptr because data can be shared between several owners -> see ref_array()
349 * - std::vector<> because we want contiguous data, with a smart allocation mechanism
350 * WARNING: allocation mechanism for a Trav array is special.
351 */
352 std::shared_ptr<Vector_> mem_;
353
354 /*! Actual view on the data. See comments at the top of the class */
355 Span_ span_;
356
357 /*! Drapeau indiquant si l'allocation memoire a lieu avec un new classique ou dans le pool de memoire temporaire de TRUST */
358 STORAGE storage_type_;
359
360 // Drapeau du statut du data sur le Device:
361 // HostOnly : Non alloue sur le device encore
362 // Host : A jour sur le host pas sur le device
363 // Device : A jour sur le device pas sur le host
364 // HostDevice: A jour sur le host et le device
365 // PartialHostDevice : Etat temporaire: certaines valeurs sont plus a jour sur le host que le device (ex: faces frontieres ou items distants)
366 // In a shared_ptr because this state has the same status as mem_ (same sharing properties)
367 mutable std::shared_ptr<DataLocation> data_location_;
368
369private:
370 /*! Debug */
371 template<typename _TAB_> void ref_conv_helper_(_TAB_& out) const;
372
373#ifdef KOKKOS
374
375 // get_device_view for _SHAPE_ == 1
376 template<int _SHAPE_>
377 typename std::enable_if<_SHAPE_ == 1, DeviceView<_TYPE_, 1>>::type& get_device_view() const { return device_view_1_; }
378
379 // get_device_view for _SHAPE_ == 2
380 template<int _SHAPE_>
381 typename std::enable_if<_SHAPE_ == 2, DeviceView<_TYPE_, 2>>::type& get_device_view() const { return device_view_2_; }
382
383 // get_device_view for _SHAPE_ == 3
384 template<int _SHAPE_>
385 typename std::enable_if<_SHAPE_ == 3, DeviceView<_TYPE_, 3>>::type& get_device_view() const { return device_view_3_; }
386
387 // get_device_view for _SHAPE_ == 4
388 template<int _SHAPE_>
389 typename std::enable_if<_SHAPE_ == 4, DeviceView<_TYPE_, 4>>::type& get_device_view() const { return device_view_4_; }
390
391#endif
392};
393
394using ArrOfDouble = TRUSTArray<double, int>;
395using ArrOfFloat = TRUSTArray<float, int>;
396using ArrOfInt = TRUSTArray<int, int>;
397using ArrOfTID = TRUSTArray<trustIdType, int>;
398
399template <typename _TYPE_>
400using BigTRUSTArray = TRUSTArray<_TYPE_, trustIdType>;
401
402using BigArrOfDouble = BigTRUSTArray<double>;
403using BigArrOfInt = BigTRUSTArray<int>;
404using BigArrOfTID = BigTRUSTArray<trustIdType>;
405
406
407/* *********************************** *
408 * FONCTIONS NON MEMBRES DE TRUSTArray *
409 * *********************************** */
410
411#include <TRUSTArray_tools.tpp> // external templates function specializations ici ;)
412
413/* ******************************* *
414 * FONCTIONS MEMBRES DE TRUSTArray *
415 * ******************************* */
416
417#include <TRUSTArray_device.tpp> // OMP stuff
418#ifndef LATATOOLS
419#include <TRUSTArray_kokkos.tpp> // Kokkos stuff
420#endif
421
422#include <TRUSTArray.tpp> // The rest here!
423
424#endif /* TRUSTArray_included */
Empty class used as a base for all the arrays.
Definition Array_base.h:41
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
int numero() const
Renvoie l'indice de l'objet dans Memoire::data.
Definition Objet_U.cpp:268
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
Classe de base des flux de sortie.
Definition Sortie.h:52
Represents a an array of int/int64/double/... values.
Definition TRUSTArray.h:81
virtual const Span_ get_span_tot() const
Definition TRUSTArray.h:261
void from_tid_to_int(TRUSTArray< int, int > &out) const
void attach_array(const TRUSTArray &a, _SIZE_ start=0, _SIZE_ size=-1)
int size_mem()
Definition TRUSTArray.h:249
virtual void reset()
Definition TRUSTArray.h:240
void resize_array_(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
bool checkDataOnDevice(const TRUSTArray &arr)
const _TYPE_ & operator()(_SIZE_ i) const
Definition TRUSTArray.h:181
TRUSTArray & operator=(_TYPE_ x)
TRUSTArray & operator*=(const _TYPE_ dy)
void append_array(_TYPE_ valeur)
Iterator_ end()
Definition TRUSTArray.h:112
void set_data_location(DataLocation flag) const
Definition TRUSTArray.h:248
_SIZE_ size_array() const
_TYPE_ & operator()(_SIZE_ i)
Definition TRUSTArray.h:180
int duplique() const override
Definition TRUSTArray.h:85
virtual Span_ get_span()
Definition TRUSTArray.h:258
virtual void ref_array(TRUSTArray &, _SIZE_ start=0, _SIZE_ sz=-1)
TRUSTArray(const TRUSTArray &A)
Definition TRUSTArray.h:136
DataLocation get_data_location()
Definition TRUSTArray.h:245
void ensureDataOnHost() const
TRUSTArray & operator/=(const _TYPE_ dy)
const _TYPE_ * addr() const
TRUSTArray & operator+=(const _TYPE_ dy)
_TYPE_ * addr()
virtual ~TRUSTArray()
TRUSTArray & inject_array(const TRUSTArray &source, _SIZE_ nb_elements=-1, _SIZE_ first_element_dest=0, _SIZE_ first_element_source=0)
void ref_as_big(TRUSTArray< _TYPE_, trustIdType > &out) const
unsigned taille_memoire() const override
Definition TRUSTArray.h:83
int ref_count() const
bool checkDataOnDevice() const
const _TYPE_ * data() const
DataLocation get_data_location() const
Definition TRUSTArray.h:246
TRUSTArray & operator+=(const TRUSTArray &y)
STORAGE get_mem_storage() const
Definition TRUSTArray.h:171
TRUSTArray & copy_array(const TRUSTArray &a)
Definition TRUSTArray.h:227
TRUSTArray & operator-=(const TRUSTArray &y)
std::shared_ptr< Vector_ > get_mem()
Definition TRUSTArray.h:173
_TYPE_ * data()
virtual void resize_tab(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
void set_mem_storage(const STORAGE storage)
void ref_as_small(TRUSTArray< _TYPE_, int > &out) const
virtual const Span_ get_span() const
Definition TRUSTArray.h:260
std::vector< idx_t, TVAlloc< idx_t > > Vector_
Definition TRUSTArray.h:101
typename tcb::span< idx_t >::iterator Iterator_
Definition TRUSTArray.h:100
tcb::span< idx_t > Span_
Definition TRUSTArray.h:102
bool detach_array()
virtual Span_ get_span_tot()
Definition TRUSTArray.h:259
_TYPE_ & operator[](_SIZE_ i)
void resize_array(_SIZE_ new_size, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
void ordonne_array()
void set_data_location(DataLocation flag)
Definition TRUSTArray.h:247
virtual _SIZE_ dimension_tot(int) const
Iterator_ begin()
Definition TRUSTArray.h:111
const _TYPE_ & operator[](_SIZE_ i) const
const Iterator_ end() const
Definition TRUSTArray.h:114
friend class TRUSTArrayKokkos
Definition TRUSTArray.h:105
void resize(_SIZE_ new_size, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
Definition TRUSTArray.h:156
TRUSTArray(_SIZE_ n)
Definition TRUSTArray.h:120
bool isDataOnDevice() const
TRUSTArray & operator=(const TRUSTArray &)
Entree & readOn(Entree &is) override
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
friend class TRUSTArray
Definition TRUSTArray.h:108
virtual void ref_data(_TYPE_ *ptr, _SIZE_ size)
TRUSTArray & operator-=(const _TYPE_ dy)
const Iterator_ begin() const
Definition TRUSTArray.h:113
Sortie & printOn(Sortie &os) const override
Ecriture de l'objet sur un flot de sortie Methode a surcharger.