OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BufferCompaction.h File Reference

Macros and functions for groupby buffer compaction. More...

#include <cstdint>
#include "../Shared/funcannotations.h"
#include <algorithm>
+ Include dependency graph for BufferCompaction.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

unsigned compact_byte_width (unsigned qw, unsigned low_bound)
 
template<typename T >
FORCE_INLINE HOST DEVICEalign_to_int64 (T addr)
 
template<size_t N, typename T >
FORCE_INLINE HOST DEVICEalign_to (T const val)
 

Variables

constexpr int8_t MAX_BYTE_WIDTH_SUPPORTED = 8
 

Detailed Description

Macros and functions for groupby buffer compaction.

Definition in file BufferCompaction.h.

Function Documentation

template<size_t N, typename T >
FORCE_INLINE HOST DEVICE T align_to ( T const  val)

Definition at line 50 of file BufferCompaction.h.

References anonymous_namespace{Utm.h}::N, and heavydb.dtypes::T.

50  {
51  constexpr T mask = static_cast<T>(N - 1);
52  static_assert(N && (N & mask) == 0, "N must be a power of 2.");
53  return (val + mask) & ~mask;
54 }
constexpr unsigned N
Definition: Utm.h:110
template<typename T >
FORCE_INLINE HOST DEVICE T align_to_int64 ( addr)

Definition at line 42 of file BufferCompaction.h.

References heavydb.dtypes::T.

Referenced by ColSlotContext::alignPaddedSlots(), TableFunctionManager::allocate_output_buffers(), CountDistinctDescriptor::bitmapPaddedSizeBytes(), compact_init_vals(), anonymous_namespace{QueryMemoryInitializer.cpp}::compact_projection_buffer_for_cpu_columnar(), copy_projection_buffer_from_gpu_columnar(), QueryMemoryInitializer::copyFromTableFunctionGpuBuffers(), create_dev_group_by_buffers(), ResultSet::eachCellInColumn(), anonymous_namespace{ResultSetSortImpl.cu}::get_device_copy_ptr(), get_matching_group_value(), get_row_bytes(), get_slot_off_quad(), ColSlotContext::getAlignedPaddedSizeForRange(), QueryMemoryDescriptor::getBufferSizeBytes(), QueryMemoryDescriptor::getColOffInBytes(), ColSlotContext::getColOnlyOffInBytes(), QueryMemoryDescriptor::getNextColOffInBytes(), QueryMemoryDescriptor::getNextColOffInBytesRowOnly(), ResultSet::getOneColRow(), QueryMemoryDescriptor::getPaddedSlotBufferSize(), QueryMemoryDescriptor::getPrependedGroupBufferSizeInBytes(), QueryMemoryDescriptor::getPrependedGroupColOffInBytes(), QueryMemoryDescriptor::getRowSize(), ColSlotContext::getTotalBytesOfColumnarBuffers(), init_columnar_group_by_buffer_gpu_impl(), anonymous_namespace{GroupByAndAggregate.cpp}::init_count_distinct_descriptors(), init_group_by_buffer_gpu(), QueryMemoryInitializer::initColumnarGroups(), ResultSetStorage::initializeRowWise(), GroupByAndAggregate::initQueryMemoryDescriptor(), inplace_sort_gpu(), TableFunctionExecutionContext::launchCpuCode(), QueryExecutionContext::launchCpuCode(), ResultSetReductionJIT::reduceOneEntryNoCollisions(), ResultSetStorage::rewriteAggregateBufferOffsets(), QueryMemoryInitializer::setupTableFunctionGpuBuffers(), and thread_idx_().

42  {
43  addr += sizeof(int64_t) - 1;
44  return (T)(((uint64_t)addr >> 3) << 3);
45 }

+ Here is the caller graph for this function:

unsigned compact_byte_width ( unsigned  qw,
unsigned  low_bound 
)
inline

Definition at line 36 of file BufferCompaction.h.

Referenced by get_agg_initial_val().

36  {
37  return std::max(qw, low_bound);
38 }

+ Here is the caller graph for this function:

Variable Documentation

constexpr int8_t MAX_BYTE_WIDTH_SUPPORTED = 8