aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/arena.cu2
-rw-r--r--util/arena.cuh6
-rw-r--r--util/random.cuh2
3 files changed, 5 insertions, 5 deletions
diff --git a/util/arena.cu b/util/arena.cu
index db5827d..a9556e5 100644
--- a/util/arena.cu
+++ b/util/arena.cu
@@ -8,7 +8,7 @@ namespace leveldb {
static const int kBlockSize = 4096;
-Arena::Arena()
+__device__ Arena::Arena()
: alloc_ptr_(nullptr), alloc_bytes_remaining_(0), memory_usage_(0),
head_(nullptr), blocks_(nullptr) {}
diff --git a/util/arena.cuh b/util/arena.cuh
index afbc575..950f286 100644
--- a/util/arena.cuh
+++ b/util/arena.cuh
@@ -17,12 +17,12 @@ namespace leveldb {
class Arena {
public:
- Arena();
+ __device__ Arena();
Arena(const Arena&) = delete;
Arena& operator=(const Arena&) = delete;
- ~Arena();
+ __device__ ~Arena();
// Return a pointer to a newly allocated memory block of "bytes" bytes.
__device__ char* Allocate(size_t bytes);
@@ -32,7 +32,7 @@ class Arena {
// Returns an estimate of the total memory usage of data allocated
// by the arena.
- size_t MemoryUsage() const {
+ __device__ size_t MemoryUsage() const {
return memory_usage_.load(cuda::memory_order_relaxed);
}
diff --git a/util/random.cuh b/util/random.cuh
index 38eafe2..95845f1 100644
--- a/util/random.cuh
+++ b/util/random.cuh
@@ -17,7 +17,7 @@ class Random {
uint32_t seed_;
public:
- explicit Random(uint32_t s) : seed_(s & 0x7fffffffu) {
+ __device__ explicit Random(uint32_t s) : seed_(s & 0x7fffffffu) {
// Avoid bad seeds.
if (seed_ == 0 || seed_ == 2147483647L) {
seed_ = 1;