OmniSciDB  04ee39c94c
streaming_top_n Namespace Reference

Functions

size_t get_heap_size (const size_t row_size, const size_t n, const size_t thread_count)
 
size_t get_rows_offset_of_heaps (const size_t n, const size_t thread_count)
 
std::vector< int8_t > get_rows_copy_from_heaps (const int64_t *heaps, const size_t heaps_size, const size_t n, const size_t thread_count)
 

Function Documentation

◆ get_heap_size()

size_t streaming_top_n::get_heap_size ( const size_t  row_size,
const size_t  n,
const size_t  thread_count 
)

Definition at line 23 of file StreamingTopN.cpp.

Referenced by QueryMemoryInitializer::allocateCountDistinctSet(), QueryMemoryInitializer::copyGroupByBuffersFromGpu(), and QueryMemoryDescriptor::getBufferSizeBytes().

23  {
24  const auto row_size_quad = row_size / sizeof(int64_t);
25  return (1 + n + row_size_quad * n) * thread_count * sizeof(int64_t);
26 }
+ Here is the caller graph for this function:

◆ get_rows_copy_from_heaps()

std::vector< int8_t > streaming_top_n::get_rows_copy_from_heaps ( const int64_t *  heaps,
const size_t  heaps_size,
const size_t  n,
const size_t  thread_count 
)

Definition at line 32 of file StreamingTopN.cpp.

References get_rows_offset_of_heaps().

Referenced by QueryMemoryInitializer::applyStreamingTopNOffsetCpu().

35  {
36  const auto rows_offset = streaming_top_n::get_rows_offset_of_heaps(n, thread_count);
37  const auto row_buff_size = heaps_size - rows_offset;
38  std::vector<int8_t> rows_copy(row_buff_size);
39  const auto rows_ptr = reinterpret_cast<const int8_t*>(heaps) + rows_offset;
40  std::memcpy(&rows_copy[0], rows_ptr, row_buff_size);
41  return rows_copy;
42 }
size_t get_rows_offset_of_heaps(const size_t n, const size_t thread_count)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_rows_offset_of_heaps()

size_t streaming_top_n::get_rows_offset_of_heaps ( const size_t  n,
const size_t  thread_count 
)

Definition at line 28 of file StreamingTopN.cpp.

Referenced by QueryMemoryInitializer::allocateCountDistinctSet(), get_rows_copy_from_heaps(), and QueryMemoryInitializer::QueryMemoryInitializer().

28  {
29  return (1 + n) * thread_count * sizeof(int64_t);
30 }
+ Here is the caller graph for this function: