OmniSciDB  d2f719934e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ReductionInterpreter Class Reference

#include <ResultSetReductionInterpreter.h>

Classes

union  EvalValue
 

Static Public Member Functions

static EvalValue run (const Function *function, const std::vector< EvalValue > &inputs)
 
template<typename T >
static EvalValue MakeEvalValue (const T &val)
 
static std::optional< EvalValuerun (const std::vector< std::unique_ptr< Instruction >> &body, const std::vector< EvalValue > &vars)
 

Detailed Description

Definition at line 24 of file ResultSetReductionInterpreter.h.

Member Function Documentation

template<typename T >
static EvalValue ReductionInterpreter::MakeEvalValue ( const T &  val)
inlinestatic

Definition at line 37 of file ResultSetReductionInterpreter.h.

References ReductionInterpreter::EvalValue::double_val, ReductionInterpreter::EvalValue::float_val, ReductionInterpreter::EvalValue::int_val, and ReductionInterpreter::EvalValue::ptr.

Referenced by anonymous_namespace{ResultSetReductionInterpreter.cpp}::eval_constant(), anonymous_namespace{ResultSetReduction.cpp}::run_reduction_code(), ReductionInterpreterImpl::runBinaryOperator(), ReductionInterpreterImpl::runCast(), ReductionInterpreterImpl::runGetElementPtr(), ReductionInterpreterImpl::runICmp(), ReductionInterpreterImpl::runLoad(), and ReductionInterpreterImpl::runReturnEarly().

37  {
38  EvalValue ret;
39  if constexpr (std::is_integral<T>::value) {
40  ret.int_val = static_cast<int64_t>(val);
41  } else if constexpr (std::is_same<T, float>::value) {
42  ret.float_val = val;
43  } else if constexpr (std::is_same<T, double>::value) {
44  ret.double_val = val;
45  } else if constexpr (std::is_pointer<T>::value) {
46  ret.ptr = val;
47  }
48  return ret;
49  }

+ Here is the caller graph for this function:

static EvalValue ReductionInterpreter::run ( const Function function,
const std::vector< EvalValue > &  inputs 
)
static

Referenced by anonymous_namespace{ResultSetReduction.cpp}::run_reduction_code(), ReductionInterpreterImpl::runCall(), and ReductionInterpreterImpl::runFor().

+ Here is the caller graph for this function:

static std::optional<EvalValue> ReductionInterpreter::run ( const std::vector< std::unique_ptr< Instruction >> &  body,
const std::vector< EvalValue > &  vars 
)
static

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