Medical Imaging Interaction Toolkit
2018.4.99-389bf124
Medical Imaging Interaction Toolkit
|
The OclDataSetToDataSetFilter is the base class for all OpenCL DataSet filter generating DataSets. More...
#include <mitkOclDataSetToDataSetFilter.h>
Public Member Functions | |
void * | GetOutput () |
Returns an pointer to the filtered data. More... | |
mitk::OclDataSet::Pointer | GetGPUOutput () |
Returns a pointer to the graphics memory. More... | |
![]() | |
void | SetInput (mitk::OclDataSet::Pointer DataSet) |
SetInput SetInput Set the input DataSet (as mitk::OclDataSet). More... | |
void | SetInput (void *DataSet, unsigned int size, unsigned int BpE) |
SetInput Set the input DataSet (as a pointer to the data). More... | |
void | SetInput (mitk::Image::Pointer image) |
SetInput Set the input DataSet (as mitk::Image). More... | |
![]() | |
void | AddSourceFile (const char *filename) |
Add a source file from the resource files to the OpenCL shader file list. Multiple files can be added to the list. More... | |
void | SetCompilerFlags (const char *flags) |
Set specific compilerflags to compile the CL source. Default is set to nullptr; example: "-cl-fast-relaxed-math -cl-mad-enable -cl-strict-aliasing". More... | |
virtual bool | IsInitialized () |
Returns true if the initialization was successfull. More... | |
virtual unsigned long | GetDeviceMemory () |
Returns the amount of global memory of the used device in bytes. More... | |
virtual | ~OclFilter () |
Destructor. More... | |
Protected Member Functions | |
OclDataSetToDataSetFilter () | |
OclDataSetToDataSetFilter Default constructor. More... | |
virtual | ~OclDataSetToDataSetFilter () |
Destructor. More... | |
virtual void | Update ()=0 |
(Virtual) method Update() to be implemented in derived classes. More... | |
bool | InitExec (cl_kernel ckKernel, unsigned int *dimensions, vcl_size_t outputDataSize, unsigned int outputBpE) |
InitExec Initialize the execution. More... | |
bool | InitExecNoInput (cl_kernel ckKernel, unsigned int *dimensions, vcl_size_t outputDataSize, unsigned int outputBpE) |
virtual int | GetBytesPerElem () |
Get the memory size needed for each element. More... | |
![]() | |
OclDataSetFilter () | |
virtual | ~OclDataSetFilter () |
![]() | |
OclFilter () | |
Constructor. More... | |
OclFilter (const char *filename) | |
Constructor ( overloaded ) More... | |
void | SetWorkingSize (unsigned int locx, unsigned int dimx, unsigned int locy=1, unsigned int dimy=1, unsigned int locz=1, unsigned int dimz=1) |
Set the working size for the following OpenCL kernel call. More... | |
bool | ExecuteKernel (cl_kernel kernel, unsigned int workSizeDim) |
Execute the given kernel on the OpenCL Index-Space defined by the local and global work sizes. More... | |
bool | ExecuteKernelChunks (cl_kernel kernel, unsigned int workSizeDim, vcl_size_t *chunksDim) |
Execute the given kernel on the OpenCL Index-Space defined by the local and global work sizes, but divide it into chunks of dimension chunksDim. More... | |
bool | ExecuteKernelChunksInBatches (cl_kernel kernel, unsigned int workSizeDim, vcl_size_t *chunksDim, vcl_size_t batchSize, int waitTimems) |
Execute the given kernel on the OpenCL Index-Space defined by the local and global work sizes, but divide it into chunks of dimension chunksDim and wait between batches of batchSize chunks a time of waitTimems milliseconds. More... | |
bool | Initialize () |
Initialize all necessary parts of the filter. More... | |
void | CompileSource () |
Compile the program source. More... | |
void | SetSourcePreambel (const char *preambel) |
Add some source code on the beginning of the loaded source. More... | |
virtual us::Module * | GetModule ()=0 |
Get the Module of the filter. Needs to be implemented by every subclass. The filter will load the OpenCL sourcefiles from this module context. More... | |
void | LoadSourceFiles (CStringList &SourceCodeList, ClSizeList &SourceCodeSizeList) |
Helper functions that load sourcefiles from the module context in the Initialize function. More... | |
Protected Attributes | |
mitk::OclDataSet::Pointer | m_Output |
unsigned int | m_CurrentSizeOutput |
![]() | |
mitk::OclDataSet::Pointer | m_Input |
unsigned int | m_CurrentSize |
![]() | |
const char * | m_ClCompilerFlags |
String that contains the compiler flags. More... | |
cl_program | m_ClProgram |
The compiled OpenCL program. More... | |
cl_command_queue | m_CommandQue |
Command queue for the filter. More... | |
std::string | m_FilterID |
Unique ID of the filter, needs to be specified in the constructor of the derived class. More... | |
const char * | m_Preambel |
source preambel for e.g. #define commands to be inserted into the OpenCL source More... | |
CStringList | m_ClFiles |
List of sourcefiles that will be compiled for this filter. More... | |
bool | m_Initialized |
status of the filter More... | |
vcl_size_t | m_LocalWorkSize [3] |
The local work size fo the filter. More... | |
vcl_size_t | m_GlobalWorkSize [3] |
The global work size of the filter. More... | |
Additional Inherited Members | |
![]() | |
typedef std::vector< const char * > | CStringList |
typedef std::vector< vcl_size_t > | ClSizeList |
The OclDataSetToDataSetFilter is the base class for all OpenCL DataSet filter generating DataSets.
Definition at line 26 of file mitkOclDataSetToDataSetFilter.h.
|
protected |
OclDataSetToDataSetFilter Default constructor.
Definition at line 18 of file mitkOclDataSetToDataSetFilter.cpp.
References m_Output, and mitk::OclDataSet::New().
|
protectedvirtual |
Destructor.
Definition at line 23 of file mitkOclDataSetToDataSetFilter.cpp.
|
protectedvirtual |
Get the memory size needed for each element.
Definition at line 38 of file mitkOclDataSetToDataSetFilter.cpp.
References m_CurrentSizeOutput.
mitk::OclDataSet::Pointer mitk::OclDataSetToDataSetFilter::GetGPUOutput | ( | ) |
Returns a pointer to the graphics memory.
Use this method when executing two and more filters on the GPU for fast access. This method does not copy the data to RAM. It returns only a pointer.
Definition at line 27 of file mitkOclDataSetToDataSetFilter.cpp.
References m_Output.
void * mitk::OclDataSetToDataSetFilter::GetOutput | ( | void | ) |
Returns an pointer to the filtered data.
Definition at line 32 of file mitkOclDataSetToDataSetFilter.cpp.
References mitk::OclFilter::m_CommandQue, and m_Output.
|
protected |
InitExec Initialize the execution.
ckKernel | The GPU kernel. |
mitk::Exception | if something goes wrong. |
Definition at line 43 of file mitkOclDataSetToDataSetFilter.cpp.
References CHECK_OCL_ERR, GetOclErrorAsString(), mitk::OclFilter::m_CommandQue, m_CurrentSizeOutput, mitk::OclDataSetFilter::m_Input, m_Output, MITK_DEBUG, MITK_INFO, mitkThrow, and mitk::OclFilter::SetWorkingSize().
|
protected |
Definition at line 93 of file mitkOclDataSetToDataSetFilter.cpp.
References CHECK_OCL_ERR, GetOclErrorAsString(), m_CurrentSizeOutput, m_Output, MITK_DEBUG, mitkThrow, and mitk::OclFilter::SetWorkingSize().
|
protectedpure virtual |
(Virtual) method Update() to be implemented in derived classes.
|
protected |
Definition at line 70 of file mitkOclDataSetToDataSetFilter.h.
Referenced by GetBytesPerElem(), InitExec(), and InitExecNoInput().
|
protected |
Output DataSet
Definition at line 52 of file mitkOclDataSetToDataSetFilter.h.
Referenced by GetGPUOutput(), GetOutput(), InitExec(), InitExecNoInput(), and OclDataSetToDataSetFilter().