cuda_stream Class Reference

cuda_stream Class Reference#

Reference API: gko::cuda_stream Class Reference
Reference API
gko::cuda_stream Class Reference

#include <ginkgo/core/base/stream.hpp>

Public Member Functions

 cuda_stream ()
 
 cuda_stream (int device_id)
 
 ~cuda_stream ()
 
 cuda_stream (const cuda_stream &)=delete
 
 cuda_stream (cuda_stream &&)
 
cuda_streamoperator= (const cuda_stream &)=delete
 
cuda_streamoperator= (cuda_stream &&)=delete
 
CUstream_st * get () const
 

Detailed Description

An RAII wrapper for a custom CUDA stream. The stream will be created on construction and destroyed when the lifetime of the wrapper ends.

Constructor & Destructor Documentation

◆ cuda_stream() [1/3]

gko::cuda_stream::cuda_stream ( )

Creates an empty stream wrapper, representing the default stream.

◆ cuda_stream() [2/3]

gko::cuda_stream::cuda_stream ( int  device_id)

Creates a new custom CUDA stream on the given device.

Parameters
device_idthe device ID to create the stream on.

◆ ~cuda_stream()

gko::cuda_stream::~cuda_stream ( )

Destroys the custom CUDA stream, if it isn't empty.

◆ cuda_stream() [3/3]

gko::cuda_stream::cuda_stream ( cuda_stream &&  )

Move-constructs from an existing stream, which will be emptied.

Member Function Documentation

◆ get()

CUstream_st * gko::cuda_stream::get ( ) const

Returns the native CUDA stream handle. In an empty cuda_stream, this will return nullptr.

◆ operator=()

cuda_stream & gko::cuda_stream::operator= ( cuda_stream &&  )
delete

Move-assigns from an existing stream, which will be emptied.


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