cuda-api-wrappers
Thin C++-flavored wrappers for the CUDA Runtime API
stream.hpp File Reference

A proxy class for CUDA streams, providing access to all Runtime API calls involving their use and management. More...

#include "current_context.hpp"
#include "current_device.hpp"
#include "error.hpp"
#include "kernel_launch.hpp"
#include "memory.hpp"
#include "miscellany.hpp"
#include "types.hpp"
#include <string>
#include <memory>
#include <utility>
#include <tuple>
#include <algorithm>
Include dependency graph for stream.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  cuda::stream_t
 Proxy class for a CUDA stream. More...
 
class  cuda::stream_t::enqueue_t
 A gadget through which commands are enqueued on the stream. More...
 

Namespaces

 cuda
 Definitions and functionality wrapping CUDA APIs.
 
 cuda::memory
 Representation, allocation and manipulation of CUDA-related memory, of different.
 
 cuda::stream
 Definitions and functionality related to CUDA streams (not including the device wrapper type stream_t itself)
 

Enumerations

enum  : bool {
  implicitly_synchronizes_with_default_stream = true,
  no_implicit_synchronization_with_default_stream = false,
  sync = implicitly_synchronizes_with_default_stream,
  async = no_implicit_synchronization_with_default_stream,
  blocking = sync,
  nonblocking = async
}
 
enum  cuda::stream::wait_condition_t : unsigned {
  greater_or_equal_to = CU_STREAM_WAIT_VALUE_GEQ,
  geq = CU_STREAM_WAIT_VALUE_GEQ,
  equality = CU_STREAM_WAIT_VALUE_EQ,
  equals = CU_STREAM_WAIT_VALUE_EQ,
  nonzero_after_applying_bitmask = CU_STREAM_WAIT_VALUE_AND,
  one_bits_overlap = CU_STREAM_WAIT_VALUE_AND,
  bitwise_and = CU_STREAM_WAIT_VALUE_AND,
  zero_bits_overlap = CU_STREAM_WAIT_VALUE_NOR,
  bitwise_nor = CU_STREAM_WAIT_VALUE_NOR
}
 Kinds of conditions to apply to a value in GPU global memory when waiting on that value, i.e. More...
 

Functions

stream_t cuda::stream::wrap (device::id_t device_id, context::handle_t context_handle, handle_t stream_handle, bool take_ownership=false, bool hold_pc_refcount_unit=false) noexcept
 Wrap an existing stream in a stream_t instance. More...
 
void cuda::synchronize (const stream_t &stream)
 Waits for all previously-scheduled tasks on a given stream to conclude, before returning. More...
 
stream_t cuda::stream::create (const device_t &device, bool synchronizes_with_default_stream, priority_t priority=stream::default_priority)
 Create a new stream (= queue) in the primary execution context of a CUDA device. More...
 
stream_t cuda::stream::create (const context_t &context, bool synchronizes_with_default_stream, priority_t priority=stream::default_priority, bool hold_pc_refcount_unit=false)
 Create a new stream (= queue) in a CUDA execution context. More...
 

Detailed Description

A proxy class for CUDA streams, providing access to all Runtime API calls involving their use and management.

Note
: Missing functionality: Stream attributes; stream capturing.