I have structured my application such that I create an IRuntime
as follows:
std::unique_ptr<IRuntime> runtime{createInferRuntime(m_logger)};
I then use the IRuntime to deserailize the model and to create an ICudaEngine
:
m_engine = std::unique_ptr<nvinfer1::ICudaEngine>(runtime->deserializeCudaEngine(buffer.data(), buffer.size()));
Due to the way my application is structured, the runtime
variable falls out of scope and is deallocated before I have a chance to run inference using the m_engine
. Is this safe? Or must the IRuntime
instance remain in scope until inference is complete?