Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
RunCommandMaterialEnumerate.h File Reference

Types and macros to manage enumerations of materials and media on accelerators. More...

#include "arcane/core/Concurrency.h"
#include "arcane/core/materials/ComponentItemVectorView.h"
#include "arcane/core/materials/MaterialsCoreGlobal.h"
#include "arcane/core/materials/MatItem.h"
#include "arcane/core/materials/MatItemEnumerator.h"
#include "arcane/core/materials/ConstituentItemIndexedSelectionView.h"
#include "arcane/accelerator/KernelLauncher.h"
#include "arcane/accelerator/RunCommand.h"
#include "arcane/accelerator/RunCommandLaunchInfo.h"
#include "arccore/common/HostKernelRemainingArgsHelper.h"
Include dependency graph for RunCommandMaterialEnumerate.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Arcane::Materials::ConstituentAndGlobalCellIteratorValue< ConstituentItemLocalIdType_ >
 Index of an accelerator loop over materials or media. More...
struct  Arcane::Materials::ConstituentAndGlobalCellIteratorValue< ConstituentItemLocalIdType_ >::Data
 Simple internal structure to avoid using std::tuple for the operator(). More...
class  Arcane::Accelerator::Impl::ConstituentRunCommandBase2< ContainerType_ >
 Base class for commands on constituents. More...
class  Arcane::Accelerator::Impl::AllEnvCellRunCommandContainer
 Container for a command on AllEnvCell. More...
class  Arcane::Accelerator::Impl::ConstituentCommandContainerBase
 Base class of containers for commands on constituents (except for AllEnvCell). More...
class  Arcane::Accelerator::Impl::ConstituentRunCommandContainer< ConstituentItemLocalIdType_, ContainerCreateViewType_ >
 Container containing the necessary information for a command on ConstituentItem. More...
class  Arcane::Accelerator::Impl::ConstituentAndGlobalCellRunCommandContainer< ConstituentItemLocalIdType_, ContainerCreateViewType_ >
 Container containing the necessary information for a command that allows access to both the ConstituentItem and the global entity. More...
class  Arcane::Accelerator::Impl::ConstituentIndexedSelectionRunCommandContainer< ConstituentItemLocalIdType_, ContainerCreateViewType_ >
 Container containing the necessary information for a command on an indexed selection of ConstituentItem. More...
class  Arcane::Accelerator::Impl::GenericConstituentCommandArgs< ContainerType_, RemainingArgs >
class  Arcane::Accelerator::Impl::GenericConstituentCommand< ContainerType_, RemainingArgs >

Namespaces

namespace  Arcane
 -- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
namespace  Arcane::Materials
 Always enables tracing in Arcane parts concerning materials.
namespace  Arcane::Accelerator
 Namespace for accelerator usage.

Macros

#define A_RUNCOMMAND_MAT_ENUMERATE_BUILDER_HELPER(ConstituentItemNameType, env_or_mat_container, ...)
#define RUNCOMMAND_MAT_ENUMERATE(ConstituentItemNameType, iter_name, env_or_mat_container, ...)
 Macro for iterating over a material or an environment.

Typedefs

using Arcane::Materials::EnvAndGlobalCellIteratorValue = ConstituentAndGlobalCellIteratorValue<EnvItemLocalId>
 Type of the iterator value for RUNCOMMAND_MAT_ENUMERATE(EnvAndGlobalCell,...).
using Arcane::Materials::MatAndGlobalCellIteratorValue = ConstituentAndGlobalCellIteratorValue<MatItemLocalId>
 Type of the iterator value for RUNCOMMAND_MAT_ENUMERATE(MatAndGlobalCell,...).
using Arcane::Accelerator::Impl::EnvCellRunCommandContainer = ConstituentRunCommandContainer<Arcane::Materials::EnvItemLocalId, Arcane::Materials::EnvCellVectorView>
using Arcane::Accelerator::Impl::MatCellRunCommandContainer = ConstituentRunCommandContainer<Arcane::Materials::MatItemLocalId, Arcane::Materials::MatCellVectorView>
using Arcane::Accelerator::Impl::EnvAndGlobalCellRunCommandContainer = ConstituentAndGlobalCellRunCommandContainer<Arcane::Materials::EnvItemLocalId, Arcane::Materials::EnvCellVectorView>
using Arcane::Accelerator::Impl::MatAndGlobalCellRunCommandContainer = ConstituentAndGlobalCellRunCommandContainer<Arcane::Materials::MatItemLocalId, Arcane::Materials::MatCellVectorView>
using Arcane::Accelerator::Impl::EnvIndexedSelectionRunCommandContainer = ConstituentIndexedSelectionRunCommandContainer<Arcane::Materials::EnvItemLocalId, Arcane::Materials::EnvCellVectorSelectionView>

Functions

