OmniSciDB  c1a53651b2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BaselineHashTable Class Reference

#include <BaselineHashTable.h>

+ Inheritance diagram for BaselineHashTable:
+ Collaboration diagram for BaselineHashTable:

Public Member Functions

 BaselineHashTable (HashType layout, const size_t entry_count, const size_t emitted_keys_count, const size_t hash_table_size)
 
 BaselineHashTable (Data_Namespace::DataMgr *data_mgr, HashType layout, const size_t entry_count, const size_t emitted_keys_count, const size_t hash_table_size, const size_t device_id)
 
 ~BaselineHashTable () override
 
int8_t * getGpuBuffer () const override
 
size_t getHashTableBufferSize (const ExecutorDeviceType device_type) const override
 
int8_t * getCpuBuffer () override
 
HashType getLayout () const override
 
size_t getEntryCount () const override
 
size_t getEmittedKeysCount () const override
 
- Public Member Functions inherited from HashTable
virtual ~HashTable ()
 

Private Attributes

std::unique_ptr< int8_t[]> cpu_hash_table_buff_
 
size_t cpu_hash_table_buff_size_
 
Data_Namespace::AbstractBuffergpu_hash_table_buff_
 
HashType layout_
 
size_t entry_count_
 
size_t emitted_keys_count_
 

Additional Inherited Members

- Static Public Member Functions inherited from HashTable
static DecodedJoinHashBufferSet toSet (size_t key_component_count, size_t key_component_width, size_t entry_count, const int8_t *ptr1, const int8_t *ptr2, const int8_t *ptr3, const int8_t *ptr4, size_t buffer_size)
 Decode hash table into a std::set for easy inspection and validation. More...
 
static std::string toString (const std::string &type, const std::string &layout_type, size_t key_component_count, size_t key_component_width, size_t entry_count, const int8_t *ptr1, const int8_t *ptr2, const int8_t *ptr3, const int8_t *ptr4, size_t buffer_size, bool raw=false)
 Decode hash table into a human-readable string. More...
 

Detailed Description

Definition at line 26 of file BaselineHashTable.h.

Constructor & Destructor Documentation

BaselineHashTable::BaselineHashTable ( HashType  layout,
const size_t  entry_count,
const size_t  emitted_keys_count,
const size_t  hash_table_size 
)
inline

Definition at line 29 of file BaselineHashTable.h.

References cpu_hash_table_buff_, and cpu_hash_table_buff_size_.

33  : cpu_hash_table_buff_size_(hash_table_size)
34  , gpu_hash_table_buff_(nullptr)
35 #ifdef HAVE_CUDA
36  , device_id_(0)
37  , data_mgr_(nullptr)
38 #endif
39  , layout_(layout)
40  , entry_count_(entry_count)
41  , emitted_keys_count_(emitted_keys_count) {
43  }
std::unique_ptr< int8_t[]> cpu_hash_table_buff_
Data_Namespace::AbstractBuffer * gpu_hash_table_buff_
data_mgr_(data_mgr)
BaselineHashTable::BaselineHashTable ( Data_Namespace::DataMgr data_mgr,
HashType  layout,
const size_t  entry_count,
const size_t  emitted_keys_count,
const size_t  hash_table_size,
const size_t  device_id 
)
inline

Definition at line 46 of file BaselineHashTable.h.

References CudaAllocator::allocGpuAbstractBuffer(), CHECK, data_mgr_(), gpu_hash_table_buff_, and UNREACHABLE.

52  : gpu_hash_table_buff_(nullptr)
53 #ifdef HAVE_CUDA
54  , device_id_(device_id)
55  , data_mgr_(data_mgr)
56 #endif
57  , layout_(layout)
58  , entry_count_(entry_count)
59  , emitted_keys_count_(emitted_keys_count) {
60 #ifdef HAVE_CUDA
61  CHECK(data_mgr_);
63  CudaAllocator::allocGpuAbstractBuffer(data_mgr_, hash_table_size, device_id_);
64 #else
65  UNREACHABLE();
66 #endif
67  }
#define UNREACHABLE()
Definition: Logger.h:337
Data_Namespace::AbstractBuffer * gpu_hash_table_buff_
static Data_Namespace::AbstractBuffer * allocGpuAbstractBuffer(Data_Namespace::DataMgr *data_mgr, const size_t num_bytes, const int device_id)
data_mgr_(data_mgr)
#define CHECK(condition)
Definition: Logger.h:291

