tfel
Loading...
Searching...
No Matches
mfront::generic_parallel::AbstractBackend Struct Referenceabstract

base class of the backends of the generic-parallel interfaces. More...

#include </home/runner/work/tfel/tfel/mfront/include/MFront/GenericParallel/AbstractBackend.hxx>

Inheritance diagram for mfront::generic_parallel::AbstractBackend:
mfront::generic_parallel::GPUBackend mfront::generic_parallel::ParallelSTLBackend mfront::generic_parallel::SYCLBackend mfront::generic_parallel::CUDABackend mfront::generic_parallel::HIPBackend

Public Member Functions

virtual std::string getName () const =0
virtual std::string getSourceFileExtension () const =0
virtual void writeSpecificIncludes (std::ostream &) const =0
 write the headers required by the backend: the header of its primitive (MFront/GenericParallel/<name>.hxx) and, if the backend has functions specific to the runtime of the interface, their header
void writeSymbols (std::ostream &, std::string_view) const
 write the symbols describing the generated library: name of the backend (<f>_generic_parallel_backend), memory space in which the fields must be located (<f>_generic_parallel_memory_space), identifier of the execution policy (<f>_generic_parallel_execution_policy), and version of the data structures exchanged with the generated functions (<f>_generic_parallel_api_version, see MFRONT_GPMP_API_VERSION)
virtual std::string getApply () const =0
virtual std::string getMemorySpace () const =0
virtual std::string getExecutionPolicyType () const =0
virtual void writeCall (std::ostream &, std::string_view, std::string_view, std::string_view) const
 write the statement returning the result of a function of the runtime of the interface, for instance evaluateBatch of MFront/GenericParallelMaterialProperty/Evaluate.hxx. The primitive of the backend is appended to the given arguments.
virtual ~AbstractBackend () noexcept
 destructor

Detailed Description

base class of the backends of the generic-parallel interfaces.

The computations on a batch are implemented by function templates of the runtime of an interface (MFront/GenericParallelMaterialProperty, namespace mfront::gpmp, for the material properties), which take the primitive of a backend as last argument (see MFront/GenericParallel/Batch.hxx). A backend selects its headers and writes the expression building its primitive.

Member Function Documentation

◆ getApply()

virtual std::string mfront::generic_parallel::AbstractBackend::getApply ( ) const
nodiscardpure virtual
Returns
an expression building the primitive of the backend (see the makeApply functions of the MFront/GenericParallel headers)

Implemented in mfront::generic_parallel::GPUBackend, mfront::generic_parallel::ParallelSTLBackend, and mfront::generic_parallel::SYCLBackend.

◆ getExecutionPolicyType()

virtual std::string mfront::generic_parallel::AbstractBackend::getExecutionPolicyType ( ) const
nodiscardpure virtual
Returns
the type of the execution policy of the backend (see MFront/GenericParallel/AbstractBackendExecutionPolicy.hxx), checked by the generated functions. Its header is included by the header of the primitive of the backend (see writeSpecificIncludes).

Implemented in mfront::generic_parallel::CUDABackend, mfront::generic_parallel::HIPBackend, mfront::generic_parallel::ParallelSTLBackend, and mfront::generic_parallel::SYCLBackend.

◆ getMemorySpace()

virtual std::string mfront::generic_parallel::AbstractBackend::getMemorySpace ( ) const
nodiscardpure virtual
Returns
an expression, evaluated when the generated library is compiled, giving the memory space in which the fields must be located (see MFront/GenericParallel/MemorySpace.hxx): host, device or any

Implemented in mfront::generic_parallel::GPUBackend, mfront::generic_parallel::ParallelSTLBackend, and mfront::generic_parallel::SYCLBackend.

◆ getName()

virtual std::string mfront::generic_parallel::AbstractBackend::getName ( ) const
nodiscardpure virtual
Returns
the name of the backend, which is used as a suffix for the names of the generated library and files

Implemented in mfront::generic_parallel::CUDABackend, mfront::generic_parallel::HIPBackend, mfront::generic_parallel::ParallelSTLBackend, and mfront::generic_parallel::SYCLBackend.

◆ getSourceFileExtension()

virtual std::string mfront::generic_parallel::AbstractBackend::getSourceFileExtension ( ) const
nodiscardpure virtual

◆ writeCall()

virtual void mfront::generic_parallel::AbstractBackend::writeCall ( std::ostream & ,
std::string_view ,
std::string_view ,
std::string_view  ) const
virtual

write the statement returning the result of a function of the runtime of the interface, for instance evaluateBatch of MFront/GenericParallelMaterialProperty/Evaluate.hxx. The primitive of the backend is appended to the given arguments.

Parameters
[out]osoutput stream
[in]fname of the function
[in]statusname of the output status, which is the first argument
[in]argumentsother arguments

Reimplemented in mfront::generic_parallel::SYCLBackend.

◆ writeSpecificIncludes()

virtual void mfront::generic_parallel::AbstractBackend::writeSpecificIncludes ( std::ostream & ) const
pure virtual

write the headers required by the backend: the header of its primitive (MFront/GenericParallel/<name>.hxx) and, if the backend has functions specific to the runtime of the interface, their header

Parameters
[out]osoutput stream

Implemented in mfront::generic_parallel::GPUBackend, mfront::generic_parallel::HIPBackend, mfront::generic_parallel::ParallelSTLBackend, and mfront::generic_parallel::SYCLBackend.

◆ writeSymbols()

void mfront::generic_parallel::AbstractBackend::writeSymbols ( std::ostream & ,
std::string_view  ) const

write the symbols describing the generated library: name of the backend (<f>_generic_parallel_backend), memory space in which the fields must be located (<f>_generic_parallel_memory_space), identifier of the execution policy (<f>_generic_parallel_execution_policy), and version of the data structures exchanged with the generated functions (<f>_generic_parallel_api_version, see MFRONT_GPMP_API_VERSION)

Parameters
[out]osoutput stream
[in]fbasis of the names of the symbols

The documentation for this struct was generated from the following file: