[TensorRT EP] reduce CI pipelines test execution time (#11440)

* add global builder placeholder to improve CI test time for TRT EP

* fix build error

* rename var, put in unnamed namespace

* fix build error

* fix
This commit is contained in:
George Wu 2022-05-05 09:25:54 -07:00 committed by GitHub
parent 3f3c5fcd68
commit 8d6ade9e08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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::IBuilder>(nvinfer1::createInferBuilder(GetTensorrtLogger()));
#endif
// Check if cycle exists in the graph after partitioning
bool FindCycleHelper(size_t i, const std::list<size_t>* adjacency_map, bool visited[], bool* st, std::vector<size_t>& cycles) {
if (!visited[i]) {