File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
examples/vai_library/samples/cflownet Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright 2019 Xilinx Inc.
2+ * Copyright 2022-2023 Advanced Micro Devices Inc.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -157,7 +157,15 @@ inline BenchMarkResult thread_main_for_performance(const PointsList *points_list
157157 while (!g_stop) {
158158 vitis::ai::TimeMeasure::getThreadLocalForDpu ().reset ();
159159 auto start = std::chrono::steady_clock::now ();
160- model->run ( (*points_list)[ret++].data ());
160+ // model->run( (*points_list)[ret++].data());
161+ auto batch = model->get_input_batch ();
162+ std::vector<const float *> imgs;
163+ imgs.reserve (batch);
164+ for (auto n = 0u ; n < batch; n++) {
165+ imgs.push_back ((*points_list)[ret++].data ());
166+ }
167+ model->run (imgs );
168+
161169 auto end = std::chrono::steady_clock::now ();
162170 auto end2endtime =
163171 int (std::chrono::duration_cast<std::chrono::microseconds>(end - start)
@@ -166,7 +174,7 @@ inline BenchMarkResult thread_main_for_performance(const PointsList *points_list
166174
167175 e2e_stat_samples.addSample (end2endtime);
168176 dpu_stat_samples.addSample (dputime);
169- _counter += 1 ;
177+ _counter += batch ;
170178 }
171179 return BenchMarkResult{ret, std::move (e2e_stat_samples),
172180 std::move (dpu_stat_samples)};
You can’t perform that action at this time.
0 commit comments