#include <nanovdb/cuda/TempPool.h>
|
| | TempPool () |
| | Default c-tor of an empty memory pool that uses the default instance of Resource for all allocations.
|
| | TempPool (Resource &resource) |
| | C-tor of an empty memory pool that routes all allocations through the supplied Resource instance.
|
| void * | data () |
| | Returns a non-const void pointer to the data managed by this instance.
|
| size_t & | size () |
| | Returns a non-const reference to the actual size of the data managed by this instance.
|
| size_t & | requestedSize () |
| | Returns a non-const reference to the requested size of the data managed by this instance.
|
| cudaStream_t | stream () const |
| | Returns the stream that the managed memory was last (re)allocated on, i.e. the stream this pool will free on at destruction.
|
| void | reallocate (cudaStream_t stream) |
| | Re-allocation of the data managed by this instance. Only has affect if the pool in empty or the requested memory is larger than the existing size.
|
◆ TempPool() [1/2]
Default c-tor of an empty memory pool that uses the default instance of Resource for all allocations.
◆ TempPool() [2/2]
C-tor of an empty memory pool that routes all allocations through the supplied Resource instance.
- Parameters
-
| resource | resource instance to allocate from; must outlive this pool. |
◆ data()
Returns a non-const void pointer to the data managed by this instance.
◆ reallocate()
template<class Resource>
| void reallocate |
( |
cudaStream_t | stream | ) |
|
|
inline |
Re-allocation of the data managed by this instance. Only has affect if the pool in empty or the requested memory is larger than the existing size.
- Parameters
-
| stream | cuda stream used for asynchronous de-allocation and allocation. |
- Note
- Scratch is discarded, never resized: preserving a prefix of temporary storage would be a wasted copy.
◆ requestedSize()
template<class Resource>
| size_t & requestedSize |
( |
| ) |
|
|
inline |
Returns a non-const reference to the requested size of the data managed by this instance.
- Note
- This requested size should always be less than or smaller than the actual size().
◆ size()
Returns a non-const reference to the actual size of the data managed by this instance.
- Note
- Returned by reference because cub's two-pass API takes the storage size as a size_t&, so this cannot forward Buffer::size() by value.
◆ stream()
template<class Resource>
| cudaStream_t stream |
( |
| ) |
const |
|
inline |
Returns the stream that the managed memory was last (re)allocated on, i.e. the stream this pool will free on at destruction.