Medical Imaging Interaction Toolkit  2018.4.99-87d68d9f
Medical Imaging Interaction Toolkit
OclResourceService Class Referenceabstract

Declaration of the OpenCL Resources micro-service. More...

#include <mitkOclResourceService.h>

Public Member Functions

virtual cl_context GetContext () const =0
 Returns a valid OpenCL Context (if applicable) or nullptr if none present. More...
 
virtual cl_command_queue GetCommandQueue () const =0
 Returns a valid cl_command_queue related to the (one) OpenCL context. More...
 
virtual cl_device_id GetCurrentDevice () const =0
 Returns the identifier of an OpenCL device related to the current context. More...
 
virtual bool GetIsFormatSupported (cl_image_format *format)=0
 Checks if an OpenCL image format passed in is supported on current device. More...
 
virtual void PrintContextInfo () const =0
 Puts the OpenCL Context info in std::cout. More...
 
virtual void InsertProgram (cl_program program, std::string string, bool flag)=0
 Insert program into the internal program storage. More...
 
virtual cl_program GetProgram (const std::string &name)=0
 Get the cl_program by name. More...
 
virtual void InvalidateStorage ()=0
 Remove all invalid (=do not compile) programs from the internal storage. More...
 
virtual void RemoveProgram (const std::string &name)=0
 Remove given program from storage. More...
 
virtual unsigned int GetMaximumImageSize (unsigned int, cl_mem_object_type)=0
 Get the maximum size of an image. More...
 
virtual ~OclResourceService ()=0
 

Detailed Description

Declaration of the OpenCL Resources micro-service.

The OclResourceService defines an service interface for providing access to the essential OpenCL-related variables. In addition the service can also store compiled OpenCL Programs in order to avoid multiple compiling of a single program source

Definition at line 27 of file mitkOclResourceService.h.

Constructor & Destructor Documentation

◆ ~OclResourceService()

virtual OclResourceService::~OclResourceService ( )
pure virtual

Member Function Documentation

◆ GetCommandQueue()

virtual cl_command_queue OclResourceService::GetCommandQueue ( ) const
pure virtual

Returns a valid cl_command_queue related to the (one) OpenCL context.

◆ GetContext()

virtual cl_context OclResourceService::GetContext ( ) const
pure virtual

Returns a valid OpenCL Context (if applicable) or nullptr if none present.

Referenced by mitk::OclFilter::CompileSource(), mitk::OclImage::CreateGPUImage(), and mitk::OclImage::TransferDataToGPU().

◆ GetCurrentDevice()

virtual cl_device_id OclResourceService::GetCurrentDevice ( ) const
pure virtual

Returns the identifier of an OpenCL device related to the current context.

Referenced by mitk::OclFilter::GetDeviceMemory().

◆ GetIsFormatSupported()

virtual bool OclResourceService::GetIsFormatSupported ( cl_image_format *  format)
pure virtual

Checks if an OpenCL image format passed in is supported on current device.

◆ GetMaximumImageSize()

virtual unsigned int OclResourceService::GetMaximumImageSize ( unsigned  int,
cl_mem_object_type   
)
pure virtual

Get the maximum size of an image.

Parameters
dimension(unsigned int) identifier of the image diemsion in {0,1,2}
imageobject type, either CL_MEM_OBJECT_IMAGE2D, CL_MEM_OBJECT_IMAGE3D

◆ GetProgram()

virtual cl_program OclResourceService::GetProgram ( const std::string &  name)
pure virtual

Get the cl_program by name.

Parameters
nameText identifier of the program.
Exceptions
anmitk::Exception in case the program cannot be found

◆ InsertProgram()

virtual void OclResourceService::InsertProgram ( cl_program  program,
std::string  string,
bool  flag 
)
pure virtual

Insert program into the internal program storage.

Parameters
programA cl_program object.
stringText identifier of the inserted program. Used for getting the program.
todowhat is the flag?

◆ InvalidateStorage()

virtual void OclResourceService::InvalidateStorage ( )
pure virtual

Remove all invalid (=do not compile) programs from the internal storage.

Referenced by mitk::OclBinaryThresholdImageFilter::Update().

◆ PrintContextInfo()

virtual void OclResourceService::PrintContextInfo ( ) const
pure virtual

Puts the OpenCL Context info in std::cout.

◆ RemoveProgram()

virtual void OclResourceService::RemoveProgram ( const std::string &  name)
pure virtual

Remove given program from storage.

Parameters
nameText identifier of the program.

Referenced by mitk::OclFilter::~OclFilter().


The documentation for this class was generated from the following file: