Celeritas  0.5.0-86+4a8eea4
Public Member Functions | Static Public Member Functions | List of all members
celeritas::Stream Class Reference

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
 
Streamoperator= (Stream const &)=delete
 
 Stream (Stream &&) noexcept
 Move construct.
 
Streamoperator= (Stream &&) noexcept
 Move assign.
 
void swap (Stream &other) noexcept
 Swap.
 
StreamT get () const
 
ResourceTmemory_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...
 

Detailed Description

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.

Member Function Documentation

◆ async()

bool celeritas::Stream::async ( )
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.

◆ malloc_async()

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.


The documentation for this class was generated from the following files: