#include <itkGPUDataManager.h>
GPU memory manager implemented using OpenCL. Required by GPUImage class.
This class serves as a base class for GPU data container for GPUImage class, which is similar to ImageBase class for Image class. However, all the image-related meta data will be already stored in image class (parent of GPUImage), therefore we did not name it GPUImageBase. Rather, this class is a GPU-specific data manager that provides functionalities for CPU-GPU data synchronization and grafting GPU data.
Definition at line 64 of file itkGPUDataManager.h.
Public Types | |
using | ConstPointer = SmartPointer<const Self> |
using | MutexHolderType = std::lock_guard<std::mutex> |
using | Pointer = SmartPointer<Self> |
using | Self = GPUDataManager |
using | Superclass = Object |
Public Member Functions | |
void | Allocate () |
unsigned int | GetBufferSize () |
virtual const char * | GetClassName () const |
virtual const bool & | GetCPUBufferLock () |
void * | GetCPUBufferPointer () |
virtual const bool & | GetGPUBufferLock () |
cl_mem * | GetGPUBufferPointer () |
virtual void | Graft (const GPUDataManager *data) |
virtual void | Initialize () |
bool | IsCPUBufferDirty () |
bool | IsGPUBufferDirty () |
ITK_DISALLOW_COPY_AND_MOVE (GPUDataManager) | |
void | SetBufferFlag (cl_mem_flags flags) |
void | SetBufferSize (unsigned int num) |
void | SetCPUBufferDirty () |
void | SetCPUBufferLock (const bool v) |
void | SetCPUBufferPointer (void *ptr) |
void | SetCPUDirtyFlag (bool isDirty) |
void | SetGPUBufferDirty () |
void | SetGPUBufferLock (const bool v) |
void | SetGPUDirtyFlag (bool isDirty) |
bool | Update () |
virtual void | UpdateCPUBuffer () |
virtual void | UpdateGPUBuffer () |
Static Public Member Functions | |
static Pointer | New () |
Protected Member Functions | |
GPUDataManager () | |
void | PrintSelf (std::ostream &os, Indent indent) const override |
~GPUDataManager () override | |
Protected Attributes | |
unsigned int | m_BufferSize {} |
OpenCLContext * | m_Context {} |
void * | m_CPUBuffer {} |
bool | m_CPUBufferLock {} |
cl_mem | m_GPUBuffer {} |
bool | m_GPUBufferLock {} |
bool | m_IsCPUBufferDirty {} |
bool | m_IsGPUBufferDirty {} |
cl_mem_flags | m_MemFlags {} |
std::mutex | m_Mutex {} |
Friends | |
class | OpenCLKernelManager |
using itk::GPUDataManager::ConstPointer = SmartPointer<const Self> |
Definition at line 75 of file itkGPUDataManager.h.
using itk::GPUDataManager::MutexHolderType = std::lock_guard<std::mutex> |
Definition at line 83 of file itkGPUDataManager.h.
using itk::GPUDataManager::Pointer = SmartPointer<Self> |
Definition at line 74 of file itkGPUDataManager.h.
Definition at line 72 of file itkGPUDataManager.h.
using itk::GPUDataManager::Superclass = Object |
Definition at line 73 of file itkGPUDataManager.h.
|
protected |
|
overrideprotected |
void itk::GPUDataManager::Allocate | ( | ) |
|
inline |
Definition at line 90 of file itkGPUDataManager.h.
|
virtual |
Run-time type information (and related methods).
Reimplemented in itk::GPUImageDataManager< ImageType >, and itk::GPUImageDataManager< itk::GPUImage >.
|
virtual |
void * itk::GPUDataManager::GetCPUBufferPointer | ( | ) |
Get GPU buffer pointer
|
virtual |
cl_mem * itk::GPUDataManager::GetGPUBufferPointer | ( | ) |
Get GPU buffer pointer
|
virtual |
Method for grafting the content of one GPUDataManager into another one
|
virtual |
Initialize GPUDataManager
|
inline |
Definition at line 118 of file itkGPUDataManager.h.
|
inline |
Definition at line 124 of file itkGPUDataManager.h.
itk::GPUDataManager::ITK_DISALLOW_COPY_AND_MOVE | ( | GPUDataManager | ) |
|
static |
Method for creation through the object factory.
|
overrideprotected |
void itk::GPUDataManager::SetBufferFlag | ( | cl_mem_flags | flags | ) |
void itk::GPUDataManager::SetBufferSize | ( | unsigned int | num | ) |
total buffer size in bytes
void itk::GPUDataManager::SetCPUBufferDirty | ( | ) |
Make GPU up-to-date and mark CPU as dirty. Call this function when you want to modify CPU data
|
inline |
Make CPU buffer locked to avoid extra update from ITK pipeline.
Definition at line 162 of file itkGPUDataManager.h.
void itk::GPUDataManager::SetCPUBufferPointer | ( | void * | ptr | ) |
void itk::GPUDataManager::SetCPUDirtyFlag | ( | bool | isDirty | ) |
void itk::GPUDataManager::SetGPUBufferDirty | ( | ) |
Make CPU up-to-date and mark GPU as dirty. Call this function when you want to modify GPU data
|
inline |
Make GPU buffer locked to avoid extra update from ITK pipeline.
Definition at line 170 of file itkGPUDataManager.h.
void itk::GPUDataManager::SetGPUDirtyFlag | ( | bool | isDirty | ) |
bool itk::GPUDataManager::Update | ( | ) |
Synchronize CPU and GPU buffers (using dirty flags)
|
virtual |
actual GPU->CPU memory copy takes place here
Reimplemented in itk::GPUImageDataManager< ImageType >, and itk::GPUImageDataManager< itk::GPUImage >.
|
virtual |
actual CPU->GPU memory copy takes place here
Reimplemented in itk::GPUImageDataManager< ImageType >, and itk::GPUImageDataManager< itk::GPUImage >.
|
friend |
allow GPUKernelManager to access GPU buffer pointer
Definition at line 67 of file itkGPUDataManager.h.
|
protected |
Definition at line 183 of file itkGPUDataManager.h.
|
protected |
Definition at line 185 of file itkGPUDataManager.h.
|
protected |
Definition at line 192 of file itkGPUDataManager.h.
|
protected |
extra safety flags
Definition at line 199 of file itkGPUDataManager.h.
|
protected |
buffer pointers
Definition at line 191 of file itkGPUDataManager.h.
|
protected |
Definition at line 200 of file itkGPUDataManager.h.
|
protected |
Definition at line 196 of file itkGPUDataManager.h.
|
protected |
checks if buffer needs to be updated
Definition at line 195 of file itkGPUDataManager.h.
|
protected |
buffer type
Definition at line 188 of file itkGPUDataManager.h.
|
protected |
Mutex lock to prevent r/w hazard for multithreaded code
Definition at line 203 of file itkGPUDataManager.h.
Generated on 2024-07-17 for elastix by 1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d) |