29 const uint64_t entry_count,
31 const uint32_t chosen_bytes) {
33 switch (chosen_bytes) {
38 sort_on_cpu(val_buff, idx_buff, entry_count, desc, chosen_bytes);
48 const uint64_t entry_count,
50 const uint32_t chosen_bytes) {
52 switch (chosen_bytes) {
69 const uint64_t entry_count,
71 const uint32_t chosen_bytes,
73 const int device_id) {
75 switch (chosen_bytes) {
80 sort_on_gpu(val_buff, idx_buff, entry_count, desc, chosen_bytes, alloc, device_id);
90 const uint64_t entry_count,
91 const uint32_t chosen_bytes,
93 const int device_id) {
95 switch (chosen_bytes) {
101 val_buff, idx_buff, entry_count, chosen_bytes, alloc, device_id);
115 const int device_id) {
117 CHECK_EQ(
size_t(1), order_entries.size());
118 const auto idx_buff = group_by_buffers.
data -
120 for (
const auto& order_entry : order_entries) {
121 const auto target_idx = order_entry.tle_no - 1;
122 const auto val_buff =
126 reinterpret_cast<int32_t*>(idx_buff),
134 reinterpret_cast<int32_t*>(idx_buff),
140 for (
size_t target_idx = 0; target_idx < query_mem_desc.
getSlotCount();
142 if (static_cast<int>(target_idx) == order_entry.tle_no - 1) {
146 const auto val_buff =
149 reinterpret_cast<int32_t*>(idx_buff),
Defines data structures for the semantic analysis phase of query processing.
size_t getSlotCount() const
void sort_groups_cpu(int64_t *val_buff, int32_t *idx_buff, const uint64_t entry_count, const bool desc, const uint32_t chosen_bytes)
void sort_groups_gpu(int64_t *val_buff, int32_t *idx_buff, const uint64_t entry_count, const bool desc, const uint32_t chosen_bytes, ThrustAllocator &alloc, const int device_id)
size_t getEntryCount() const
void sort_on_gpu(int64_t *val_buff, int32_t *idx_buff, const uint64_t entry_count, const bool desc, const uint32_t chosen_bytes, ThrustAllocator &alloc, const int device_id)
void sort_on_cpu(int64_t *val_buff, int32_t *idx_buff, const uint64_t entry_count, const bool desc, const uint32_t chosen_bytes)
bool hasKeylessHash() const
void inplace_sort_gpu(const std::list< Analyzer::OrderEntry > &order_entries, const QueryMemoryDescriptor &query_mem_desc, const GpuGroupByBuffers &group_by_buffers, Data_Namespace::DataMgr *data_mgr, const int device_id)
void apply_permutation_cpu(int64_t *val_buff, int32_t *idx_buff, const uint64_t entry_count, int64_t *tmp_buff, const uint32_t chosen_bytes)
const int8_t getPaddedSlotWidthBytes(const size_t slot_idx) const
Descriptor for the result set buffer layout.
void apply_permutation_on_gpu(int64_t *val_buff, int32_t *idx_buff, const uint64_t entry_count, const uint32_t chosen_bytes, ThrustAllocator &alloc, const int device_id)
void apply_permutation_gpu(int64_t *val_buff, int32_t *idx_buff, const uint64_t entry_count, const uint32_t chosen_bytes, ThrustAllocator &alloc, const int device_id)
void apply_permutation_on_cpu(int64_t *val_buff, int32_t *idx_buff, const uint64_t entry_count, int64_t *tmp_buff, const uint32_t chosen_bytes)
size_t getColOffInBytes(const size_t col_idx) const
FORCE_INLINE HOST DEVICE T align_to_int64(T addr)