feat(benchmark/alloc): introduce minimal allocation benchmark#266
Open
s1rk0 wants to merge 9 commits intoalpaka-group:devfrom
Open
feat(benchmark/alloc): introduce minimal allocation benchmark#266s1rk0 wants to merge 9 commits intoalpaka-group:devfrom
s1rk0 wants to merge 9 commits intoalpaka-group:devfrom
Conversation
psychocoderHPC
requested changes
Sep 16, 2025
Member
psychocoderHPC
left a comment
There was a problem hiding this comment.
Only small changes are required.
* new file `benchmark/alloc/src/alloc_benchmark.cpp` * new file `benchmark/alloc/CMakeLists.txt` * updated root `benchmark/CMakeLists.txt` – `add_subdirectory(alloc/)`
…free Switch benchmark to touch buffers after allocation: - zero-initialize via queue memset - read first byte to enforce observable use This removes lazy-commit effects and makes results reflect “allocate & start using” latency/bandwidth, not just allocator call overhead. Discussed with Jiri on 2025-08-11.
Drop accidental duplicate 'uint8_t retval' line in measureAlloc().
- run clang-format to enforce style
…e cold from stats
599eb93 to
3783525
Compare
Author
|
Rebased on latest upstream/dev. Addressed review: switched to add_executable + alpaka_finalize, removed host deref of device buffers, moved helpers to alloc_helpers.hpp, renamed templates to T_*. Added cold/hot handling (first run reported separately and excluded from stats). |
Member
|
@s1rk0 I reformated you PR follwing https://alpaka.readthedocs.io/en/latest/dev/style.html#pre-commit that the style checker is happy too. I will review you coode sasap |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a microbenchmark for host memory allocation under benchmark/alloc/.
It measures the cost of:
so results reflect realistic “allocate + initialize + first access” latency rather than raw allocator timing.
What’s included
All new files carry SPDX headers.
How to build & run
cmake -S . -B build -G Ninja \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -Dalpaka_BENCHMARKS=ON -Dalpaka_TESTING=OFF cmake --build build -j ./build/benchmark/alloc/alloc