Skip to content

Commit

Permalink
ENH: Expose flag to release GPU memory when dirty
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasGandel committed Sep 6, 2024
1 parent e2f19a1 commit 7a76f08
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/itkCudaDataManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ class CudaCommon_EXPORT CudaDataManager : public Object
void
SetGPUDirtyFlag(bool isDirty);

/** Controls whether GPU memory should be released when dirty. On by default.
* When turning it off, one must call Free() to release the GPU memory. */
void
SetReleaseDirtyGPUBufferFlag(bool release);

/** Make GPU up-to-date and mark CPU as dirty.
* Call this function when you want to modify CPU data */
void
Expand Down
6 changes: 6 additions & 0 deletions src/itkCudaDataManager.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ CudaDataManager::SetGPUDirtyFlag(bool isDirty)
this->Free();
}

void
CudaDataManager::SetReleaseDirtyGPUBufferFlag(bool release)
{
m_ReleaseDirtyGPUBuffer = release;
}

void
CudaDataManager::SetGPUBufferDirty()
{
Expand Down

0 comments on commit 7a76f08

Please sign in to comment.