21 namespace spatial_type {
27 size_t size() const final {
return 1; }
41 geo_ti_ = col_var->get_type_info();
46 auto column_key = col_var->getColumnKey();
47 column_key.column_id = column_key.column_id + 1;
52 coords_cd->columnType, column_key, col_var->get_rte_idx());
57 const std::vector<llvm::Value*>& arg_lvs,
58 const std::vector<llvm::Value*>& pos_lvs,
61 auto& argument_lv = arg_lvs.front();
62 std::string fn_name(
"array_size");
65 std::vector<llvm::Value*> array_size_args{
68 cgen_state->llInt(
log2_bytes(elem_ti.get_logical_size()))};
73 fn_name +=
"_nullable";
74 array_size_args.push_back(cgen_state->inlineIntNull(
getTypeInfo()));
76 const auto coords_arr_sz_lv = cgen_state->emitExternalCall(
77 fn_name,
get_int_type(32, cgen_state->context_), array_size_args);
78 return std::make_tuple(std::vector<llvm::Value*>{coords_arr_sz_lv}, coords_arr_sz_lv);
81 std::vector<llvm::Value*>
codegen(
const std::vector<llvm::Value*>&
args,
88 auto& builder = cgen_state->ir_builder_;
89 llvm::Value* conversion_constant{
nullptr};
91 conversion_constant = cgen_state->llInt(4);
93 conversion_constant = cgen_state->llInt(8);
95 CHECK(conversion_constant);
96 const auto total_num_pts = builder.CreateUDiv(
args.front(), conversion_constant);
97 const auto ret = builder.CreateUDiv(total_num_pts, cgen_state->llInt(2));
99 CHECK(nullcheck_codegen);
100 return {nullcheck_codegen->finalize(cgen_state->inlineIntNull(
getTypeInfo()), ret)};
std::unique_ptr< Analyzer::ColumnVar > operand_owned_
size_t size() const final
SQLTypeInfo getNullType() const final
llvm::Type * get_int_type(const int width, llvm::LLVMContext &context)
const Analyzer::Expr * getOperand(const size_t index) final
const ColumnDescriptor * get_column_descriptor(const shared::ColumnKey &column_key)
const SQLTypeInfo & get_type_info() const
std::tuple< std::vector< llvm::Value * >, llvm::Value * > codegenLoads(const std::vector< llvm::Value * > &arg_lvs, const std::vector< llvm::Value * > &pos_lvs, CgenState *cgen_state) final
NPoints(const Analyzer::GeoOperator *geo_operator)
HOST DEVICE EncodingType get_compression() const
std::vector< llvm::Value * > codegen(const std::vector< llvm::Value * > &args, CodeGenerator::NullCheckCodegen *nullcheck_codegen, CgenState *cgen_state, const CompilationOptions &co) final
const Analyzer::GeoOperator * operator_
Analyzer::Expr * getOperand(const size_t index) const
uint32_t log2_bytes(const uint32_t bytes)
HOST DEVICE bool get_notnull() const
SQLTypeInfo get_elem_type() const