cuda-api-wrappers
Thin C++-flavored wrappers for the CUDA Runtime API
cuda::context::current::scoped_override_t Class Reference

A RAII-based mechanism for pushing a context onto the context stack for what remains of the current (C++ language) scope - making it the current context - then popping it back when exiting the scope - restoring the stack and the current context to what they had been previously. More...

#include <current_context.hpp>

Inheritance diagram for cuda::context::current::scoped_override_t:
Collaboration diagram for cuda::context::current::scoped_override_t:

Public Member Functions

 scoped_override_t (device::primary_context_t &&primary_context)
 
 scoped_override_t (const context_t &context)
 
 scoped_override_t (context_t &&context)
 

Detailed Description

A RAII-based mechanism for pushing a context onto the context stack for what remains of the current (C++ language) scope - making it the current context - then popping it back when exiting the scope - restoring the stack and the current context to what they had been previously.

Note
if some other code pushes/pops from the context stack during the lifetime of this class, the pop-on-destruction may fail, or succeed but pop some other context handle than the one originally. pushed.

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