diff --git a/onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc b/onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc index f9145b925c..6710296f67 100644 --- a/onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc +++ b/onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc @@ -37,9 +37,19 @@ ? common::Status::OK() \ : ORT_MAKE_STATUS(ONNXRUNTIME, FAIL, "CUDA error executing ", #expr)) +namespace onnxruntime { +TensorrtLogger& GetTensorrtLogger(); +} + using namespace ONNX_NAMESPACE; using namespace ::onnxruntime::logging; namespace { +#ifdef ORT_RUN_EXTERNAL_ONNX_TESTS +// instantiate global unused builder object which keeps the TRT kernel library in memory +// so that subsequent builders avoid the expensive load / unload process. +auto const trt_builder_placeholder = + tensorrt_ptr::unique_pointer(nvinfer1::createInferBuilder(GetTensorrtLogger())); +#endif // Check if cycle exists in the graph after partitioning bool FindCycleHelper(size_t i, const std::list* adjacency_map, bool visited[], bool* st, std::vector& cycles) { if (!visited[i]) {