aboutsummaryrefslogtreecommitdiff
path: root/db/skiplist.cuh
diff options
context:
space:
mode:
authorKunoiSayami <[email protected]>2021-12-13 21:53:55 +0800
committerKunoiSayami <[email protected]>2021-12-13 21:53:55 +0800
commit4e02041bb14d92d8e724bd81430f8f48658c37ca (patch)
treef87770ca9f206666f3526f95c052ca0f05a48c89 /db/skiplist.cuh
parentb338a2083d68b9a8d1e3eb17538535aa050426df (diff)
test(skiplist): Add more test
Signed-off-by: KunoiSayami <[email protected]>
Diffstat (limited to 'db/skiplist.cuh')
-rw-r--r--db/skiplist.cuh16
1 files changed, 8 insertions, 8 deletions
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<Key, Comparator>::Iterator::key() const {
}
template <typename Key, class Comparator>
-inline void SkipList<Key, Comparator>::Iterator::Next() {
+__device__ inline void SkipList<Key, Comparator>::Iterator::Next() {
assert(Valid());
node_ = node_->Next(0);
}
template <typename Key, class Comparator>
-inline void SkipList<Key, Comparator>::Iterator::Prev() {
+__device__ inline void SkipList<Key, Comparator>::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<Key, Comparator>::FindGreaterOrEqual(const Key& key,
template <typename Key, class Comparator>
typename SkipList<Key, Comparator>::Node*
-SkipList<Key, Comparator>::FindLessThan(const Key& key) const {
+__device__ SkipList<Key, Comparator>::FindLessThan(const Key& key) const {
Node* x = head_;
int level = GetMaxHeight() - 1;
while (true) {
@@ -324,7 +324,7 @@ SkipList<Key, Comparator>::FindLessThan(const Key& key) const {
}
template <typename Key, class Comparator>
-typename SkipList<Key, Comparator>::Node* SkipList<Key, Comparator>::FindLast()
+__device__ typename SkipList<Key, Comparator>::Node* SkipList<Key, Comparator>::FindLast()
const {
Node* x = head_;
int level = GetMaxHeight() - 1;