From 4e02041bb14d92d8e724bd81430f8f48658c37ca Mon Sep 17 00:00:00 2001 From: KunoiSayami Date: Mon, 13 Dec 2021 21:53:55 +0800 Subject: test(skiplist): Add more test Signed-off-by: KunoiSayami --- db/skiplist.cuh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'db/skiplist.cuh') diff --git a/db/skiplist.cuh b/db/skiplist.cuh index 8fe864a..a285b8e 100644 --- a/db/skiplist.cuh +++ b/db/skiplist.cuh @@ -77,11 +77,11 @@ class SkipList { // Advances to the next position. // REQUIRES: Valid() - void Next(); + __device__ void Next(); // Advances to the previous position. // REQUIRES: Valid() - void Prev(); + __device__ void Prev(); // Advance to the first entry with a key >= target __device__ void Seek(const Key& target); @@ -123,11 +123,11 @@ class SkipList { // Return the latest node with a key < key. // Return head_ if there is no such node. - Node* FindLessThan(const Key& key) const; + __device__ Node* FindLessThan(const Key& key) const; // Return the last node in the list. // Return head_ if list is empty. - Node* FindLast() const; + __device__ Node* FindLast() const; // Immutable after construction Comparator const compare_; @@ -226,13 +226,13 @@ __device__ inline const Key& SkipList::Iterator::key() const { } template -inline void SkipList::Iterator::Next() { +__device__ inline void SkipList::Iterator::Next() { assert(Valid()); node_ = node_->Next(0); } template -inline void SkipList::Iterator::Prev() { +__device__ inline void SkipList::Iterator::Prev() { // Instead of using explicit "prev" links, we just search for the // last node that falls before key. assert(Valid()); @@ -304,7 +304,7 @@ __device__ SkipList::FindGreaterOrEqual(const Key& key, template typename SkipList::Node* -SkipList::FindLessThan(const Key& key) const { +__device__ SkipList::FindLessThan(const Key& key) const { Node* x = head_; int level = GetMaxHeight() - 1; while (true) { @@ -324,7 +324,7 @@ SkipList::FindLessThan(const Key& key) const { } template -typename SkipList::Node* SkipList::FindLast() +__device__ typename SkipList::Node* SkipList::FindLast() const { Node* x = head_; int level = GetMaxHeight() - 1; -- cgit v1.3.1