onnxruntime
efe0af37 - [TensorRT EP] Fix nullptr check (#16468)

Commit
2 years ago
[TensorRT EP] Fix nullptr check (#16468) ### Description Fix the nullptr check so that it would check the actual existence of engine/context (Currently, it checks the address of unique_ptr, which is always not null. Thx @jslhcl for pointing that out) > A quick recall of struct [trt_state](https://github.com/microsoft/onnxruntime/blob/main/onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.h#L104): > ``` > std::unique_ptr<nvinfer1::ICudaEngine>* engine = nullptr; >std::unique_ptr<nvinfer1::IExecutionContext>* context = nullptr; >``` ### Motivation and Context https://github.com/microsoft/onnxruntime/issues/15982 The incorrect check couldn't stop TRT EP from loading incompatible engine cache on purpose, which invokes unhandled exception
Author
Parents
Loading