Class QueryMemoryInitializer

class QueryMemoryInitializer

Public Functions

QueryMemoryInitializer(const RelAlgExecutionUnit &ra_exe_unit, const QueryMemoryDescriptor &query_mem_desc, const int device_id, const ExecutorDeviceType device_type, const ExecutorDispatchMode dispatch_mode, const bool output_columnar, const bool sort_on_gpu, const int outer_table_id, const int64_t num_rows, const std::vector<std::vector<const int8_t *>> &col_buffers, const std::vector<std::vector<uint64_t>> &frag_offsets, RenderAllocatorMap *render_allocator_map, RenderInfo *render_info, std::shared_ptr<RowSetMemoryOwner> row_set_mem_owner, DeviceAllocator *gpu_allocator, const size_t thread_idx, const Executor *executor)
QueryMemoryInitializer(const TableFunctionExecutionUnit &exe_unit, const QueryMemoryDescriptor &query_mem_desc, const int device_id, const ExecutorDeviceType device_type, const int64_t num_rows, const std::vector<std::vector<const int8_t *>> &col_buffers, const std::vector<std::vector<uint64_t>> &frag_offsets, std::shared_ptr<RowSetMemoryOwner> row_set_mem_owner, DeviceAllocator *device_allocator, const Executor *executor)
const auto getCountDistinctBitmapPtr() const
const auto getCountDistinctHostPtr() const
const auto getCountDistinctBitmapBytes() const
const auto getVarlenOutputHostPtr() const
const auto getVarlenOutputPtr() const
ResultSet *getResultSet(const size_t index) const
std::unique_ptr<ResultSet> getResultSetOwned(const size_t index)
void resetResultSet(const size_t index)
int64_t getAggInitValForIndex(const size_t index) const
const auto getGroupByBuffersPtr()
const auto getGroupByBuffersSize() const
const auto getNumBuffers() const
GpuGroupByBuffers setupTableFunctionGpuBuffers(const QueryMemoryDescriptor &query_mem_desc, const int device_id, const unsigned block_size_x, const unsigned grid_size_x, const bool zero_initialize_buffers)
void copyFromTableFunctionGpuBuffers(Data_Namespace::DataMgr *data_mgr, const QueryMemoryDescriptor &query_mem_desc, const size_t entry_count, const GpuGroupByBuffers &gpu_group_by_buffers, const int device_id, const unsigned block_size_x, const unsigned grid_size_x)
void copyGroupByBuffersFromGpu(DeviceAllocator &device_allocator, const QueryMemoryDescriptor &query_mem_desc, const size_t entry_count, const GpuGroupByBuffers &gpu_group_by_buffers, const RelAlgExecutionUnit *ra_exe_unit, const unsigned block_size_x, const unsigned grid_size_x, const int device_id, const bool prepend_index_buffer) const

Private Types

using QuantileParam = std::optional<double>

Private Functions

void initGroupByBuffer(int64_t *buffer, const RelAlgExecutionUnit &ra_exe_unit, const QueryMemoryDescriptor &query_mem_desc, const ExecutorDeviceType device_type, const bool output_columnar, const Executor *executor)
void initRowGroups(const QueryMemoryDescriptor &query_mem_desc, int64_t *groups_buffer, const std::vector<int64_t> &init_vals, const int32_t groups_buffer_entry_count, const size_t warp_size, const Executor *executor)
void initColumnarGroups(const QueryMemoryDescriptor &query_mem_desc, int64_t *groups_buffer, const std::vector<int64_t> &init_vals, const Executor *executor)
void initColumnsPerRow(const QueryMemoryDescriptor &query_mem_desc, int8_t *row_ptr, const std::vector<int64_t> &init_vals, const std::vector<int64_t> &bitmap_sizes, const std::vector<QuantileParam> &quantile_params)
void allocateCountDistinctGpuMem(const QueryMemoryDescriptor &query_mem_desc)
std::vector<int64_t> allocateCountDistinctBuffers(const QueryMemoryDescriptor &query_mem_desc, const bool deferred, const Executor *executor)
int64_t allocateCountDistinctBitmap(const size_t bitmap_byte_sz)
int64_t allocateCountDistinctSet()
std::vector<QueryMemoryInitializer::QuantileParam> allocateTDigests(const QueryMemoryDescriptor &query_mem_desc, const bool deferred, const Executor *executor)
GpuGroupByBuffers prepareTopNHeapsDevBuffer(const QueryMemoryDescriptor &query_mem_desc, const int8_t *init_agg_vals_dev_ptr, const size_t n, const int device_id, const unsigned block_size_x, const unsigned grid_size_x)
GpuGroupByBuffers createAndInitializeGroupByBufferGpu(const RelAlgExecutionUnit &ra_exe_unit, const QueryMemoryDescriptor &query_mem_desc, const int8_t *init_agg_vals_dev_ptr, const int device_id, const ExecutorDispatchMode dispatch_mode, const unsigned block_size_x, const unsigned grid_size_x, const int8_t warp_size, const bool can_sort_on_gpu, const bool output_columnar, RenderAllocator *render_allocator)
size_t computeNumberOfBuffers(const QueryMemoryDescriptor &query_mem_desc, const ExecutorDeviceType device_type, const Executor *executor) const
void compactProjectionBuffersCpu(const QueryMemoryDescriptor &query_mem_desc, const size_t projection_count)
void compactProjectionBuffersGpu(const QueryMemoryDescriptor &query_mem_desc, Data_Namespace::DataMgr *data_mgr, const GpuGroupByBuffers &gpu_group_by_buffers, const size_t projection_count, const int device_id)
void applyStreamingTopNOffsetCpu(const QueryMemoryDescriptor &query_mem_desc, const RelAlgExecutionUnit &ra_exe_unit)
void applyStreamingTopNOffsetGpu(Data_Namespace::DataMgr *data_mgr, const QueryMemoryDescriptor &query_mem_desc, const GpuGroupByBuffers &gpu_group_by_buffers, const RelAlgExecutionUnit &ra_exe_unit, const unsigned total_thread_count, const int device_id)
std::shared_ptr<VarlenOutputInfo> getVarlenOutputInfo()

Private Members

const int64_t num_rows_
std::shared_ptr<RowSetMemoryOwner> row_set_mem_owner_
std::vector<std::unique_ptr<ResultSet>> result_sets_
std::vector<int64_t> init_agg_vals_
size_t num_buffers_
std::vector<int64_t *> group_by_buffers_
std::shared_ptr<VarlenOutputInfo> varlen_output_info_
CUdeviceptr varlen_output_buffer_
int8_t *varlen_output_buffer_host_ptr_
CUdeviceptr count_distinct_bitmap_mem_
size_t count_distinct_bitmap_mem_bytes_
int8_t *count_distinct_bitmap_crt_ptr_
int8_t *count_distinct_bitmap_host_mem_
DeviceAllocator *device_allocator_ = {nullptr}
std::vector<Data_Namespace::AbstractBuffer *> temporary_buffers_
const size_t thread_idx_

Friends

friend QueryMemoryInitializer::Executor
friend QueryMemoryInitializer::QueryExecutionContext