Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages |
#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 | |
typedef SmartPointer< const Self > | ConstPointer |
using | MutexHolderType = std::lock_guard< std::mutex > |
typedef SmartPointer< Self > | Pointer |
typedef GPUDataManager | Self |
typedef Object | Superclass |
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_ASSIGN (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 |
typedef SmartPointer< const Self > itk::GPUDataManager::ConstPointer |
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.
typedef SmartPointer< Self > itk::GPUDataManager::Pointer |
Definition at line 74 of file itkGPUDataManager.h.
Definition at line 72 of file itkGPUDataManager.h.
typedef Object itk::GPUDataManager::Superclass |
Definition at line 73 of file itkGPUDataManager.h.
|
protected |
|
overrideprotected |
void itk::GPUDataManager::Allocate | ( | ) |
|
inline |
Definition at line 88 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 109 of file itkGPUDataManager.h.
|
inline |
Definition at line 114 of file itkGPUDataManager.h.
itk::GPUDataManager::ITK_DISALLOW_COPY_AND_ASSIGN | ( | 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 143 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 147 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 158 of file itkGPUDataManager.h.
|
protected |
Definition at line 160 of file itkGPUDataManager.h.
|
protected |
Definition at line 167 of file itkGPUDataManager.h.
|
protected |
extra safety flags
Definition at line 174 of file itkGPUDataManager.h.
|
protected |
buffer pointers
Definition at line 166 of file itkGPUDataManager.h.
|
protected |
Definition at line 175 of file itkGPUDataManager.h.
|
protected |
Definition at line 171 of file itkGPUDataManager.h.
|
protected |
checks if buffer needs to be updated
Definition at line 170 of file itkGPUDataManager.h.
|
protected |
buffer type
Definition at line 163 of file itkGPUDataManager.h.
|
protected |
Mutex lock to prevent r/w hazard for multithreaded code
Definition at line 178 of file itkGPUDataManager.h.
Generated on 1667476801 for elastix by 1.9.4 |