18#ifndef NV_INFER_SAFE_RUNTIME_H
19#define NV_INFER_SAFE_RUNTIME_H
21#define NV_INFER_INTERNAL_INCLUDE_RUNTIME_BASE 1
23#undef NV_INFER_INTERNAL_INCLUDE_RUNTIME_BASE
50class IExecutionContext;
208 virtual
size_t getDeviceMemorySize() const noexcept = 0;
287 virtual
Dims getTensorShape(
AsciiChar const* const tensorName) const noexcept = 0;
349 virtual std::int32_t getTensorBytesPerComponent(
AsciiChar const* const tensorName) const noexcept = 0;
371 virtual std::int32_t getTensorComponentsPerElement(
AsciiChar const* const tensorName) const noexcept = 0;
412 virtual std::int32_t getTensorVectorizedDim(
AsciiChar const* const tensorName) const noexcept = 0;
425 virtual std::int32_t getNbIOTensors() const noexcept = 0;
445 virtual
AsciiChar const* getIOTensorName(std::int32_t const index) const noexcept = 0;
522 virtual
void setName(
AsciiChar const* const name) noexcept = 0;
559 virtual
void setDeviceMemory(
void* const memory) noexcept = 0;
660 virtual
Dims getTensorStrides(
AsciiChar const* const tensorName) const noexcept = 0;
690 virtual
bool setInputTensorAddress(
AsciiChar const* const tensorName,
void const* const data) noexcept = 0;
719 virtual
bool setOutputTensorAddress(
AsciiChar const* const tensorName,
void* const data) noexcept = 0;
735 virtual
bool setInputConsumedEvent(cudaEvent_t const event) noexcept = 0;
747 virtual cudaEvent_t getInputConsumedEvent() const noexcept = 0;
767 virtual
void const* getInputTensorAddress(
AsciiChar const* const tensorName) const noexcept = 0;
787 virtual
void* getOutputTensorAddress(
AsciiChar const* const tensorName) const noexcept = 0;
808 virtual
bool enqueueV3(cudaStream_t const stream) noexcept = 0;
895 AsciiChar const*
const pluginNamespace =
"") noexcept = 0;
1001template <typename T>
1019#define REGISTER_SAFE_TENSORRT_PLUGIN(name) \
1020 static nvinfer1::safe::PluginRegistrar<name> pluginRegistrar##name {}
#define TENSORRTAPI
Definition: NvInferRuntimeBase.h:59
Definition: NvInferRuntimeBase.h:202
Application-implemented logging interface for the builder, refitter and runtime.
Definition: NvInferRuntimeBase.h:683
A functionally safe engine for executing inference on a built network.
Definition: NvInferSafeRuntime.h:154
virtual IExecutionContext * createExecutionContext() noexcept=0
Create an execution context.
Functionally safe context for executing inference using an engine.
Definition: NvInferSafeRuntime.h:494
virtual ICudaEngine const & getEngine() const noexcept=0
Get the associated engine.
Single registration point for all plugins in an application. It is used to find plugin implementation...
Definition: NvInferSafeRuntime.h:830
virtual IPluginCreator * getPluginCreator(AsciiChar const *const pluginName, AsciiChar const *const pluginVersion, AsciiChar const *const pluginNamespace="") noexcept=0
Return plugin creator based on plugin name, version, and namespace associated with plugin during netw...
virtual IPluginCreator *const * getPluginCreatorList(int32_t *const numCreators) const noexcept=0
Return all the registered plugin creators and the number of registered plugin creators....
virtual bool registerCreator(IPluginCreator &creator, AsciiChar const *const pluginNamespace) noexcept=0
Register a plugin creator.
Allows a serialized functionally safe engine to be deserialized.
Definition: NvInferSafeRuntime.h:63
virtual ICudaEngine * deserializeCudaEngine(void const *const blob, std::size_t const size) noexcept=0
Deserialize an engine from a byte array.
virtual IErrorRecorder * getErrorRecorder() const noexcept=0
Get the ErrorRecorder assigned to this interface.
virtual void setGpuAllocator(IGpuAllocator *const allocator) noexcept=0
Set the GPU allocator.
virtual void setErrorRecorder(IErrorRecorder *const recorder) noexcept=0
Set the ErrorRecorder for this interface.
Register the plugin creator to the registry The static registry object will be instantiated when the ...
Definition: NvInferSafeRuntime.h:1003
PluginRegistrar()
Definition: NvInferSafeRuntime.h:1005
Definition: NvInferRuntimeBase.h:857
Definition: NvInferRuntimeBase.h:469
Definition: NvInferRuntimePlugin.h:948
IPluginRegistry * getSafePluginRegistry() noexcept
Return the safe plugin registry.
RuntimeErrorType
Enum to represent runtime error types.
Definition: NvInferSafeRuntime.h:467
@ kNAN_CONSUMED
NaN floating-point value was silently consumed.
@ kSCATTER_OOB
Out-of-bounds access in scatter operation.
@ kGATHER_OOB
Out-of-bounds access in gather operation.
@ kINF_CONSUMED
Inf floating-point value was silently consumed.
@ kSCATTER_RACE
Race condition in scatter operation.
IRuntime * createInferRuntime(ILogger &logger) noexcept
Create an instance of a safe::IRuntime class.
The TensorRT API version 1 namespace.
TensorIOMode
Definition of tensor IO Mode.
Definition: NvInferRuntimeBase.h:1100
char_t AsciiChar
Definition: NvInferRuntimeBase.h:107
DataType
The type of weights and tensors.
Definition: NvInferRuntimeBase.h:135
TensorFormat
Format of the input/output tensors.
Definition: NvInferRuntimeBase.h:250