Celeritas
0.5.0-56+6b053cd
|
CUDA or HIP stream. More...
#include <Stream.hh>
Public Types | |
Type aliases | |
using | StreamT = MockStream_st * |
using | ResourceT = AsyncMemoryResource< void * > |
Public Member Functions | |
Stream () | |
Construct by creating a stream. | |
Stream (std::nullptr_t) | |
~Stream () | |
Destroy the stream. | |
Stream (Stream const &)=delete | |
Stream & | operator= (Stream const &)=delete |
Stream (Stream &&) noexcept | |
Move construct. | |
Stream & | operator= (Stream &&) noexcept |
Move assign. | |
void | swap (Stream &other) noexcept |
Swap. | |
StreamT | get () const |
ResourceT & | memory_resource () |
void * | malloc_async (std::size_t bytes) const |
Allocate memory asynchronously on this stream if possible. More... | |
void | free_async (void *ptr) const |
Free memory asynchronously on this stream if possible. | |
Static Public Member Functions | |
static bool | async () |
Whether asynchronous operations are supported. More... | |
CUDA or HIP stream.
This creates/destroys a stream on construction/destruction and provides accessors to low-level stream-related functionality. This class will typically be accessed only by low-level device implementations.
|
static |
Whether asynchronous operations are supported.
This is true by default if CUDA or HIP (5.2 <= HIP_VERSION < 5.7) is in use, and can be disabled by setting the CELER_DEVICE_ASYNC
environment variable.
void * celeritas::Stream::malloc_async | ( | std::size_t | bytes | ) | const |
Allocate memory asynchronously on this stream if possible.
HIP 5.1 and lower does not support async allocation.