Skip to content

Commit

Permalink
Snpemodel: Clean up after commaai#23772 (commaai#23780)
Browse files Browse the repository at this point in the history
* #clean up snpemodel after commaai#23772

* Leave benchmark remove loop
  • Loading branch information
redacid95 committed Feb 16, 2022
1 parent 9535dc6 commit 1c9bf10
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions selfdrive/modeld/runners/snpemodel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,11 @@ void SNPEModel::execute(float *net_input_buf, int buf_size) {
float *outputs_golden = (float *)malloc(output_size*sizeof(float));
memcpy(outputs_golden, output, output_size*sizeof(float));
memset(output, 0, output_size*sizeof(float));

for (int i = 0; i < 5; i++) {
memset(recurrent, 0, recurrent_size*sizeof(float));
uint64_t start_time = nanos_since_boot();
thneed->execute(inputs, output);
uint64_t elapsed_time = nanos_since_boot() - start_time;
printf("ran model in %.2f ms\n", float(elapsed_time)/1e6);
}
memset(recurrent, 0, recurrent_size*sizeof(float));
uint64_t start_time = nanos_since_boot();
thneed->execute(inputs, output);
uint64_t elapsed_time = nanos_since_boot() - start_time;
printf("ran model in %.2f ms\n", float(elapsed_time)/1e6);

if (memcmp(output, outputs_golden, output_size*sizeof(float)) == 0) {
printf("thneed selftest passed\n");
Expand Down

0 comments on commit 1c9bf10

Please sign in to comment.