OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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

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 24 of file StreamingTopN.cpp.

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

24  {
25  const auto row_size_quad = row_size / sizeof(int64_t);
26  return (1 + n + row_size_quad * n) * thread_count * sizeof(int64_t);
27 }
constexpr double n
Definition: Utm.h:38

+ Here is the caller graph for this function:

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 33 of file StreamingTopN.cpp.

References get_rows_offset_of_heaps().

Referenced by QueryMemoryInitializer::applyStreamingTopNOffsetCpu().

36  {
37  const auto rows_offset = streaming_top_n::get_rows_offset_of_heaps(n, thread_count);
38  const auto row_buff_size = heaps_size - rows_offset;
39  std::vector<int8_t> rows_copy(row_buff_size);
40  const auto rows_ptr = reinterpret_cast<const int8_t*>(heaps) + rows_offset;
41  std::memcpy(&rows_copy[0], rows_ptr, row_buff_size);
42  return rows_copy;
43 }
size_t get_rows_offset_of_heaps(const size_t n, const size_t thread_count)
constexpr double n
Definition: Utm.h:38

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 29 of file StreamingTopN.cpp.

Referenced by get_rows_copy_from_heaps(), QueryMemoryInitializer::initGroupByBuffer(), pop_n_rows_from_merged_heaps_gpu(), and QueryMemoryInitializer::prepareTopNHeapsDevBuffer().

29  {
30  return (1 + n) * thread_count * sizeof(int64_t);
31 }
constexpr double n
Definition: Utm.h:38

+ Here is the caller graph for this function: