Icemist commented on code in PR #11465:
URL: https://github.com/apache/tvm/pull/11465#discussion_r900010368
##########
src/runtime/graph_executor/debug/graph_executor_debug.cc:
##########
@@ -176,10 +197,29 @@ class GraphExecutorDebug : public GraphExecutor {
}
TVMRetValue rv;
time_eval.CallPacked(TVMArgs(values.get(), type_codes.get(),
num_flat_args), &rv);
- std::string results = rv.operator std::string();
- const double* results_arr = reinterpret_cast<const
double*>(results.data());
- LOG(INFO) << "Got op timing: " << results_arr[0];
- return results_arr[0];
+ std::string results_str = rv.operator std::string();
+
+ size_t offset = 0;
+ auto blob_ptr = results_str.data();
+ for (int i = 0; i < repeat; ++i) {
+ const int64_t* size_ptr = reinterpret_cast<const int64_t*>(blob_ptr +
offset);
+ offset += sizeof(int64_t);
+ auto result =
+ std::vector<double>(reinterpret_cast<const double*>(blob_ptr +
offset),
+ reinterpret_cast<const double*>(blob_ptr) +
offset + size_ptr[0]);
+ offset += sizeof(double) * size_ptr[0];
+ results[i] = result;
+ }
+
+ std::string log = "";
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]