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

mem_tg: fix support for more than 8 memory channels #3138

Merged
merged 4 commits into from
Aug 19, 2024
Merged

Conversation

pcolberg
Copy link
Contributor

The sizeof() operator returns the size of an object or type in bytes, not bits. Instead of calculating the number of bits using, e.g., CHAR_BIT * sizeof(), hard-code 64 since it is close to the declaration.

This is a prerequisite for HBM support with up to 32 channels.

Link: #3137
Fixes: 7bf96dc ("mem_tg test multichannel")

The sizeof() operator returns the size of an object or type in bytes,
not bits. Instead of calculating the number of bits using, e.g.,
CHAR_BIT * sizeof(), hard-code 64 since it is close to the declaration.

This is a prerequisite for HBM support with up to 32 channels.

Link: #3137
Fixes: 7bf96dc ("mem_tg test multichannel")
Signed-off-by: Peter Colberg <peter.colberg@intel.com>
@pcolberg pcolberg requested a review from a team as a code owner July 19, 2024 23:40
@coveralls
Copy link

coveralls commented Jul 19, 2024

Pull Request Test Coverage Report for Build 10455767815

Details

  • 0 of 23 (0.0%) changed or added relevant lines in 1 file are covered.
  • 3 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.03%) to 64.245%

Changes Missing Coverage Covered Lines Changed/Added Lines %
samples/mem_tg/tg_test.h 0 23 0.0%
Files with Coverage Reduction New Missed Lines %
samples/mem_tg/tg_test.h 3 0.0%
Totals Coverage Status
Change from base Build 10306205386: 0.03%
Covered Lines: 15826
Relevant Lines: 24634

💛 - Coveralls

Replace manual memory allocation using new[] and delete[] with
std::vector, which avoids unintended memory leaks. Drop unneeded
vectors for per-thread promise and tg_exe, which may be stored
as local variables inside the lambda function. The lambda is
declared as mutable to permit moving the promise.

Signed-off-by: Peter Colberg <peter.colberg@intel.com>
This ensures that shared object members are not modified by any thread.

Signed-off-by: Peter Colberg <peter.colberg@intel.com>
@pcolberg pcolberg self-assigned this Aug 19, 2024
@pcolberg pcolberg merged commit a70f5c0 into master Aug 19, 2024
27 checks passed
@pcolberg pcolberg deleted the mem_tg_channels branch August 19, 2024 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants