Callable wrapper around a compiled parser expression with N variables.
More...
#include <AMReX_Parser.H>
|
| template<int M = N, std::enable_if_t< M==0, int > = 0> |
| __host__ __device__ double | operator() () const noexcept |
| | Evaluate the expression with no arguments.
|
| |
| template<typename... Ts> |
| __host__ __device__ std::enable_if_t< sizeof...(Ts)==N &&!amrex::Same< float, Ts... >::value, double > | operator() (Ts... var) const noexcept |
| | Evaluate the expression with N double-compatible arguments.
|
| |
| template<typename... Ts> |
| __host__ __device__ std::enable_if_t< sizeof...(Ts)==N &&amrex::Same< float, Ts... >::value, float > | operator() (Ts... var) const noexcept |
| | Evaluate the expression with N float arguments.
|
| |
| __host__ __device__ double | operator() (GpuArray< double, N > const &var) const noexcept |
| | Evaluate the expression using an explicit array of inputs.
|
| |
| __host__ __device__ | operator bool () const |
| | True when a compiled executor buffer is available.
|
| |
template<
int N>
struct amrex::ParserExecutor< N >
Callable wrapper around a compiled parser expression with N variables.
Instances are returned by Parser::compile() / Parser::compileHost() and may be invoked on host or device. Device execution is available only when AMREX_USE_GPU is enabled and a device executor buffer has been created.
- Template Parameters
-
| N | Number of variables referenced in the expression. |
◆ operator bool()
True when a compiled executor buffer is available.
◆ operator()() [1/4]
template<
int M = N, std::enable_if_t< M==0,
int > = 0>
Evaluate the expression with no arguments.
Enabled only for constant expressions (N == 0).
- Returns
- Expression value as double precision.
◆ operator()() [2/4]
Evaluate the expression using an explicit array of inputs.
- Parameters
-
| var | Array storing the N variables in parser variable order. |
- Returns
- Expression value promoted to double precision.
◆ operator()() [3/4]
template<typename... Ts>
| __host__ __device__ std::enable_if_t< sizeof...(Ts)==N &&!amrex::Same< float, Ts... >::value, double > amrex::ParserExecutor< N >::operator() |
( |
Ts... |
var | ) |
const |
|
inlinenoexcept |
Evaluate the expression with N double-compatible arguments.
- Parameters
-
| var | Scalar arguments supplied in parser variable order. |
- Returns
- Expression value promoted to double precision.
◆ operator()() [4/4]
Evaluate the expression with N float arguments.
Returns a float when all inputs are float.
- Parameters
-
| var | Scalar arguments supplied in parser variable order. |
◆ m_device_executor
Pointer to device-visible bytecode (if copied).
◆ m_host_executor
Pointer to host-visible bytecode.
The documentation for this struct was generated from the following files: