Arcane  4.1.11.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
RunCommandMaterialEnumerate.h
Aller à la documentation de ce fichier.
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/* RunCommandMaterialEnumerate.h (C) 2000-2026 */
9/* */
10/* Exécution d'une boucle sur une liste de constituants. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_ACCELERATOR_RUNCOMMANDMATERIALENUMERATE_H
13#define ARCANE_ACCELERATOR_RUNCOMMANDMATERIALENUMERATE_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18#include "arcane/core/materials/ComponentItemVectorView.h"
19#include "arcane/core/materials/MaterialsCoreGlobal.h"
20#include "arcane/core/materials/MatItem.h"
22#include "arcane/core/materials/ConstituentItemIndexedSelectionView.h"
23
24#include "arcane/accelerator/KernelLauncher.h"
25#include "arcane/accelerator/RunCommand.h"
26#include "arcane/accelerator/RunCommandLaunchInfo.h"
27
28#include "arccore/common/HostKernelRemainingArgsHelper.h"
29
30/*---------------------------------------------------------------------------*/
31/*---------------------------------------------------------------------------*/
32
34{
35
36/*---------------------------------------------------------------------------*/
37/*---------------------------------------------------------------------------*/
45template <typename ConstituentItemLocalIdType_>
46class ConstituentAndGlobalCellIteratorValue
47{
48 public:
49
50 using ConstituentItemLocalIdType = ConstituentItemLocalIdType_;
51 using ComponentItemLocalId = Arcane::Materials::ComponentItemLocalId;
52 using MatVarIndex = Arcane::Materials::MatVarIndex;
53
54 public:
55
57 struct Data
58 {
59 public:
60
61 constexpr ARCCORE_HOST_DEVICE Data(ConstituentItemLocalIdType mvi, CellLocalId cid)
62 : m_mvi(mvi)
63 , m_cid(cid)
64 {}
65
66 public:
67
68 ConstituentItemLocalIdType m_mvi;
69 CellLocalId m_cid;
70 };
71
72 public:
73
74 constexpr ARCCORE_HOST_DEVICE ConstituentAndGlobalCellIteratorValue(ConstituentItemLocalIdType mvi, CellLocalId cid, Int32 index)
75 : m_internal_data{ mvi, cid }
76 , m_index(index)
77 {
78 }
79
98 constexpr ARCCORE_HOST_DEVICE Data operator()()
99 {
100 return m_internal_data;
101 }
102
104 constexpr ARCCORE_HOST_DEVICE ConstituentItemLocalIdType varIndex() const { return m_internal_data.m_mvi; };
105
107 constexpr ARCCORE_HOST_DEVICE CellLocalId globalCellId() const { return m_internal_data.m_cid; }
108
110 constexpr ARCCORE_HOST_DEVICE Int32 index() const { return m_index; }
111
112 private:
113
114 Data m_internal_data;
115 Int32 m_index = -1;
116};
117
120
123
124/*---------------------------------------------------------------------------*/
125/*---------------------------------------------------------------------------*/
126
127} // namespace Arcane::Materials
128
129/*---------------------------------------------------------------------------*/
130/*---------------------------------------------------------------------------*/
131
132namespace Arcane::Accelerator::Impl
133{
134
135/*---------------------------------------------------------------------------*/
136/*---------------------------------------------------------------------------*/
140template <typename ContainerType_>
141class ConstituentRunCommandBase2
142{
143 public:
144
145 using ContainerType = ContainerType_;
146 using ThatClass = ConstituentRunCommandBase2<ContainerType_>;
147 using CommandType = ThatClass;
148
149 public:
150
151 static CommandType create(RunCommand& run_command, const ContainerType& items)
152 {
153 return CommandType(run_command, items);
154 }
155
156 private:
157
158 // Uniquement appelable depuis 'Container'
159 explicit ConstituentRunCommandBase2(RunCommand& command, const ContainerType& items)
160 : m_command(command)
161 , m_items(items)
162 {
163 }
164
165 public:
166
167 RunCommand& m_command;
168 ContainerType m_items;
169};
170
171/*---------------------------------------------------------------------------*/
172/*---------------------------------------------------------------------------*/
176class AllEnvCellRunCommandContainer
177{
178 public:
179
180 using ThatClass = AllEnvCellRunCommandContainer;
181 using AllEnvCellVectorView = Arcane::Materials::AllEnvCellVectorView;
182 using ContainerCreateViewType = AllEnvCellVectorView;
183 using IteratorValueType = Arcane::Materials::AllEnvCell;
184 using CommandType = ConstituentRunCommandBase2<ThatClass>;
185
186 public:
187
188 explicit AllEnvCellRunCommandContainer(ContainerCreateViewType view)
189 : m_view(view)
190 {
191 }
192
193 public:
194
195 constexpr ARCCORE_HOST_DEVICE Int32 size() const { return m_view.size(); }
196
198 ARCCORE_HOST_DEVICE IteratorValueType operator[](Int32 i) const
199 {
200 return m_view[i];
201 }
202
203 private:
204
206};
207
208/*---------------------------------------------------------------------------*/
209/*---------------------------------------------------------------------------*/
214class ConstituentCommandContainerBase
215{
216 protected:
217
218 using ComponentItemVectorView = Arcane::Materials::ComponentItemVectorView;
219 using ComponentItemLocalId = Arcane::Materials::ComponentItemLocalId;
220 using MatVarIndex = Arcane::Materials::MatVarIndex;
221
222 protected:
223
224 explicit ConstituentCommandContainerBase(ComponentItemVectorView view)
225 : m_items(view)
226 {
227 m_nb_item = m_items.nbItem();
228 m_matvar_indexes = m_items._matvarIndexes();
229 m_global_cells_local_id = m_items._internalLocalIds();
230 }
231
232 public:
233
234 constexpr ARCCORE_HOST_DEVICE Int32 size() const { return m_nb_item; }
235
236 protected:
237
238 ComponentItemVectorView m_items;
239 SmallSpan<const MatVarIndex> m_matvar_indexes;
240 SmallSpan<const Int32> m_global_cells_local_id;
241 Int32 m_nb_item = 0;
242};
243
244/*---------------------------------------------------------------------------*/
245/*---------------------------------------------------------------------------*/
250template <typename ConstituentItemLocalIdType_, typename ContainerCreateViewType_>
251class ConstituentRunCommandContainer
252: public ConstituentCommandContainerBase
253{
254 public:
255
256 using ThatClass = ConstituentRunCommandContainer;
257 using IteratorValueType = ConstituentItemLocalIdType_;
258 using CommandType = ConstituentRunCommandBase2<ThatClass>;
259 using ContainerCreateViewType = ContainerCreateViewType_;
260
261 public:
262
263 explicit ConstituentRunCommandContainer(ContainerCreateViewType view)
265 {
266 }
267
268 public:
269
271 constexpr ARCCORE_HOST_DEVICE IteratorValueType operator[](Int32 i) const
272 {
273 return { ComponentItemLocalId(m_matvar_indexes[i]) };
274 }
275};
276
277using EnvCellRunCommandContainer = ConstituentRunCommandContainer<Arcane::Materials::EnvItemLocalId, Arcane::Materials::EnvCellVectorView>;
278using MatCellRunCommandContainer = ConstituentRunCommandContainer<Arcane::Materials::MatItemLocalId, Arcane::Materials::MatCellVectorView>;
279
280/*---------------------------------------------------------------------------*/
281/*---------------------------------------------------------------------------*/
286template <typename ConstituentItemLocalIdType_, typename ContainerCreateViewType_>
287class ConstituentAndGlobalCellRunCommandContainer
288: public ConstituentCommandContainerBase
289{
290 public:
291
292 using ThatClass = ConstituentAndGlobalCellRunCommandContainer;
294 using CommandType = ConstituentRunCommandBase2<ThatClass>;
295 using ContainerCreateViewType = ContainerCreateViewType_;
296
297 public:
298
299 explicit ConstituentAndGlobalCellRunCommandContainer(ContainerCreateViewType_ view)
300 : ConstituentCommandContainerBase(view)
301 {
302 }
303
304 public:
305
307 constexpr ARCCORE_HOST_DEVICE IteratorValueType operator[](Int32 i) const
308 {
309 return { ComponentItemLocalId(m_matvar_indexes[i]), CellLocalId(m_global_cells_local_id[i]), i };
310 }
311};
312
313/*---------------------------------------------------------------------------*/
314/*---------------------------------------------------------------------------*/
315
316using EnvAndGlobalCellRunCommandContainer = ConstituentAndGlobalCellRunCommandContainer<Arcane::Materials::EnvItemLocalId, Arcane::Materials::EnvCellVectorView>;
317using MatAndGlobalCellRunCommandContainer = ConstituentAndGlobalCellRunCommandContainer<Arcane::Materials::MatItemLocalId, Arcane::Materials::MatCellVectorView>;
318
319/*---------------------------------------------------------------------------*/
320/*---------------------------------------------------------------------------*/
325template <typename ConstituentItemLocalIdType_, typename ContainerCreateViewType_>
326class ConstituentIndexedSelectionRunCommandContainer
327{
328 public:
329
330 using ThatClass = ConstituentIndexedSelectionRunCommandContainer;
331 using IteratorValueType = ConstituentItemLocalIdType_;
332 using CommandType = ConstituentRunCommandBase2<ThatClass>;
333 using ContainerCreateViewType = ContainerCreateViewType_;
334
335 public:
336
337 explicit ConstituentIndexedSelectionRunCommandContainer(ContainerCreateViewType view)
338 : m_view(view)
339 {
340 }
341
342 public:
343
345 constexpr ARCCORE_HOST_DEVICE IteratorValueType operator[](Int32 i) const
346 {
347 return { ComponentItemLocalId(m_view[i]) };
348 }
349
350 ARCCORE_HOST_DEVICE Int32 size() { return m_view.size(); }
351
352 private:
353
354 ContainerCreateViewType m_view;
355};
356
357/*---------------------------------------------------------------------------*/
358/*---------------------------------------------------------------------------*/
359
360using EnvIndexedSelectionRunCommandContainer = ConstituentIndexedSelectionRunCommandContainer<Arcane::Materials::EnvItemLocalId, Arcane::Materials::EnvCellVectorSelectionView>;
361
362/*---------------------------------------------------------------------------*/
363/*---------------------------------------------------------------------------*/
364
365#if defined(ARCANE_COMPILING_CUDA_OR_HIP)
366/*
367 * Surcharge de la fonction de lancement de kernel pour GPU pour les ComponentItemLocalId et CellLocalId
368 */
369template <typename ContainerType, typename Lambda, typename... RemainingArgs> __global__ void
370doMatContainerGPULambda(ContainerType items, Lambda func, RemainingArgs... remaining_args)
371{
372 auto privatizer = Impl::privatize(func);
373 auto& body = privatizer.privateCopy();
374 Int32 i = blockDim.x * blockIdx.x + threadIdx.x;
376 if (i < items.size()) {
377 body(items[i], remaining_args...);
378 }
380}
381
382#endif // ARCANE_COMPILING_CUDA_OR_HIP
383
384/*---------------------------------------------------------------------------*/
385/*---------------------------------------------------------------------------*/
386
387#if defined(ARCANE_COMPILING_SYCL)
388
389template <typename ContainerType, typename Lambda, typename... RemainingArgs>
390class DoMatContainerSYCLLambda
391{
392 public:
393
394 void operator()(sycl::nd_item<1> x, SmallSpan<std::byte> shm_view,
395 ContainerType items, Lambda func,
396 RemainingArgs... remaining_args) const
397 {
398 auto privatizer = Impl::privatize(func);
399 auto& body = privatizer.privateCopy();
400
401 Int32 i = static_cast<Int32>(x.get_global_id(0));
402 Impl::SyclKernelRemainingArgsHelper::applyAtBegin(x, shm_view, remaining_args...);
403 if (i < items.size()) {
404 body(items[i], remaining_args...);
405 }
406 Impl::SyclKernelRemainingArgsHelper::applyAtEnd(x, shm_view, remaining_args...);
407 }
408
409 void operator()(sycl::id<1> x, ContainerType items, Lambda func) const
410 {
411 auto privatizer = Impl::privatize(func);
412 auto& body = privatizer.privateCopy();
413
414 Int32 i = static_cast<Int32>(x);
415 if (i < items.size()) {
416 body(items[i]);
417 }
418 }
419};
420
421#endif
422
423/*---------------------------------------------------------------------------*/
424/*---------------------------------------------------------------------------*/
425
426template <typename ContainerType, typename Lambda, typename... RemainingArgs>
427void _doConstituentItemsLambda(Int32 base_index, Int32 size, ContainerType items,
428 const Lambda& func, RemainingArgs... remaining_args)
429{
430 auto privatizer = Impl::privatize(func);
431 auto& body = privatizer.privateCopy();
432
434 Int32 last_value = base_index + size;
435 for (Int32 i = base_index; i < last_value; ++i) {
436 body(items[i], remaining_args...);
437 }
439}
440
441/*---------------------------------------------------------------------------*/
442/*---------------------------------------------------------------------------*/
443
444template <typename ContainerType_, typename... RemainingArgs>
445class GenericConstituentCommandArgs
446{
447 public:
448
449 using ContainerType = ContainerType_;
450 using IteratorValueType = ContainerType::IteratorValueType;
451
452 public:
453
454 explicit GenericConstituentCommandArgs(const ContainerType& container, const RemainingArgs&... remaining_args)
455 : m_container(container)
456 , m_remaining_args(remaining_args...)
457 {}
458
459 public:
460
461 ContainerType m_container;
462 std::tuple<RemainingArgs...> m_remaining_args;
463};
464
465/*---------------------------------------------------------------------------*/
466/*---------------------------------------------------------------------------*/
467
468template <typename ContainerType_, typename... RemainingArgs>
469class GenericConstituentCommand
470{
471 public:
472
473 using ContainerType = ContainerType_;
474 using ConstituentCommandType = ContainerType::CommandType;
475
476 public:
477
478 explicit GenericConstituentCommand(const ConstituentCommandType& command)
479 : m_command(command)
480 {}
481 explicit GenericConstituentCommand(const ConstituentCommandType& command,
482 const std::tuple<RemainingArgs...>& remaining_args)
483 : m_command(command)
484 , m_remaining_args(remaining_args)
485 {}
486
487 public:
488
489 ConstituentCommandType m_command;
490 std::tuple<RemainingArgs...> m_remaining_args;
491};
492
493/*---------------------------------------------------------------------------*/
494/*---------------------------------------------------------------------------*/
504template <typename ContainerType, typename Lambda, typename... RemainingArgs> void
505_applyConstituentCells(RunCommand& command, ContainerType items, const Lambda& func, const RemainingArgs&... remaining_args)
506{
507 using namespace Arcane::Materials;
508 // TODO: fusionner la partie commune avec 'applyLoop'
509 Int32 vsize = items.size();
510 if (vsize == 0)
511 return;
512
513 Impl::RunCommandLaunchInfo launch_info(command, vsize);
514 const eExecutionPolicy exec_policy = launch_info.executionPolicy();
515 launch_info.beginExecute();
516 switch (exec_policy) {
518 ARCCORE_KERNEL_CUDA_FUNC((doMatContainerGPULambda<ContainerType, Lambda, RemainingArgs...>),
519 launch_info, func, items, remaining_args...);
520 break;
522 ARCCORE_KERNEL_HIP_FUNC((doMatContainerGPULambda<ContainerType, Lambda, RemainingArgs...>),
523 launch_info, func, items, remaining_args...);
524 break;
526 ARCCORE_KERNEL_SYCL_FUNC((impl::DoMatContainerSYCLLambda<ContainerType, Lambda, RemainingArgs...>{}),
527 launch_info, func, items, remaining_args...);
528 break;
530 _doConstituentItemsLambda(0, vsize, items, func, remaining_args...);
531 break;
533 arcaneParallelFor(0, vsize, launch_info.loopRunInfo(),
534 [&](Int32 begin, Int32 size) {
535 _doConstituentItemsLambda(begin, size, items, func, remaining_args...);
536 });
537 break;
538 default:
539 ARCCORE_FATAL("Invalid execution policy '{0}'", exec_policy);
540 }
541 launch_info.endExecute();
542}
543/*---------------------------------------------------------------------------*/
544/*---------------------------------------------------------------------------*/
545
546template <typename ConstituentCommandType, typename... RemainingArgs, typename Lambda>
547void operator<<(const GenericConstituentCommand<ConstituentCommandType, RemainingArgs...>& c, const Lambda& func)
548{
549 if constexpr (sizeof...(RemainingArgs) > 0) {
550 std::apply([&](auto... vs) {
551 Impl::_applyConstituentCells(c.m_command.m_command, c.m_command.m_items, func, vs...);
552 },
553 c.m_remaining_args);
554 }
555 else
556 Impl::_applyConstituentCells(c.m_command.m_command, c.m_command.m_items, func);
557}
558
559/*---------------------------------------------------------------------------*/
560/*---------------------------------------------------------------------------*/
561
562template <typename ConstituentItemType, typename ConstituentItemContainerType, typename... RemainingArgs> auto
563makeExtendedConstituentItemEnumeratorLoop(ConstituentItemType x,
564 const ConstituentItemContainerType& container,
565 const RemainingArgs&... remaining_args)
566{
567 auto container_instance = arcaneCreateRunCommandMaterialContainer(x, container);
568 using TraitsType = decltype(container_instance); //RunCommandConstituentItemEnumeratorTraitsT<ConstituentItemType>;
569 return GenericConstituentCommandArgs<TraitsType, RemainingArgs...>(container_instance, remaining_args...);
570}
571
572/*---------------------------------------------------------------------------*/
573/*---------------------------------------------------------------------------*/
574
575} // namespace Arcane::Accelerator::Impl
576
577/*---------------------------------------------------------------------------*/
578/*---------------------------------------------------------------------------*/
579
580namespace Arcane::Materials
581{
582
583/*---------------------------------------------------------------------------*/
584/*---------------------------------------------------------------------------*/
585
587inline Accelerator::Impl::EnvAndGlobalCellRunCommandContainer
589{
590 return Accelerator::Impl::EnvAndGlobalCellRunCommandContainer{ env->envView() };
591}
592inline Accelerator::Impl::EnvAndGlobalCellRunCommandContainer
594{
595 return Accelerator::Impl::EnvAndGlobalCellRunCommandContainer{ view };
596}
597
598/*---------------------------------------------------------------------------*/
599/*---------------------------------------------------------------------------*/
600
602inline Accelerator::Impl::MatAndGlobalCellRunCommandContainer
604{
605 return Accelerator::Impl::MatAndGlobalCellRunCommandContainer{ mat->matView() };
606}
607inline Accelerator::Impl::MatAndGlobalCellRunCommandContainer
609{
610 return Accelerator::Impl::MatAndGlobalCellRunCommandContainer{ mat };
611}
612
613/*---------------------------------------------------------------------------*/
614/*---------------------------------------------------------------------------*/
615
617inline Accelerator::Impl::AllEnvCellRunCommandContainer
622
623/*---------------------------------------------------------------------------*/
624/*---------------------------------------------------------------------------*/
625
627inline Accelerator::Impl::EnvCellRunCommandContainer
629{
630 return Accelerator::Impl::EnvCellRunCommandContainer(env->envView());
631}
632inline Accelerator::Impl::EnvCellRunCommandContainer
634{
635 return Accelerator::Impl::EnvCellRunCommandContainer(view);
636}
637
638/*---------------------------------------------------------------------------*/
639/*---------------------------------------------------------------------------*/
640
642inline Accelerator::Impl::MatCellRunCommandContainer
644{
645 return Accelerator::Impl::MatCellRunCommandContainer(mat->matView());
646}
647inline Accelerator::Impl::MatCellRunCommandContainer
649{
650 return Accelerator::Impl::MatCellRunCommandContainer(view);
651}
652
653/*---------------------------------------------------------------------------*/
654/*---------------------------------------------------------------------------*/
655
656inline Accelerator::Impl::EnvIndexedSelectionRunCommandContainer
658{
659 return Accelerator::Impl::EnvIndexedSelectionRunCommandContainer{ view };
660}
661
662/*---------------------------------------------------------------------------*/
663/*---------------------------------------------------------------------------*/
664
665} // namespace Arcane::Materials
666
667/*---------------------------------------------------------------------------*/
668/*---------------------------------------------------------------------------*/
669
670namespace Arcane::Accelerator
671{
672
673/*---------------------------------------------------------------------------*/
674/*---------------------------------------------------------------------------*/
675
676template <typename TraitsType, typename... RemainingArgs> auto
678{
679 using ContainerType = typename Impl::GenericConstituentCommandArgs<TraitsType, RemainingArgs...>::ContainerType;
680 using CommandType = typename ContainerType::CommandType;
681 using GenericCommandType = Impl::GenericConstituentCommand<CommandType, RemainingArgs...>;
682 return GenericCommandType(CommandType::create(command, args.m_container), args.m_remaining_args);
683}
684
685/*---------------------------------------------------------------------------*/
686/*---------------------------------------------------------------------------*/
687
688// TODO: rendre obsolète (il faut utiliser la version générique)
689inline auto
690operator<<(RunCommand& command, const Impl::MatAndGlobalCellRunCommandContainer& view)
691{
692 using CommandType = Impl::MatAndGlobalCellRunCommandContainer::CommandType;
693 return Impl::GenericConstituentCommand<CommandType>(CommandType::create(command, view));
694}
695
696/*---------------------------------------------------------------------------*/
697/*---------------------------------------------------------------------------*/
698
699// TODO: rendre obsolète (il faut utiliser la version générique)
700inline auto
701operator<<(RunCommand& command, const Impl::EnvAndGlobalCellRunCommandContainer& view)
702{
703 using CommandType = Impl::EnvAndGlobalCellRunCommandContainer::CommandType;
704 return Impl::GenericConstituentCommand<CommandType>(CommandType::create(command, view));
705}
706
707/*---------------------------------------------------------------------------*/
708/*---------------------------------------------------------------------------*/
709
710// TODO: rendre obsolète (il faut utiliser la version générique)
711inline auto
712operator<<(RunCommand& command, const Impl::EnvCellRunCommandContainer& view)
713{
714 using CommandType = Impl::EnvCellRunCommandContainer::CommandType;
715 return Impl::GenericConstituentCommand<CommandType>(CommandType::create(command, view));
716}
717
718/*---------------------------------------------------------------------------*/
719/*---------------------------------------------------------------------------*/
720
721// TODO: rendre obsolète (il faut utiliser la version générique)
722inline auto
723operator<<(RunCommand& command, const Impl::MatCellRunCommandContainer& view)
724{
725 using CommandType = Impl::MatCellRunCommandContainer::CommandType;
726 return Impl::GenericConstituentCommand<CommandType>(CommandType::create(command, view));
727}
728
729/*---------------------------------------------------------------------------*/
730/*---------------------------------------------------------------------------*/
731
732} // End namespace Arcane::Accelerator
733
734/*---------------------------------------------------------------------------*/
735/*---------------------------------------------------------------------------*/
736
737#define A_RUNCOMMAND_MAT_ENUMERATE_BUILDER_HELPER(ConstituentItemNameType, env_or_mat_container, ...) \
738 ::Arcane::Accelerator::Impl::makeExtendedConstituentItemEnumeratorLoop(ConstituentItemNameType{}, env_or_mat_container __VA_OPT__(, __VA_ARGS__))
739
760#define RUNCOMMAND_MAT_ENUMERATE(ConstituentItemNameType, iter_name, env_or_mat_container, ...) \
761 A_FUNCINFO << A_RUNCOMMAND_MAT_ENUMERATE_BUILDER_HELPER(ConstituentItemNameType, env_or_mat_container __VA_OPT__(, __VA_ARGS__)) \
762 << [=] ARCCORE_HOST_DEVICE(typename decltype(A_RUNCOMMAND_MAT_ENUMERATE_BUILDER_HELPER(ConstituentItemNameType, env_or_mat_container __VA_OPT__(, __VA_ARGS__)))::IteratorValueType iter_name \
763 __VA_OPT__(ARCCORE_RUNCOMMAND_REMAINING_FOR_EACH(__VA_ARGS__)))
764
765/*---------------------------------------------------------------------------*/
766/*---------------------------------------------------------------------------*/
767
768#endif
#define ARCCORE_FATAL(...)
Macro envoyant une exception FatalErrorException.
Classes, Types et macros pour gérer la concurrence.
void _applyConstituentCells(RunCommand &command, ContainerType items, const Lambda &func, const RemainingArgs &... remaining_args)
Applique l'énumération func sur la liste d'entité items.
__host__ __device__ IteratorValueType operator[](Int32 i) const
Accesseur pour le i-ème élément de la liste.
constexpr __host__ __device__ IteratorValueType operator[](Int32 i) const
Accesseur pour le i-ème élément de la liste.
Classe de base des conteneurs pour les command sur les constituants (sauf pour les AllEnvCell).
constexpr __host__ __device__ IteratorValueType operator[](Int32 i) const
Accesseur pour le i-ème élément de la liste.
Classe de base pour les commandes sur les constituants.
constexpr __host__ __device__ IteratorValueType operator[](Int32 i) const
Accesseur pour le i-ème élément de la liste.
static ARCCORE_DEVICE void applyAtEnd(Int32 index, RemainingArgs &... remaining_args)
Applique les fonctors des arguments additionnels en fin de kernel.
static ARCCORE_DEVICE void applyAtBegin(Int32 index, RemainingArgs &... remaining_args)
Applique les fonctors des arguments additionnels en début de kernel.
Object temporaire pour conserver les informations d'exécution d'une commande et regrouper les tests.
void beginExecute()
Indique qu'on commence l'exécution de la commande.
void endExecute()
Signale la fin de l'exécution.
static void applyAtEnd(RemainingArgs &... remaining_args)
Applique les functors des arguments additionnels à la fin de l'itération.
static void applyAtBegin(RemainingArgs &... remaining_args)
Applique les functors des arguments additionnels au début de l'itération.
Vue sur une liste de mailles avec infos sur les milieux.
Maille arcane avec info matériaux et milieux.
Vue sur un vecteur sur les entités d'un composant.
Index d'une boucle accélérateur sur les matériaux ou milieux.
constexpr __host__ __device__ Int32 index() const
Index de l'itération courante.
constexpr __host__ __device__ CellLocalId globalCellId() const
Accesseur sur la partie cell local id.
constexpr __host__ __device__ Data operator()()
Cet opérateur permet de renvoyer le couple [ConstituentItemLocalIdType, CellLocalId].
constexpr __host__ __device__ ConstituentItemLocalIdType varIndex() const
Accesseur sur la partie MatVarIndex.
Maille arcane d'un milieu.
virtual EnvItemVectorView envView() const =0
Vue associée à ce milieu.
Interface d'un matériau d'un maillage.
virtual MatItemVectorView matView() const =0
Vue associée à ce matériau.
Représente un matériau d'une maille multi-matériau.
Représente un index sur les variables matériaux et milieux.
Vue d'un tableau d'éléments de type T.
Definition Span.h:801
void arcaneParallelFor(Integer i0, Integer size, InstanceType *itype, void(InstanceType::*lambda_function)(Integer i0, Integer size))
Applique en concurrence la fonction lambda lambda_function sur l'intervalle d'itération [i0,...
Espace de nom pour l'utilisation des accélérateurs.
eExecutionPolicy
Politique d'exécution pour un Runner.
@ SYCL
Politique d'exécution utilisant l'environnement SYCL.
@ HIP
Politique d'exécution utilisant l'environnement HIP.
@ CUDA
Politique d'exécution utilisant l'environnement CUDA.
@ Sequential
Politique d'exécution séquentielle.
@ Thread
Politique d'exécution multi-thread.
Active toujours les traces dans les parties Arcane concernant les matériaux.
EnvItemVectorView EnvCellVectorView
Type de la vue sur un EnvCellVector.
ConstituentAndGlobalCellIteratorValue< EnvItemLocalId > EnvAndGlobalCellIteratorValue
Type de la valeur de l'itérateur pour RUNCOMMAND_MAT_ENUMERATE(EnvAndGlobalCell,.....
ConstituentAndGlobalCellIteratorValue< MatItemLocalId > MatAndGlobalCellIteratorValue
Type de la valeur de l'itérateur pour RUNCOMMAND_MAT_ENUMERATE(MatAndGlobalCell,.....
MatItemVectorView MatCellVectorView
Type de la vue sur un MatCellVector.
Accelerator::Impl::EnvAndGlobalCellRunCommandContainer arcaneCreateRunCommandMaterialContainer(Arcane::Materials::EnvAndGlobalCell, Arcane::Materials::IMeshEnvironment *env)
Spécialisation pour une vue sur un milieu et la maille globale associée.
ConstituentItemIndexedSelectionView< EnvCellVectorView > EnvCellVectorSelectionView
Selection sur un 'EvnCellVectorView'.
std::int32_t Int32
Type entier signé sur 32 bits.