OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TreeModelPredictionMgr.cpp File Reference
#include "TreeModelPredictionMgr.h"
#include "CodeGenerator.h"
#include "Parser/ParserNode.h"
#include <tbb/parallel_for.h>
+ Include dependency graph for TreeModelPredictionMgr.cpp:

Go to the source code of this file.

Functions

std::pair< std::vector
< std::shared_ptr< const
Analyzer::Constant >
>, std::vector< const
Analyzer::Constant * > > 
generate_kernel_buffer_constants (CgenState *cgen_state_ptr, const std::vector< const int8_t * > &kernel_buffers, const bool hoist_literals)
 

Function Documentation

std::pair<std::vector<std::shared_ptr<const Analyzer::Constant> >, std::vector<const Analyzer::Constant*> > generate_kernel_buffer_constants ( CgenState cgen_state_ptr,
const std::vector< const int8_t * > &  kernel_buffers,
const bool  hoist_literals 
)

Definition at line 137 of file TreeModelPredictionMgr.cpp.

References Parser::IntLiteral::analyzeValue(), CHECK, CHECK_EQ, CHECK_GE, and kENCODING_NONE.

Referenced by TreeModelPredictionMgr::codegen().

139  {
140  std::vector<std::shared_ptr<const Analyzer::Constant>> kernel_buffer_constants_owned;
141  std::vector<const Analyzer::Constant*> kernel_buffer_constants;
142  for (const auto kernel_buffer : kernel_buffers) {
143  const int64_t kernel_buffer_handle = reinterpret_cast<int64_t>(kernel_buffer);
144  const auto kernel_buffer_handle_literal =
145  std::dynamic_pointer_cast<Analyzer::Constant>(
146  Parser::IntLiteral::analyzeValue(kernel_buffer_handle));
148  kernel_buffer_handle_literal->get_type_info().get_compression());
149  kernel_buffer_constants_owned.push_back(kernel_buffer_handle_literal);
150  kernel_buffer_constants.push_back(kernel_buffer_handle_literal.get());
151  }
152  CHECK_GE(kernel_buffer_constants.size(), 1UL);
153  CHECK(hoist_literals || kernel_buffer_constants.size() == 1UL);
154 
155  return std::make_pair(kernel_buffer_constants_owned, kernel_buffer_constants);
156 }
#define CHECK_EQ(x, y)
Definition: Logger.h:301
static std::shared_ptr< Analyzer::Expr > analyzeValue(const int64_t intval)
Definition: ParserNode.cpp:166
#define CHECK_GE(x, y)
Definition: Logger.h:306
#define CHECK(condition)
Definition: Logger.h:291

+ Here is the call graph for this function:

+ Here is the caller graph for this function: