Skip to content

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.

3 participants