Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions examples/qualcomm/executor_runner/qnn_executor_runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -568,13 +568,40 @@ int main(int argc, char** argv) {
ET_LOG(
Info,
"Input list not provided. Inputs prepared with default values set.");

// Run the method
Error status = method->execute();
ET_CHECK_MSG(
status == Error::Ok,
"Execution of method %s failed with status 0x%" PRIx32,
method_name,
(int)status);
ET_LOG(Info, "Model executed successfully.");

// Warm up
ET_LOG(Info, "Perform %d inferences for warming up", FLAGS_warm_up);
for (int i = 0; i < FLAGS_warm_up; ++i) {
status = method->execute();
}

// Inference with designated iterations
auto before_exec = std::chrono::high_resolution_clock::now();
for (int i = 0; i < FLAGS_iteration; ++i) {
status = method->execute();
}
auto after_exec = std::chrono::high_resolution_clock::now();
double interval_infs =
std::chrono::duration_cast<std::chrono::microseconds>(
after_exec - before_exec)
.count() /
1000.0;

ET_LOG(
Info,
"%d inferences took %f ms, avg %f ms",
FLAGS_iteration,
interval_infs,
interval_infs / (float)FLAGS_iteration);
}

// Dump the etdump data containing profiling/debugging data to the specified
Expand Down
Loading