OmniSciDB  c07336695a
JoinHashImpl.h File Reference
#include <cstdint>
#include "../Shared/funcannotations.h"
#include "../Shared/shard_key.h"
+ Include dependency graph for JoinHashImpl.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

ALWAYS_INLINE DEVICE int32_t *SUFFIX() get_bucketized_hash_slot (int32_t *buff, const int64_t key, const int64_t min_key, const int64_t bucket_normalization)
 
ALWAYS_INLINE DEVICE int32_t *SUFFIX() get_hash_slot (int32_t *buff, const int64_t key, const int64_t min_key)
 
ALWAYS_INLINE DEVICE int32_t *SUFFIX() get_bucketized_hash_slot_sharded (int32_t *buff, const int64_t key, const int64_t min_key, const uint32_t entry_count_per_shard, const uint32_t num_shards, const uint32_t device_count, const int64_t bucket_normalization)
 
ALWAYS_INLINE DEVICE int32_t *SUFFIX() get_hash_slot_sharded (int32_t *buff, const int64_t key, const int64_t min_key, const uint32_t entry_count_per_shard, const uint32_t num_shards, const uint32_t device_count)
 

Function Documentation

◆ get_bucketized_hash_slot()

ALWAYS_INLINE DEVICE int32_t* SUFFIX() get_bucketized_hash_slot ( int32_t *  buff,
const int64_t  key,
const int64_t  min_key,
const int64_t  bucket_normalization 
)

Definition at line 31 of file JoinHashImpl.h.

Referenced by bucketized_hash_join_idx(), count_matches_bucketized(), fill_hash_join_buff_bucketized(), and fill_row_ids_bucketized().

35  {
36  return buff + (key - min_key) / bucket_normalization;
37 }
+ Here is the caller graph for this function:

◆ get_bucketized_hash_slot_sharded()

ALWAYS_INLINE DEVICE int32_t* SUFFIX() get_bucketized_hash_slot_sharded ( int32_t *  buff,
const int64_t  key,
const int64_t  min_key,
const uint32_t  entry_count_per_shard,
const uint32_t  num_shards,
const uint32_t  device_count,
const int64_t  bucket_normalization 
)

Definition at line 45 of file JoinHashImpl.h.

References SHARD_FOR_KEY.

Referenced by fill_hash_join_buff_sharded_bucketized(), and fill_row_ids_sharded_bucketized().

52  {
53  const uint32_t shard = SHARD_FOR_KEY(key, num_shards);
54  const uint32_t shard_buffer_index =
55  shard / device_count; // shard sub-buffer index within `buff`
56  int32_t* shard_buffer = buff + shard_buffer_index * entry_count_per_shard;
57  return shard_buffer + (key - min_key) / bucket_normalization / num_shards;
58 }
#define SHARD_FOR_KEY(key, num_shards)
Definition: shard_key.h:20
+ Here is the caller graph for this function:

◆ get_hash_slot()

ALWAYS_INLINE DEVICE int32_t* SUFFIX() get_hash_slot ( int32_t *  buff,
const int64_t  key,
const int64_t  min_key 
)

Definition at line 39 of file JoinHashImpl.h.

Referenced by count_matches(), fill_hash_join_buff(), fill_row_ids(), and hash_join_idx().

41  {
42  return buff + (key - min_key);
43 }
+ Here is the caller graph for this function:

◆ get_hash_slot_sharded()

ALWAYS_INLINE DEVICE int32_t* SUFFIX() get_hash_slot_sharded ( int32_t *  buff,
const int64_t  key,
const int64_t  min_key,
const uint32_t  entry_count_per_shard,
const uint32_t  num_shards,
const uint32_t  device_count 
)

Definition at line 60 of file JoinHashImpl.h.

References SHARD_FOR_KEY.

Referenced by count_matches_sharded(), fill_hash_join_buff_sharded(), fill_row_ids_sharded(), and hash_join_idx_sharded().

66  {
67  const uint32_t shard = SHARD_FOR_KEY(key, num_shards);
68  const uint32_t shard_buffer_index =
69  shard / device_count; // shard sub-buffer index within `buff`
70  int32_t* shard_buffer = buff + shard_buffer_index * entry_count_per_shard;
71  return shard_buffer + (key - min_key) / num_shards;
72 }
#define SHARD_FOR_KEY(key, num_shards)
Definition: shard_key.h:20
+ Here is the caller graph for this function: