Medical Imaging Interaction Toolkit  2021.02.99-9e0e53e2
Medical Imaging Interaction Toolkit
mitkOclBaseData.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 __mitkOclBaseData_h
14 #define __mitkOclBaseData_h
15 
16 #include "MitkOpenCLExports.h"
17 #include "mitkOclUtils.h"
18 
19 #include "mitkOpenCL.h"
20 
21 #include <mitkCommon.h>
22 #include <itkObjectFactory.h>
23 #include <itkObject.h>
24 
25 namespace mitk
26 {
27 
28  class MITKOPENCL_EXPORT OclBaseData : public itk::Object
29  {
30  public:
32 
36  virtual int TransferDataToGPU(cl_command_queue) = 0;
37 
41  virtual void* TransferDataToCPU(cl_command_queue) = 0;
42 
44  void GPUModified();
45 
47  void CPUModified();
48 
49 
51  virtual cl_mem GetGPUBuffer();
52 
53  protected:
55  OclBaseData();
56 
58  virtual ~OclBaseData();
59 
60  private:
61 
63  size_t m_BufferSize;
64 
66  cl_mem m_GPUBuffer;
67 
69  void* m_CPUBuffer;
70  };
71 
72 }
73 
74 #endif // __mitkOclBaseData_h
DataCollection - Class to facilitate loading/accessing structured data.
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:45