LSLab
include
lslab
device_allocator.h
Go to the documentation of this file.
1
5
#include "
lslab.h
"
6
#include "
mutex.h
"
7
#include <stdexcept>
8
9
#pragma once
10
11
namespace
lslab {
12
13
template
<
typename
T>
14
struct
device_allocator
{
15
16
LSLAB_HOST
device_allocator
(
size_t
stack_size_ = 10000);
17
18
LSLAB_HOST_DEVICE
device_allocator
(
const
device_allocator<T>
&
self
);
19
20
LSLAB_HOST_DEVICE
device_allocator
(
device_allocator
&& other);
21
22
LSLAB_HOST_DEVICE
device_allocator
& operator=(
device_allocator
&& other);
23
24
LSLAB_HOST_DEVICE ~
device_allocator
();
25
26
LSLAB_DEVICE T* allocate(
size_t
n);
27
28
LSLAB_HOST_DEVICE
void
deallocate(T* ptr,
size_t
n);
29
30
size_t
stack_size;
31
cuda::std::atomic<uint64_t>* loc;
32
T* mempool;
33
34
};
35
36
}
37
38
#include "detail/device_allocator.h"
lslab.h
mutex.h
lslab::device_allocator
Definition:
device_allocator.h:14
Generated by
1.9.1