cuda::experimental::graph#
-
struct graph#
An owning wrapper for a cudaGraphExec_t handle.
The
graphclass provides a safe and convenient interface for managing the lifecycle of acudaGraphExec_tobject, ensuring proper cleanup and resource management. It supports move semantics, resource release, and launch of the CUDA graph.See also
Note
The
graphobject is not directly constructible. One is obtained by calling theinstantiate()method on agraph_builderobject.Public Functions
-
inline constexpr graph(graph &&__other) noexcept#
Move constructor for
graph.Note
After the move, the source object is left in the empty state.
- Parameters:
__other – The
graphobject to move from.- Post:
__other.get() == nullptr
-
inline constexpr ~graph()#
Destructor for
graph.Ensures proper cleanup of the CUDA graph execution object.
- Throws:
None –
-
inline constexpr auto operator=(graph &&__other) noexcept -> graph&#
Move assignment operator for
graph.Note
After the move, the source object is left in the empty state.
- Parameters:
__other – The
graphobject to move from.- Throws:
None –
- Returns:
A reference to the current object.
- Post:
__other.get() == nullptr
-
inline constexpr void swap(graph &__other) noexcept#
Swaps the contents of this
graphwith another.- Parameters:
__other – The
graphobject to swap with.- Throws:
None –
-
inline constexpr auto get() const noexcept -> cudaGraphExec_t#
Retrieves the underlying CUDA graph execution object.
- Throws:
None –
- Returns:
The
cudaGraphExec_thandle.
-
inline constexpr auto release() noexcept -> cudaGraphExec_t#
Releases ownership of the CUDA graph execution object.
- Throws:
None –
- Returns:
The
cudaGraphExec_thandle, leaving this object in a null state.- Post:
get() == nullptr
-
inline constexpr void reset() noexcept#
Resets the
graphobject, destroying the underlying CUDA graph execution object.- Throws:
cuda::std::cuda_error – if
cudaGraphExecDestroyfails.- Post:
get() == nullptr
-
inline void launch(stream_ref __stream)#
Launches the CUDA graph execution object on the specified stream.
- Parameters:
__stream – The stream on which to launch the graph.
- Throws:
cuda::std::cuda_error – if
cudaGraphLaunchfails.
Public Static Functions
-
inline constexpr graph(graph &&__other) noexcept#