Skip to content

Count allocated bytes #70

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

Merged
merged 7 commits into from
Mar 21, 2025
Merged

Count allocated bytes #70

merged 7 commits into from
Mar 21, 2025

Conversation

alphaville
Copy link
Member

@alphaville alphaville commented Mar 20, 2025

Main Changes

The total allocated bytes are counted by the instance of the session. Just do

size_t bytes = Session::getInstance().totalAllocatedBytes();

Note, however, that invocations to cudaFree don't have an effect on byte counting. (fixed)

The main changes are:

  1. Introduced Session::cudaAllocate(void** d, size_t s)
  2. Introduced Session::totalAllocatedBytes()
  3. Replaced all cudaMalloc with Session::cudaAllocate
  4. Unit test

@alphaville alphaville self-assigned this Mar 20, 2025
@alphaville alphaville requested a review from ruairimoran March 21, 2025 00:03
Copy link
Collaborator

@ruairimoran ruairimoran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. Version bump?

@alphaville
Copy link
Member Author

lgtm. Version bump?

Ah, yes! I'll update it now.

@alphaville alphaville merged commit 436d84e into main Mar 21, 2025
2 checks passed
@alphaville alphaville deleted the feature/count-bytes-allocated branch March 28, 2025 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants