Image Component Library (ICL)
CLProgram.h
Go to the documentation of this file.
1 /********************************************************************
2 ** Image Component Library (ICL) **
3 ** **
4 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld **
5 ** Neuroinformatics Group **
6 ** Website: www.iclcv.org and **
7 ** http://opensource.cit-ec.de/projects/icl **
8 ** **
9 ** File : ICLUtils/src/ICLUtils/CLProgram.h **
10 ** Module : ICLUtils **
11 ** Authors: Viktor Losing **
12 ** **
13 ** **
14 ** GNU LESSER GENERAL PUBLIC LICENSE **
15 ** This file may be used under the terms of the GNU Lesser General **
16 ** Public License version 3.0 as published by the **
17 ** **
18 ** Free Software Foundation and appearing in the file LICENSE.GPL **
19 ** included in the packaging of this file. Please review the **
20 ** following information to ensure the license requirements will **
21 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt **
22 ** **
23 ** The development of this software was supported by the **
24 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. **
25 ** The Excellence Cluster EXC 277 is a grant of the Deutsche **
26 ** Forschungsgemeinschaft (DFG) in the context of the German **
27 ** Excellence Initiative. **
28 ** **
29 ********************************************************************/
30 
31 #pragma once
32 
33 #ifdef ICL_HAVE_OPENCL
34 
35 #include <ICLUtils/CompatMacros.h>
36 #include <ICLUtils/CLBuffer.h>
37 #include <ICLUtils/CLKernel.h>
38 #include <ICLUtils/CLImage2D.h>
39 #include <ICLUtils/CLException.h>
41 #include <string.h>
42 #include <fstream>
43 
44 namespace icl {
45  namespace utils {
46 
48 
260  struct Impl;
261  Impl *impl;
262 
263  public:
264 
266  CLProgram();
267 
268  CLProgram(const CLDeviceContext &device_context, const string &sourceCode) ;
269 
270  CLProgram(const CLDeviceContext &device_context, ifstream &fileStream) ;
271 
273  CLProgram(const string deviceType, const string &sourceCode) ;
274 
276  CLProgram(const string deviceType, ifstream &fileStream) ;
277 
279  CLProgram(const string &sourceCode, const CLProgram &parent) ;
280 
282  CLProgram(ifstream &fileStream, const CLProgram &parent) ;
283 
285  CLProgram(const CLProgram& other);
286 
288  CLProgram const& operator=(CLProgram const& other);
289 
291  ~CLProgram();
292 
297  bool isValid();
298 
303  bool isValid() const;
304 
305  //accessMode = "r" only read
306  //accessMode = "w" only write
307  //accessMode = "rw" read and write
309 
315  CLBuffer createBuffer(const string &accessMode, size_t size,const void *src=0) ;
316 
317 
319 
332  CLImage2D createImage2D(const string &accessMode, const size_t width, const size_t height, int depth, const void *src=0) ;
333 
334  CLImage2D createImage2D(const string &accessMode, const size_t width, const size_t height, int depth, int num_channel, const void *src=0) ;
335 
337 
340  CLKernel createKernel(const string &id) ;
341 
342  CLDeviceContext getDeviceContext();
343 
345  void listSelectedPlatform();
346 
348  void listSelectedDevice();
350 
351  static void listAllPlatformsAndDevices();
352 
354  static void listAllPlatforms();
355  };
356  }
357 }
358 #endif
undocument this line if you encounter any issues!
Definition: Any.h:37
#define ICLUtils_API
this macros are important for creating dll's
Definition: CompatMacros.h:171
Wrapper for an OpenCL Kernel.
Definition: CLKernel.h:72
Impl * impl
Definition: CLProgram.h:260
Wrapper for an OpenCL Buffer.
Definition: CLBuffer.h:52
depth
determines the pixel type of an image (8Bit-int or 32Bit-float)
Definition: Types.h:60
The CLDeviceContext class allows preparation of the device used for CLPrograms.
Definition: CLDeviceContext.h:61
Wrapper for an OpenCL Image2D.
Definition: CLImage2D.h:57
Main class for OpenCL based accelleration.
Definition: CLProgram.h:259