LSLab
slab_node.h
1 #include "../lslab.h"
2 #include <atomic>
3 #include <cub/util_ptx.cuh>
4 #include <type_traits>
5 #include <cuda/atomic>
6 
7 #pragma once
8 
9 namespace lslab {
10 
11 namespace detail {
12 
13 template<typename K_, typename V_>
14 struct slab_node {
15  using K = K_; //typename std::conditional<sizeof(K_) < sizeof(uint64_t), uint64_t, K_>::type;
16  using V = V_;
17  //static_assert(alignof(K) % alignof(void*) == 0, "Alignment must be a multiple of pointer alignment");
18 
19  // whether it is empty or not
20  alignas(32) uint32_t valid = 0;
21  K key[31];
22  slab_node<K, V>* next = nullptr;
23  V value[32];
24 };
25 
26 template<typename K_>
27 struct set_node {
28  using K = K_; //typename std::conditional<sizeof(K_) < sizeof(uint64_t), uint64_t, K_>::type;
29  //static_assert(alignof(K) % alignof(void*) == 0, "Alignment must be a multiple of pointer alignment");
30 
31  // whether it is empty or not
32  alignas(32) uint32_t valid = 0;
33  K key[31];
34  set_node<K>* next = nullptr;
35 };
36 
37 }
38 }
Definition: slab_node.h:27
Definition: slab_node.h:14