MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / checkSafeEngine

Function checkSafeEngine

samples/common/sampleEngines.cpp:1705–1727  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1703}
1704
1705bool checkSafeEngine(void const* serializedEngine, int32_t const engineSize)
1706{
1707 if (!hasConsistencyChecker())
1708 {
1709 sample::gLogError << "Cannot perform consistency check because the checker is not loaded.." << std::endl;
1710 return false;
1711 }
1712 auto checker = std::unique_ptr<nvinfer1::consistency::IConsistencyChecker>(
1713 createConsistencyChecker(sample::gLogger.getTRTLogger(), serializedEngine, engineSize));
1714 if (checker.get() == nullptr)
1715 {
1716 sample::gLogError << "Failed to create consistency checker." << std::endl;
1717 return false;
1718 }
1719 sample::gLogInfo << "Start consistency checking." << std::endl;
1720 if (!checker->validate())
1721 {
1722 sample::gLogError << "Consistency validation failed." << std::endl;
1723 return false;
1724 }
1725 sample::gLogInfo << "Consistency validation passed." << std::endl;
1726 return true;
1727}
1728} // namespace sample

Callers 2

loadEngineToBuildEnvFunction · 0.85

Calls 4

hasConsistencyCheckerFunction · 0.85
createConsistencyCheckerFunction · 0.70
getMethod · 0.45
validateMethod · 0.45

Tested by

no test coverage detected