Skip to content

Memory management improvements #49

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

Closed
wants to merge 7 commits into from

Conversation

alphaville
Copy link
Member

@alphaville alphaville commented Nov 6, 2024

Moved to #50

Please see #50 instead

Main Changes

  • Introduce T** m_rawPtrToMatrices, which is a raw pointer to the matrices of the tensor (to replace pointersToMatrices)

TODOs

  • addAB: use gemm when nMats=1
  • Slicing: set m_d_ptrMatrix = nullptr when slicing with axis=0 or axis=1
  • CholeskyBatchFactoriser: get rid of pointersToMatrices
  • CholeskyBatchFactoriser: throw error if nMats=1
  • Reshaping: new test needed (e.g., reshape + multiply with addAB)

Associated Issues

@alphaville alphaville self-assigned this Nov 6, 2024
Introduce m_d_ptrMatrices to preallocate memory of an array
of pointers to each sub-matrix of a tensor. Destroy when
necessary. New method makePointersToMatrices. Slicing works.
Update all constructors
@alphaville alphaville mentioned this pull request Nov 7, 2024
9 tasks
@alphaville alphaville changed the title introducing raw pointer to matrices (on device) Memory management improvements Nov 7, 2024
@alphaville alphaville removed the request for review from ruairimoran November 7, 2024 01:58
@alphaville alphaville closed this Nov 7, 2024
@alphaville alphaville deleted the fix/48-memory-allocation-dtensor branch November 7, 2024 23:30
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.

Do not allocate new memory from within a method
1 participant