Skip to content

Commit 1c0f771

Browse files
[rocm-libraries] ROCm/rocm-libraries#8142 (commit b78e456)
fix(rocthrust): fix SetBytesProcessed() calls ## Motivation There are three spots in rocThrust that currently wrongly use `state.SetBytesProcessed(0);`, rather than passing it an actual value. ## Technical Details Those three spots were updated to `state.SetBytesProcessed(state.iterations() * needles * sizeof(T));`, to make them consistent with the `state.SetItemsProcessed(state.iterations() * needles);` under them. The bandwidth calculation introduced here focuses strictly on the query footprint (`needles * sizeof(T)`) to unblock `bytes_per_second` graphing (which currently flatlines at 0). While this represents a lower bound of the actual global memory traffic, it provides an immediate baseline for throughput tracking. Any future refinements to capture the exact algorithmic memory footprint will simply scale the resulting graph by a predictable constant factor. ## Test Plan Run the three updated benchmarks. ## Test Result I have confirmed they now output proper `bytes_per_second` values, rather than: ```json "bytes_per_second": 0.0000000000000000e+00, "gpu_noise": 7.1034145212086564e-02, "items_per_second": 1.6391124340294927e+07 ``` ## Submission Checklist - [x] Look over the contributing guidelines at https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
1 parent cc80e9a commit 1c0f771

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

benchmark/bench/vectorized_search/basic.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/******************************************************************************
22
* Copyright (c) 2011-2023, NVIDIA CORPORATION. All rights reserved.
3-
* Modifications Copyright (c) 2024-2025, Advanced Micro Devices, Inc. All rights reserved.
3+
* Modifications Copyright (c) 2024-2026, Advanced Micro Devices, Inc. All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without
66
* modification, are permitted provided that the following conditions are met:
@@ -90,7 +90,7 @@ void run_benchmark(
9090
gpu_times.push_back(duration);
9191
}
9292

93-
state.SetBytesProcessed(0);
93+
state.SetBytesProcessed(state.iterations() * needles * sizeof(T));
9494
state.SetItemsProcessed(state.iterations() * needles);
9595

9696
const double gpu_cv = bench_utils::StatisticsCV(gpu_times);

benchmark/bench/vectorized_search/lower_bound.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/******************************************************************************
22
* Copyright (c) 2011-2023, NVIDIA CORPORATION. All rights reserved.
3-
* Modifications Copyright (c) 2024-2025, Advanced Micro Devices, Inc. All rights reserved.
3+
* Modifications Copyright (c) 2024-2026, Advanced Micro Devices, Inc. All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without
66
* modification, are permitted provided that the following conditions are met:
@@ -90,7 +90,7 @@ void run_benchmark(
9090
gpu_times.push_back(duration);
9191
}
9292

93-
state.SetBytesProcessed(0);
93+
state.SetBytesProcessed(state.iterations() * needles * sizeof(T));
9494
state.SetItemsProcessed(state.iterations() * needles);
9595

9696
const double gpu_cv = bench_utils::StatisticsCV(gpu_times);

benchmark/bench/vectorized_search/upper_bound.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/******************************************************************************
22
* Copyright (c) 2011-2023, NVIDIA CORPORATION. All rights reserved.
3-
* Modifications Copyright (c) 2024-2025, Advanced Micro Devices, Inc. All rights reserved.
3+
* Modifications Copyright (c) 2024-2026, Advanced Micro Devices, Inc. All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without
66
* modification, are permitted provided that the following conditions are met:
@@ -90,7 +90,7 @@ void run_benchmark(
9090
gpu_times.push_back(duration);
9191
}
9292

93-
state.SetBytesProcessed(0);
93+
state.SetBytesProcessed(state.iterations() * needles * sizeof(T));
9494
state.SetItemsProcessed(state.iterations() * needles);
9595

9696
const double gpu_cv = bench_utils::StatisticsCV(gpu_times);

0 commit comments

Comments
 (0)