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

#include <ResultSetReductionInterpreter.h>


union  EvalValue

Static Public Member Functions

static EvalValue run (const size_t execution_id, const Function *function, const std::vector< EvalValue > &inputs)
template<typename T >
static EvalValue MakeEvalValue (const T &val)
static std::optional< EvalValuerun (const size_t execution_id, 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)

Definition at line 39 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().

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

+ Here is the caller graph for this function:

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

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 size_t  execution_id,
const std::vector< std::unique_ptr< Instruction >> &  body,
const std::vector< EvalValue > &  vars 

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