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

Function printTiming

samples/common/sampleReporting.cpp:117–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116
117void printTiming(std::vector<InferenceTime> const& timings, int32_t runsPerAvg, std::ostream& os)
118{
119 int32_t count = 0;
120 InferenceTime sum;
121
122 os << std::endl;
123 os << "=== Trace details ===" << std::endl;
124 os << "Trace averages of " << runsPerAvg << " runs:" << std::endl;
125 for (auto const& t : timings)
126 {
127 sum += t;
128
129 if (++count == runsPerAvg)
130 {
131 // clang-format off
132 os << "Average on " << runsPerAvg << " runs - GPU latency: " << sum.compute / runsPerAvg
133 << " ms - Host latency: " << sum.latency() / runsPerAvg << " ms (enqueue " << sum.enq / runsPerAvg
134 << " ms)" << std::endl;
135 // clang-format on
136 count = 0;
137 sum.enq = 0;
138 sum.h2d = 0;
139 sum.compute = 0;
140 sum.d2h = 0;
141 }
142 }
143}
144
145void printMetricExplanations(std::ostream& os)
146{

Callers 1

printPerformanceReportFunction · 0.85

Calls 1

latencyMethod · 0.80

Tested by

no test coverage detected