diff options
Diffstat (limited to 'db/skiplist.cuh')
| -rw-r--r-- | db/skiplist.cuh | 16 |
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; |
