Can an nvinfer IRuntime's destructor be run on a different thread than where it was created?

Is there any thread local state the destructor may depend on? Assume the new thread now has exclusive access to the IRuntime.

Hi @suchir ,
That’s not a problem, although you must ensure that the CUDA context is set correctly for the thread when calling into TRT.

Thanks

1 Like

Thanks for the help @AakankshaS . Would you be able to confirm whether this is also acceptable for CudaEngine, ExecutionContext, and CudaEvent? I’m using the runtime api, so the context should be lazily set up as needed If I understand correctly.