Skip to content
This repository was archived by the owner on May 9, 2024. It is now read-only.

ResultSet refactoring and clean-up [02/N] #214

Merged
merged 1 commit into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions omniscidb/QueryEngine/AggregateUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
#ifndef QUERYENGINE_AGGREGATEUTILS_H
#define QUERYENGINE_AGGREGATEUTILS_H

#include "../Shared/sqltypes.h"
#include "BufferCompaction.h"
#include "TypePunning.h"

#include "Logger/Logger.h"
#include "Shared/BufferCompaction.h"
#include "Shared/sqltypes.h"

inline void set_component(int8_t* group_by_buffer,
const size_t comp_sz,
Expand Down
3 changes: 1 addition & 2 deletions omniscidb/QueryEngine/Descriptors/ColSlotContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@

#include "ColSlotContext.h"

#include "../BufferCompaction.h"

#include <IR/Expr.h>
#include <Shared/SqlTypesLayout.h>
#include "Shared/BufferCompaction.h"

#include <numeric>
#include <stdexcept>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
#ifndef QUERYENGINE_COUNTDISTINCTDESCRIPTOR_H
#define QUERYENGINE_COUNTDISTINCTDESCRIPTOR_H

#include "../BufferCompaction.h"
#include "../CompilationOptions.h"
#include "Logger/Logger.h"
#include "Shared/BufferCompaction.h"

inline size_t bitmap_bits_to_bytes(const size_t bitmap_sz) {
size_t bitmap_byte_sz = bitmap_sz / 8;
Expand Down
1 change: 0 additions & 1 deletion omniscidb/QueryEngine/Execute.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@

#include "BufferProvider/BufferProvider.h"
#include "QueryEngine/AggregatedColRange.h"
#include "QueryEngine/BufferCompaction.h"
#include "QueryEngine/CartesianProduct.h"
#include "QueryEngine/CgenState.h"
#include "QueryEngine/CodeCache.h"
Expand Down
3 changes: 2 additions & 1 deletion omniscidb/QueryEngine/GpuInitGroups.cu
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#include "BufferCompaction.h"
#include "GpuInitGroups.h"
#include "GpuRtConstants.h"

#include "Shared/BufferCompaction.h"

template <typename T>
__device__ int8_t* init_columnar_buffer(T* buffer_ptr,
const T init_val,
Expand Down
2 changes: 2 additions & 0 deletions omniscidb/QueryEngine/HyperLogLogRank.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include <intrin.h>
#endif

#include <algorithm>

#ifdef __CUDACC__
inline __device__ int32_t get_rank(uint64_t x, uint32_t b) {
return min(b, static_cast<uint32_t>(x ? __clzll(x) : 64)) + 1;
Expand Down
2 changes: 1 addition & 1 deletion omniscidb/QueryEngine/OutputBufferInitialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
*/

#include "OutputBufferInitialization.h"
#include "BufferCompaction.h"
#include "Descriptors/QueryMemoryDescriptor.h"
#include "TypePunning.h"

#include "../Analyzer/Analyzer.h"
#include "Shared/BufferCompaction.h"

std::vector<int64_t> init_agg_val_vec(const std::vector<TargetInfo>& targets,
const QueryMemoryDescriptor& query_mem_desc) {
Expand Down
2 changes: 1 addition & 1 deletion omniscidb/QueryEngine/ResultSetBufferAccessors.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#ifndef QUERYENGINE_RESULTSETBUFFERACCESSORS_H
#define QUERYENGINE_RESULTSETBUFFERACCESSORS_H

#include "BufferCompaction.h"
#include "Shared/BufferCompaction.h"
#include "Shared/SqlTypesLayout.h"
#include "Shared/misc.h"
#include "TypePunning.h"
Expand Down
11 changes: 7 additions & 4 deletions omniscidb/QueryEngine/ResultSetSortImpl.cu
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#include "BufferCompaction.h"
#include "GpuMemUtils.h"
#include "GpuRtConstants.h"
#include "ResultSetBufferAccessors.h"
#include "ResultSetSortImpl.h"
#include "SortUtils.cuh"

#include "Shared/BufferCompaction.h"

#include <thrust/copy.h>
#include <thrust/execution_policy.h>
#include <thrust/host_vector.h>
Expand Down Expand Up @@ -136,8 +137,9 @@ std::vector<uint32_t> baseline_sort_fp(const ExecutorDeviceType device_type,
pos_oe_col_buffer.reserve(slice_entry_count);
size_t oe_col_buffer_idx = 0;
const auto& oe_info = layout.oe_target_info;
const auto col_type =
oe_info.agg_kind == hdk::ir::AggType::kAvg ? oe_info.type->ctx().fp64() : oe_info.type;
const auto col_type = oe_info.agg_kind == hdk::ir::AggType::kAvg
? oe_info.type->ctx().fp64()
: oe_info.type;
// Execlude AVG b/c collect_order_entry_column already makes its pair collapse into a
// double
const bool float_argument_input =
Expand Down Expand Up @@ -346,7 +348,8 @@ std::vector<uint32_t> baseline_sort(const ExecutorDeviceType device_type,
auto oe_col_buffer = collect_order_entry_column<K>(groupby_buffer, layout, start, step);
auto entry_type = get_compact_type(layout.oe_target_info);
CHECK(entry_type->isNumber());
if (entry_type->isFloatingPoint() || layout.oe_target_info.agg_kind == hdk::ir::AggType::kAvg) {
if (entry_type->isFloatingPoint() ||
layout.oe_target_info.agg_kind == hdk::ir::AggType::kAvg) {
return baseline_sort_fp<K>(device_type,
device_id,
buffer_provider,
Expand Down
1 change: 0 additions & 1 deletion omniscidb/QueryEngine/RowFuncBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

#include "IR/Expr.h"
#include "Logger/Logger.h"
#include "QueryEngine/BufferCompaction.h"
#include "QueryEngine/ColumnarResults.h"
#include "QueryEngine/CompilationOptions.h"
#include "QueryEngine/GpuMemUtils.h"
Expand Down
4 changes: 2 additions & 2 deletions omniscidb/QueryEngine/RuntimeFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
#endif // __CUDACC__

#include "RuntimeFunctions.h"
#include "../Shared/funcannotations.h"
#include "BufferCompaction.h"
#include "HyperLogLogRank.h"
#include "MurmurHash.h"
#include "Shared/BufferCompaction.h"
#include "Shared/funcannotations.h"
#include "Shared/quantile.h"
#include "TypePunning.h"

Expand Down
2 changes: 1 addition & 1 deletion omniscidb/QueryEngine/cuda_mapd_rt.cu
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
#include <stdint.h>
#include <stdio.h>
#include <limits>
#include "BufferCompaction.h"
#include "ExtensionFunctions.hpp"
#include "GpuRtConstants.h"
#include "HyperLogLogRank.h"
#include "Shared/BufferCompaction.h"
#include "gen-cpp/TableFunctionsFactory_init_gpu.hpp"

#if CUDA_VERSION < 10000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#define BUFFER_COMPACTION_H

#include <cstdint>
#include "../Shared/funcannotations.h"
#include "funcannotations.h"

#ifndef __CUDACC__
#include <algorithm>
Expand Down