TRT Resource Manager#
-
class TRTResourceManager#
Owns IO allocations and streams for serialized execution in one caller-owned CUDA context. SafetyRuntime keeps this owner alive until every borrowing graph is destroyed. All operations are externally serialized. Destruction performs no CUDA/DLI calls.
Public Functions
- TRTResourceManager(
- LifecycleState &lifecycleState,
- SafetyErrorState &errorState
-
~TRTResourceManager() noexcept = default#
-
TRTResourceManager(TRTResourceManager const&) = delete#
-
TRTResourceManager &operator=(TRTResourceManager const&) = delete#
- SafetyStatus prepareResources(
- std::vector<TRTSafetyGraphExecutor*> const &executors,
- std::vector<size_t> const &mainStreamIds = {},
- std::vector<SafetyIOAliasGroup> const &aliases = {}
Initialization only: allocate and bind every admitted profile once. A CUDA/DLI failure retains partial resources for application containment without rollback.
- SafetyStatus deinitialize(
- std::vector<TRTSafetyGraphExecutor*> const &executors
Healthy Deinit Preparation only, after every borrowing graph has been destroyed.
- std::vector<SafetyProfileResources> const &profiles(
- size_t executorIndex
-
cudaStream_t mainStream(size_t executorIndex) const noexcept#
-
bool fatal() const noexcept#
-
struct SafetyProfileResources#
Stable IO storage for one fixed profile; tensor order matches SafetyProfileMetadata.
-
struct SafetyIOAliasGroup#
Explicit exact in-place IO storage for one alias-safe executor; partial overlap is not admitted.