@@ -121,24 +121,24 @@ class PapiProfiler : public tflite::Profiler {
121
121
122
122
myfile.open ((" counters_" + std::to_string (utc) + " .csv" ).c_str ());
123
123
// Header
124
- myfile << " op_id,thread_id,papi_event,value\n " ;
124
+ myfile << " op_id,thread_id,sample_id, papi_event,value\n " ;
125
125
// Iterate over map keyed on tflite operation id, with values being a vector
126
126
// of counter values for each tracked perf event
127
- pid_t inf_thread_id;
128
127
for (auto & event : results_) {
129
- // Write all of the per-core events first, broken down by thread
130
128
for (uint64_t i = 0 ; i < event.second .size (); ++i) {
131
- inf_thread_id =
132
- inf_thread_ids_[i / papi_events_.size () % event_sets_.size ()];
133
- myfile << event. first << " ," << inf_thread_id << " ,"
129
+ myfile << event. first << " , "
130
+ << inf_thread_ids_[i / papi_events_.size () % event_sets_.size ()]
131
+ << " ," << i / papi_events_. size () << " ,"
134
132
<< papi_events_[i % papi_events_.size ()] << " ,"
135
133
<< event.second [i] << " \n " ;
136
134
}
137
135
}
136
+
138
137
for (auto & event : results_uncore_) {
139
138
// Now write the uncore events with a dummy thread id of -1
140
139
for (uint64_t i = 0 ; i < results_uncore_[event.first ].size (); ++i) {
141
140
myfile << event.first << " ," << -1 << " ,"
141
+ << i / papi_uncore_events_.size () << " ,"
142
142
<< papi_uncore_events_[i % papi_uncore_events_.size ()] << " ,"
143
143
<< results_uncore_[event.first ][i] << " \n " ;
144
144
}
@@ -223,10 +223,9 @@ class PapiProfiler : public tflite::Profiler {
223
223
results_[papi_regions_[event_handle]].insert (
224
224
results_[papi_regions_[event_handle]].end (), event_values_.begin (),
225
225
event_values_.end ());
226
+ // Push back the op timing
227
+ results_[papi_regions_[event_handle]].push_back (op_latency);
226
228
}
227
-
228
- // Push back the op timing
229
- results_[papi_regions_[event_handle]].push_back (op_latency);
230
229
}
231
230
// Handle uncore events
232
231
if (!papi_uncore_events_.empty ()) {
0 commit comments