Skip to content

Commit

Permalink
Merge pull request #1 from MooreThreads/remove_wait_for_buffer_write
Browse files Browse the repository at this point in the history
Update MuptiActivityProfiler.cpp
  • Loading branch information
zehan-mt authored Jun 18, 2024
2 parents 263555a + f4760cd commit 17003f6
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions libkineto/src/MuptiActivityProfiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,27 +264,14 @@ void MuptiActivityProfiler::processTraceInternal(ActivityLogger& logger) {
addOverheadSample(flushOverhead_, mupti_.flushOverhead);
}
if (traceBuffers_->gpu) {
auto count_and_size1 = mupti_.processActivities(
auto count_and_size = mupti_.processActivities(
*traceBuffers_->gpu,
std::bind(
&MuptiActivityProfiler::handleMuptiActivity,
this,
std::placeholders::_1,
&logger));

// Wait for mupti buffer write
std::this_thread::sleep_for(seconds(3));
auto count_and_size2 = mupti_.processActivities(
*traceBuffers_->gpu,
std::bind(
&MuptiActivityProfiler::handleMuptiActivity,
this,
std::placeholders::_1,
&logger));
std::pair<int, size_t> count_and_size{0, 0};
count_and_size.first = count_and_size1.first + count_and_size2.first;
count_and_size.second = count_and_size1.second + count_and_size2.second;

LOG(INFO) << "Processed " << count_and_size.first << " GPU records ("
<< count_and_size.second << " bytes)";
LOGGER_OBSERVER_ADD_EVENT_COUNT(count_and_size.first);
Expand Down

0 comments on commit 17003f6

Please sign in to comment.