Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
amrex::IParserExecutor< N > Struct Template Reference

Callable wrapper around an integer parser expression with N variables. More...

#include <AMReX_IParser.H>

Public Member Functions

template<int M = N, std::enable_if_t< M==0, int > = 0>
__host__ __device__ long long operator() () const noexcept
 Evaluate constant expressions (N == 0) and return the integer result.
 
template<typename... Ts>
__host__ __device__ std::enable_if_t< sizeof...(Ts)==N &&std::conjunction_v< std::is_integral< Ts >... >, long long > operator() (Ts... var) const noexcept
 Evaluate the expression with N integral arguments.
 
__host__ __device__ long long operator() (GpuArray< long long, N > const &var) const noexcept
 Evaluate using an explicit array of integer arguments.
 
__host__ __device__ operator bool () const
 True when this is a valid executor.
 

Public Attributes

char * m_host_executor = nullptr
 Pointer to host bytecode.
 
char * m_device_executor = nullptr
 Pointer to device bytecode (if copied).
 

Detailed Description

template<int N>
struct amrex::IParserExecutor< N >

Callable wrapper around an integer parser expression with N variables.

Instances are returned by IParser::compile() / IParser::compileHost() and expose host/device operator() overloads that evaluate to 64-bit integers.

Member Function Documentation

◆ operator bool()

template<int N>
__host__ __device__ amrex::IParserExecutor< N >::operator bool ( ) const
inlineexplicit

True when this is a valid executor.

◆ operator()() [1/3]

template<int N>
template<int M = N, std::enable_if_t< M==0, int > = 0>
__host__ __device__ long long amrex::IParserExecutor< N >::operator() ( ) const
inlinenoexcept

Evaluate constant expressions (N == 0) and return the integer result.

◆ operator()() [2/3]

template<int N>
__host__ __device__ long long amrex::IParserExecutor< N >::operator() ( GpuArray< long long, N > const &  var) const
inlinenoexcept

Evaluate using an explicit array of integer arguments.

Parameters
varArgument array in registration order.

◆ operator()() [3/3]

template<int N>
template<typename... Ts>
__host__ __device__ std::enable_if_t< sizeof...(Ts)==N &&std::conjunction_v< std::is_integral< Ts >... >, long long > amrex::IParserExecutor< N >::operator() ( Ts...  var) const
inlinenoexcept

Evaluate the expression with N integral arguments.

Parameters
varScalar arguments supplied in registration order.
Returns
Result promoted to long long.

Member Data Documentation

◆ m_device_executor

template<int N>
char* amrex::IParserExecutor< N >::m_device_executor = nullptr

Pointer to device bytecode (if copied).

◆ m_host_executor

template<int N>
char* amrex::IParserExecutor< N >::m_host_executor = nullptr

Pointer to host bytecode.


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