Fermat
|
Implements a caching device allocator based on CUB's
#include <allocator.h>
Public Types | |
typedef T | value_type |
typedef thrust::device_ptr< T > | pointer |
typedef thrust::device_ptr< const T > | const_pointer |
typedef thrust::device_reference< T > | reference |
typedef thrust::device_reference< const T > | const_reference |
typedef std::size_t | size_type |
typedef pointer::difference_type | difference_type |
Public Methods | |
__host__ __device__ pointer | address (reference r) |
__host__ __device__ const_pointer | address (const_reference r) |
CUGAR_HOST pointer | allocate (size_type cnt, const_pointer=const_pointer(static_cast< T *>(0))) |
CUGAR_HOST void | deallocate (pointer p, size_type cnt) |
typedef thrust::device_ptr<const T> cugar::caching_device_allocator< T >::const_pointer |
const
pointer to allocation, device_ptr<const T>
.
typedef thrust::device_reference<const T> cugar::caching_device_allocator< T >::const_reference |
const
reference to allocated element, device_reference<const T>
.
typedef pointer::difference_type cugar::caching_device_allocator< T >::difference_type |
Type of allocation difference, pointer::difference_type
.
typedef thrust::device_ptr<T> cugar::caching_device_allocator< T >::pointer |
Pointer to allocation, device_ptr<T>
.
typedef thrust::device_reference<T> cugar::caching_device_allocator< T >::reference |
Reference to allocated element, device_reference<T>
.
typedef std::size_t cugar::caching_device_allocator< T >::size_type |
Type of allocation size, std::size_t
.
typedef T cugar::caching_device_allocator< T >::value_type |
Type of element allocated, T
.
|
inline |
Returns the address of an allocated object.
&r
.
|
inline |
Returns the address an allocated object.
&r
.
|
inline |
Allocates storage for cnt
objects.
cnt | The number of objects to allocate. |
pointer
to uninitialized storage for cnt
objects. deallocate
.
|
inline |
Deallocates storage for objects allocated with allocate
.
p | A pointer to the storage to deallocate. |
cnt | The size of the previous allocation. |
allocate
.