diff options
| author | KunoiSayami <[email protected]> | 2021-12-03 20:22:07 +0800 |
|---|---|---|
| committer | KunoiSayami <[email protected]> | 2021-12-03 20:22:07 +0800 |
| commit | a2a9e40d917e3a932e5f563743a0f908f38ac2c6 (patch) | |
| tree | 25f27381453b3effd914937b7bb58736df5242bc /db/skiplist.cuh | |
| parent | 8316f42c232a7cbfa6c77de85d0001d144d61561 (diff) | |
fix(skiplist): Fix constructor
Signed-off-by: KunoiSayami <[email protected]>
Diffstat (limited to 'db/skiplist.cuh')
| -rw-r--r-- | db/skiplist.cuh | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/db/skiplist.cuh b/db/skiplist.cuh index 2520a13..4fcd220 100644 --- a/db/skiplist.cuh +++ b/db/skiplist.cuh @@ -150,22 +150,26 @@ struct SkipList<Key, Comparator>::Node { Key const key; - explicit __device__ Node(const Key& k): key(k) {} + explicit __device__ __host__ Node(const Key& k): key(k) {} - __device__ void* operator new(size_t bytes) { + __device__ __host__ void* operator new(size_t bytes) { Node * ptr = nullptr; cudaMalloc((void**)&ptr, bytes); return ptr; } - __device__ void* operator new(size_t bytes, void * const ptr) { + __device__ __host__ void* operator new(size_t _bytes, void * const ptr) { return ptr; } - __device__ void operator delete(void *ptr) { + __device__ __host__ void operator delete(void *ptr) { cudaFree(ptr); } + __device__ __host__ void operator delete(void *_ptr, void *_ptr2) { + // DO NOTHING HERE + } + // Accessors/mutators for links. Wrapped in methods so we can // add the appropriate barriers as necessary. __device__ Node* Next(int n) { |
