A group of RAII contexts managed together.
More...
#include <with_context.h>
template<typename ContextType>
class tvm::WithGroup< ContextType >
A group of RAII contexts managed together.
Allows dynamically emplacing multiple context objects that are all exited (in reverse order) when the group is destroyed. ContextType must declare friend class With<ContextType> and provide EnterWithScope() / ExitWithScope() methods.
A group of RAII contexts managed together.
Definition with_context.h:114
void Emplace(Args &&... args)
Construct a context and enter its scope.
Definition with_context.h:127
- Template Parameters
-
| ContextType | The context type with EnterWithScope/ExitWithScope. |
◆ WithGroup() [1/3]
template<typename ContextType >
◆ WithGroup() [2/3]
template<typename ContextType >
◆ WithGroup() [3/3]
template<typename ContextType >
◆ ~WithGroup()
template<typename ContextType >
Destructor — exits all contexts in reverse order.
On normal exit: if any ExitWithScope throws, the remaining contexts are still cleaned up, then the first exception is re-thrown.
During stack unwinding: all exceptions are swallowed to avoid std::terminate.
◆ Emplace()
template<typename ContextType >
template<typename... Args>
Construct a context and enter its scope.
- Parameters
-
| args | Arguments forwarded to ContextType constructor. |
◆ operator=() [1/2]
template<typename ContextType >
◆ operator=() [2/2]
template<typename ContextType >
◆ size()
template<typename ContextType >
Number of active contexts in this group.
The documentation for this class was generated from the following file: