Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkOclResourceService.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef __mitkOclResourceService_h
18 #define __mitkOclResourceService_h
19 
20 #include <mitkServiceInterface.h>
21 
22 #include <mitkOpenCL.h>
23 
32 {
33 public:
35  virtual cl_context GetContext() const = 0;
36 
38  virtual cl_command_queue GetCommandQueue() const = 0;
39 
41  virtual cl_device_id GetCurrentDevice() const = 0;
42 
44  virtual bool GetIsFormatSupported( cl_image_format* format ) = 0;
45 
47  virtual void PrintContextInfo() const = 0;
48 
55  virtual void InsertProgram(cl_program program, std::string string, bool flag) = 0;
56 
61  virtual cl_program GetProgram(const std::string& name) = 0;
62 
64  virtual void InvalidateStorage() = 0;
65 
69  virtual void RemoveProgram(const std::string& name) = 0;
70 
76  virtual unsigned int GetMaximumImageSize( unsigned int , cl_mem_object_type) = 0;
77 
78  virtual ~OclResourceService() = 0;
79 
80 };
81 
82 MITK_DECLARE_SERVICE_INTERFACE(OclResourceService, "OpenCLResourceService/1.0")
83 #endif // __mitkOclResourceService_h
virtual void InvalidateStorage()=0
Remove all invalid (=do not compile) programs from the internal storage.
virtual cl_command_queue GetCommandQueue() const =0
Returns a valid cl_command_queue related to the (one) OpenCL context.
virtual unsigned int GetMaximumImageSize(unsigned int, cl_mem_object_type)=0
Get the maximum size of an image.
virtual cl_program GetProgram(const std::string &name)=0
Get the cl_program by name.
virtual bool GetIsFormatSupported(cl_image_format *format)=0
Checks if an OpenCL image format passed in is supported on current device.
virtual void InsertProgram(cl_program program, std::string string, bool flag)=0
Insert program into the internal program storage.
virtual void PrintContextInfo() const =0
Puts the OpenCL Context info in std::cout.
virtual void RemoveProgram(const std::string &name)=0
Remove given program from storage.
virtual ~OclResourceService()=0
virtual cl_context GetContext() const =0
Returns a valid OpenCL Context (if applicable) or NULL if none present.
MITK_DECLARE_SERVICE_INTERFACE(mitk::ISimulationService,"org.mitk.ISimulationService")
virtual cl_device_id GetCurrentDevice() const =0
Returns the identifier of an OpenCL device related to the current context.
Declaration of the OpenCL Resources micro-service.