OmniSciDB  a47db9e897
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 23 of file StreamingTopN.cpp.

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

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:

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:

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 get_rows_copy_from_heaps(), pop_n_rows_from_merged_heaps_gpu(), and QueryMemoryInitializer::QueryMemoryInitializer().

28  {
29  return (1 + n) * thread_count * sizeof(int64_t);
30 }

+ Here is the caller graph for this function: