Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client: don't use hipDeviceSynchronize for blocking CPU to get CPU timer #753

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions clients/common/utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ double get_time_us_sync_device(void)
/*! \brief CPU Timer(in microsecond): synchronize with given queue/stream and return wall time */
double get_time_us_sync(hipStream_t stream)
{
if(hipDeviceSynchronize() != hipSuccess)
if(hipStreamSynchronize(stream) != hipSuccess)
{
hipblaslt_cerr << "Synchronizing device failed" << std::endl;
hipblaslt_cerr << "Synchronizing stream failed" << std::endl;
}

auto now = std::chrono::steady_clock::now();
Expand Down
9 changes: 0 additions & 9 deletions clients/include/testing_matmul.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2460,7 +2460,6 @@ void testing_matmul_with_bias(const Arguments& arg)
CHECK_HIP_ERROR(hipEventRecord(event_gpu_time_start, stream));
else
{
CHECK_HIP_ERROR(hipStreamSynchronize(stream));
flush_time_used = get_time_us_sync(stream);
}
for(int i = 0; i < flush_iter; i++)
Expand All @@ -2476,7 +2475,6 @@ void testing_matmul_with_bias(const Arguments& arg)
}
else
{
CHECK_HIP_ERROR(hipStreamSynchronize(stream));
flush_time_used = get_time_us_sync(stream) - flush_time_used;
}
flush_time_used /= flush_iter;
Expand All @@ -2503,7 +2501,6 @@ void testing_matmul_with_bias(const Arguments& arg)
CHECK_HIP_ERROR(hipEventRecord(event_gpu_time_start, stream));
else
{
CHECK_HIP_ERROR(hipStreamSynchronize(stream));
gpu_time_used = get_time_us_sync(stream);
}

Expand Down Expand Up @@ -2552,7 +2549,6 @@ void testing_matmul_with_bias(const Arguments& arg)
CHECK_HIP_ERROR(hipEventRecord(event_gpu_time_start, stream));
else
{
CHECK_HIP_ERROR(hipStreamSynchronize(stream));
gpu_time_used = get_time_us_sync(stream);
}
for(int i = 0; i < number_hot_calls; i++)
Expand Down Expand Up @@ -2598,7 +2594,6 @@ void testing_matmul_with_bias(const Arguments& arg)
}
else
{
CHECK_HIP_ERROR(hipStreamSynchronize(stream));
gpu_time_used = get_time_us_sync(stream) - gpu_time_used;
}
}
Expand Down Expand Up @@ -2635,7 +2630,6 @@ void testing_matmul_with_bias(const Arguments& arg)
CHECK_HIP_ERROR(hipEventRecord(event_gpu_time_start, stream));
else
{
CHECK_HIP_ERROR(hipStreamSynchronize(stream));
gpu_time_used = get_time_us_sync(stream);
}

Expand All @@ -2654,7 +2648,6 @@ void testing_matmul_with_bias(const Arguments& arg)
}
else
{
CHECK_HIP_ERROR(hipStreamSynchronize(stream));
gpu_time_used = get_time_us_sync(stream) - gpu_time_used;
}
}
Expand All @@ -2679,7 +2672,6 @@ void testing_matmul_with_bias(const Arguments& arg)
CHECK_HIP_ERROR(hipEventRecord(event_gpu_time_start, stream));
else
{
CHECK_HIP_ERROR(hipStreamSynchronize(stream));
gpu_time_used = get_time_us_sync(stream);
}

Expand All @@ -2697,7 +2689,6 @@ void testing_matmul_with_bias(const Arguments& arg)
}
else
{
CHECK_HIP_ERROR(hipStreamSynchronize(stream));
gpu_time_used = get_time_us_sync(stream) - gpu_time_used;
}
}
Expand Down