From ad505042fee440ce7c2ed3b55bb9a3e1570a8e1e Mon Sep 17 00:00:00 2001 From: Matthew Kotila Date: Mon, 4 Dec 2023 14:43:04 -0800 Subject: [PATCH] Implement unique request IDs across threads --- src/c++/perf_analyzer/infer_context.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/c++/perf_analyzer/infer_context.cc b/src/c++/perf_analyzer/infer_context.cc index 100a8a1d8..588d4057a 100644 --- a/src/c++/perf_analyzer/infer_context.cc +++ b/src/c++/perf_analyzer/infer_context.cc @@ -113,7 +113,8 @@ InferContext::SendRequest( thread_stat_->num_sent_requests_++; if (async_) { - infer_data_.options_->request_id_ = std::to_string(request_id); + uint64_t unique_request_id{(thread_id_ << 48) | ((request_id << 16) >> 16)}; + infer_data_.options_->request_id_ = std::to_string(unique_request_id); { std::lock_guard lock(thread_stat_->mu_); auto it = async_req_map_