template<typename ContainerType, typename Lambda, typename... RemainingArgs>
void Arcane::Accelerator::Impl::_doConstituentItemsLambda (Int32 base_index, Int32 size, ContainerType items, const Lambda &func, RemainingArgs... remaining_args)
template<typename ContainerType, typename Lambda, typename... RemainingArgs>
void Arcane::Accelerator::Impl::_applyConstituentCells (RunCommand &command, ContainerType items, const Lambda &func, const RemainingArgs &... remaining_args)
 Applies the enumeration func over the entity list items.
template<typename ConstituentCommandType, typename... RemainingArgs, typename Lambda>
void Arcane::Accelerator::Impl::operator<< (const GenericConstituentCommand< ConstituentCommandType, RemainingArgs... > &c, const Lambda &func)
template<typename ConstituentItemType, typename ConstituentItemContainerType, typename... RemainingArgs>
auto Arcane::Accelerator::Impl::makeExtendedConstituentItemEnumeratorLoop (ConstituentItemType x, const ConstituentItemContainerType &container, const RemainingArgs &... remaining_args)
Accelerator::Impl::EnvAndGlobalCellRunCommandContainer Arcane::Materials::arcaneCreateRunCommandMaterialContainer (Arcane::Materials::EnvAndGlobalCell, Arcane::Materials::IMeshEnvironment *env)
 Specialization for a view on an environment and the associated global cell.
Accelerator::Impl::EnvAndGlobalCellRunCommandContainer Arcane::Materials::arcaneCreateRunCommandMaterialContainer (Arcane::Materials::EnvAndGlobalCell, Arcane::Materials::EnvCellVectorView view)
Accelerator::Impl::MatAndGlobalCellRunCommandContainer Arcane::Materials::arcaneCreateRunCommandMaterialContainer (MatAndGlobalCell, IMeshMaterial *mat)
 Specialization for a view on a material and the associated global cell.
Accelerator::Impl::MatAndGlobalCellRunCommandContainer Arcane::Materials::arcaneCreateRunCommandMaterialContainer (MatAndGlobalCell, MatCellVectorView mat)
Accelerator::Impl::AllEnvCellRunCommandContainer Arcane::Materials::arcaneCreateRunCommandMaterialContainer (AllEnvCell, AllEnvCellVectorView items)
 Specialization for a view on AllEnvCell.
Accelerator::Impl::EnvCellRunCommandContainer Arcane::Materials::arcaneCreateRunCommandMaterialContainer (EnvCell, IMeshEnvironment *env)
 Specialization for a view on an environment.
Accelerator::Impl::EnvCellRunCommandContainer Arcane::Materials::arcaneCreateRunCommandMaterialContainer (EnvCell, EnvCellVectorView view)
Accelerator::Impl::MatCellRunCommandContainer Arcane::Materials::arcaneCreateRunCommandMaterialContainer (MatCell, IMeshMaterial *mat)
 Specialization for a view on a material.
Accelerator::Impl::MatCellRunCommandContainer Arcane::Materials::arcaneCreateRunCommandMaterialContainer (MatCell, MatCellVectorView view)
Accelerator::Impl::EnvIndexedSelectionRunCommandContainer Arcane::Materials::arcaneCreateRunCommandMaterialContainer (EnvCell, EnvCellVectorSelectionView view)
template<typename TraitsType, typename... RemainingArgs>
auto Arcane::Accelerator::operator<< (RunCommand &command, const Impl::GenericConstituentCommandArgs< TraitsType, RemainingArgs... > &args)
auto Arcane::Accelerator::operator<< (RunCommand &command, const Impl::MatAndGlobalCellRunCommandContainer &view)
auto Arcane::Accelerator::operator<< (RunCommand &command, const Impl::EnvAndGlobalCellRunCommandContainer &view)
auto Arcane::Accelerator::operator<< (RunCommand &command, const Impl::EnvCellRunCommandContainer &view)
auto Arcane::Accelerator::operator<< (RunCommand &command, const Impl::MatCellRunCommandContainer &view)

Detailed Description

Types and macros to manage enumerations of materials and media on accelerators.

Definition in file RunCommandMaterialEnumerate.h.

Macro Definition Documentation

◆ A_RUNCOMMAND_MAT_ENUMERATE_BUILDER_HELPER

#define A_RUNCOMMAND_MAT_ENUMERATE_BUILDER_HELPER ( ConstituentItemNameType,
env_or_mat_container,
... )
Value:
::Arcane::Accelerator::Impl::makeExtendedConstituentItemEnumeratorLoop(ConstituentItemNameType{}, env_or_mat_container __VA_OPT__(, __VA_ARGS__))

Definition at line 744 of file RunCommandMaterialEnumerate.h.

◆ RUNCOMMAND_MAT_ENUMERATE