+ Here is the call graph for this function:

BaselineHashTable::~BaselineHashTable ( )
inlineoverride

Definition at line 69 of file BaselineHashTable.h.

References CHECK, data_mgr_(), and gpu_hash_table_buff_.

69  {
70 #ifdef HAVE_CUDA
74  }
75 #endif
76  }
Data_Namespace::AbstractBuffer * gpu_hash_table_buff_
data_mgr_(data_mgr)
#define CHECK(condition)
Definition: Logger.h:291

+ Here is the call graph for this function:

Member Function Documentation

int8_t* BaselineHashTable::getCpuBuffer ( )
inlineoverridevirtual

Implements HashTable.

Definition at line 91 of file BaselineHashTable.h.

References cpu_hash_table_buff_.

91  {
92  return reinterpret_cast<int8_t*>(cpu_hash_table_buff_.get());
93  }
std::unique_ptr< int8_t[]> cpu_hash_table_buff_
size_t BaselineHashTable::getEmittedKeysCount ( ) const
inlineoverridevirtual

Implements HashTable.

Definition at line 97 of file BaselineHashTable.h.

References emitted_keys_count_.

97 { return emitted_keys_count_; }
size_t BaselineHashTable::getEntryCount ( ) const
inlineoverridevirtual

Implements HashTable.

Definition at line 96 of file BaselineHashTable.h.

References entry_count_.

96 { return entry_count_; }
int8_t* BaselineHashTable::getGpuBuffer ( ) const
inlineoverridevirtual

Implements HashTable.

Definition at line 78 of file BaselineHashTable.h.

References Data_Namespace::AbstractBuffer::getMemoryPtr(), and gpu_hash_table_buff_.

78  {
80  }
virtual int8_t * getMemoryPtr()=0
Data_Namespace::AbstractBuffer * gpu_hash_table_buff_

+ Here is the call graph for this function:

size_t BaselineHashTable::getHashTableBufferSize ( const ExecutorDeviceType  device_type) const
inlineoverridevirtual

Implements HashTable.

Definition at line 82 of file BaselineHashTable.h.

References CPU, cpu_hash_table_buff_, cpu_hash_table_buff_size_, gpu_hash_table_buff_, and Data_Namespace::AbstractBuffer::reservedSize().

82  {
83  if (device_type == ExecutorDeviceType::CPU) {
85  sizeof(decltype(cpu_hash_table_buff_)::element_type);
86  } else {
88  }
89  }
virtual size_t reservedSize() const =0
std::unique_ptr< int8_t[]> cpu_hash_table_buff_
Data_Namespace::AbstractBuffer * gpu_hash_table_buff_

+ Here is the call graph for this function:

HashType BaselineHashTable::getLayout ( ) const
inlineoverridevirtual

Implements HashTable.

Definition at line 95 of file BaselineHashTable.h.

References layout_.

95 { return layout_; }

Member Data Documentation

std::unique_ptr<int8_t[]> BaselineHashTable::cpu_hash_table_buff_
private

Definition at line 100 of file BaselineHashTable.h.

Referenced by BaselineHashTable(), getCpuBuffer(), and getHashTableBufferSize().

size_t BaselineHashTable::cpu_hash_table_buff_size_
private

Definition at line 101 of file BaselineHashTable.h.

Referenced by BaselineHashTable(), and getHashTableBufferSize().

size_t BaselineHashTable::emitted_keys_count_
private

Definition at line 111 of file BaselineHashTable.h.

Referenced by getEmittedKeysCount().

size_t BaselineHashTable::entry_count_
private

Definition at line 110 of file BaselineHashTable.h.

Referenced by getEntryCount().

Data_Namespace::AbstractBuffer* BaselineHashTable::gpu_hash_table_buff_
private
HashType BaselineHashTable::layout_
private

Definition at line 109 of file BaselineHashTable.h.

Referenced by getLayout().


The documentation for this class was generated from the following file: