A buffer that is lazily-allocated using double-checked locking. More...
#include <LazyGpuBuffer.hpp>
Public Member Functions | |
| LazyGpuBuffer (Stream &s, int bufferSize) | |
Initialise a LazyGpuBuffer that will be the given size when eventually allocated, associated with a stream. More... | |
| int | size () |
| __device T * | get () |
| Get the buffer. More... | |
A buffer that is lazily-allocated using double-checked locking.
| Zero | Zero-fill the buffer when it is allocated. |
| sp::LazyGpuBuffer< T, Zero >::LazyGpuBuffer | ( | Stream & | s, |
| int | bufferSize | ||
| ) |
Initialise a LazyGpuBuffer that will be the given size when eventually allocated, associated with a stream.
| __device T * sp::LazyGpuBuffer< T, Zero >::get | ( | ) |
Get the buffer.
If the buffer hasn't been allocated yet, it is allocated and possibly zero-initialised. It's very cheap after the first time (which is quite slow).