#define RUNCOMMAND_MAT_ENUMERATE ( ConstituentItemNameType,
iter_name,
env_or_mat_container,
... )
Value:
A_FUNCINFO << A_RUNCOMMAND_MAT_ENUMERATE_BUILDER_HELPER(ConstituentItemNameType, env_or_mat_container __VA_OPT__(, __VA_ARGS__)) \
<< [=] ARCCORE_HOST_DEVICE(typename decltype(A_RUNCOMMAND_MAT_ENUMERATE_BUILDER_HELPER(ConstituentItemNameType, env_or_mat_container __VA_OPT__(, __VA_ARGS__)))::IteratorValueType iter_name \
__VA_OPT__(ARCCORE_RUNCOMMAND_REMAINING_FOR_EACH(__VA_ARGS__)))

Macro for iterating over a material or an environment.

Parameters
ConstituentItemNameTypeis the enumerator type.
iter_nameis the iterator name
env_or_mat_containeris the container being iterated over.

Additional parameters are used for reductions (see Reductions)

ConstituentItemNameType must be one of the following values:

  • EnvAndGlobalCell
  • EnvCell
  • MatAndGlobalCell
  • MatCell
  • AllEnvCell

See Usage for materials for more information.

Definition at line 767 of file RunCommandMaterialEnumerate.h.

Typedef Documentation

◆ EnvAndGlobalCellRunCommandContainer

using Arcane::Accelerator::Impl::EnvAndGlobalCellRunCommandContainer = ConstituentAndGlobalCellRunCommandContainer<Arcane::Materials::EnvItemLocalId, Arcane::Materials::EnvCellVectorView>

Definition at line 321 of file RunCommandMaterialEnumerate.h.

◆ EnvCellRunCommandContainer

using Arcane::Accelerator::Impl::EnvCellRunCommandContainer = ConstituentRunCommandContainer<Arcane::Materials::EnvItemLocalId, Arcane::Materials::EnvCellVectorView>

Definition at line 281 of file RunCommandMaterialEnumerate.h.

◆ EnvIndexedSelectionRunCommandContainer

using Arcane::Accelerator::Impl::EnvIndexedSelectionRunCommandContainer = ConstituentIndexedSelectionRunCommandContainer<Arcane::Materials::EnvItemLocalId, Arcane::Materials::EnvCellVectorSelectionView>

Definition at line 366 of file RunCommandMaterialEnumerate.h.

◆ MatAndGlobalCellRunCommandContainer

using Arcane::Accelerator::Impl::MatAndGlobalCellRunCommandContainer = ConstituentAndGlobalCellRunCommandContainer<Arcane::Materials::MatItemLocalId, Arcane::Materials::MatCellVectorView>

Definition at line 322 of file RunCommandMaterialEnumerate.h.

◆ MatCellRunCommandContainer

using Arcane::Accelerator::Impl::MatCellRunCommandContainer = ConstituentRunCommandContainer<Arcane::Materials::MatItemLocalId, Arcane::Materials::MatCellVectorView>

Definition at line 282 of file RunCommandMaterialEnumerate.h.

Function Documentation

◆ _applyConstituentCells()

template<typename ContainerType, typename Lambda, typename... RemainingArgs>
void Arcane::Accelerator::Impl::_applyConstituentCells ( RunCommand & command,
ContainerType items,
const Lambda & func,
const RemainingArgs &... remaining_args )

Applies the enumeration func over the entity list items.

The container can come from:

  • EnvAndGlobalCellRunCommand
  • EnvCellRunCommand
  • MatAndGlobalCellRunCommand
  • MatCellRunCommand

Definition at line 512 of file RunCommandMaterialEnumerate.h.

References Arcane::arcaneParallelFor(), ARCCORE_FATAL, Arcane::Accelerator::Impl::RunCommandLaunchInfo::beginExecute(), Arcane::Accelerator::CUDA, Arcane::Accelerator::Impl::RunCommandLaunchInfo::endExecute(), Arcane::Accelerator::HIP, Arcane::Accelerator::Sequential, Arcane::Accelerator::SYCL, and Arcane::Accelerator::Thread.

◆ _doConstituentItemsLambda()

template<typename ContainerType, typename Lambda, typename... RemainingArgs>
void Arcane::Accelerator::Impl::_doConstituentItemsLambda ( Int32 base_index,
Int32 size,
ContainerType items,
const Lambda & func,
RemainingArgs... remaining_args )

Definition at line 433 of file RunCommandMaterialEnumerate.h.

◆ makeExtendedConstituentItemEnumeratorLoop()

template<typename ConstituentItemType, typename ConstituentItemContainerType, typename... RemainingArgs>
auto Arcane::Accelerator::Impl::makeExtendedConstituentItemEnumeratorLoop ( ConstituentItemType x,
const ConstituentItemContainerType & container,
const RemainingArgs &... remaining_args )

Definition at line 570 of file RunCommandMaterialEnumerate.h.

◆ operator<<()

template<typename ConstituentCommandType, typename... RemainingArgs, typename Lambda>
void Arcane::Accelerator::Impl::operator<< ( const GenericConstituentCommand< ConstituentCommandType, RemainingArgs... > & c,
const Lambda & func )

Definition at line 554 of file RunCommandMaterialEnumerate.h.