tensorRt is in a thread,When tensorRt calls createInferRuntime deserializeCudaEngine enqueueV2 function.I kill the thread of tensorRt.Is it safe?

tensorRt is in a thread,When tensorRt calls createInferRuntime deserializeCudaEngine enqueueV2 function.I kill the thread of tensorRt.Is it safe? Can the graphics card resources occupied by Tensorrt be safely released?If it is safe,Please tell me API to kill the thread of tensorRt.