Medical Imaging Interaction Toolkit  2018.4.99-b7f3afaa
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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef __mitkOclResourceService_h
14 #define __mitkOclResourceService_h
15 
16 #include <mitkServiceInterface.h>
17 
18 #include <mitkOpenCL.h>
19 
28 {
29 public:
31  virtual cl_context GetContext() const = 0;
32 
34  virtual cl_command_queue GetCommandQueue() const = 0;
35 
37  virtual cl_device_id GetCurrentDevice() const = 0;
38 
40  virtual bool GetIsFormatSupported( cl_image_format* format ) = 0;
41 
43  virtual void PrintContextInfo() const = 0;
44 
51  virtual void InsertProgram(cl_program program, std::string string, bool flag) = 0;
52 
57  virtual cl_program GetProgram(const std::string& name) = 0;
58 
60  virtual void InvalidateStorage() = 0;
61 
65  virtual void RemoveProgram(const std::string& name) = 0;
66 
72  virtual unsigned int GetMaximumImageSize( unsigned int , cl_mem_object_type) = 0;
73 
74  virtual ~OclResourceService() = 0;
75 
76 };
77 
78 MITK_DECLARE_SERVICE_INTERFACE(OclResourceService, "OpenCLResourceService/1.0")
79 #endif // __mitkOclResourceService_h
virtual void InvalidateStorage()=0
Remove all invalid (=do not compile) programs from the internal storage.
#define MITK_DECLARE_SERVICE_INTERFACE(IFace, IId)
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 nullptr if none present.
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.