Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
clfKernelSources.hh
1 /*
2  * clfKernelSources.hh
3  *
4  * Created on: Jun 1, 2012
5  * Author: fkellner
6  */
7 
8 #ifndef CLFKERNELSOURCES_HH_
9 #define CLFKERNELSOURCES_HH_
10 
11 #include <OpenCLFramework/clfOpenCL.hh>
12 #include <map>
13 #include <string>
14 
15 namespace BIAS {
16 
17 class BIASOpenCLFramework_EXPORT clfKernelSources {
18 public:
20  virtual ~clfKernelSources();
21 
22  inline void AddSource(const std::string fname, std::string &source, unsigned int &blocks) {
23  clkernelmap_[fname] = source.c_str();
24  clnumblocks_[fname] = blocks;
25  }
26 
27  std::string GetSource(std::string fname);
28 
29  inline void AddSource(const std::string fname, const char *source, unsigned int &blocks) {
30  clkernelmap_[fname] = source;
31  clnumblocks_[fname] = blocks;
32  }
33 
34 private:
35  std::map<std::string, const char *> clkernelmap_;
36  std::map<std::string, unsigned int> clnumblocks_;
37 };
38 
39 } /* namespace BIAS */
40 #endif /* CLFKERNELSOURCES_HH_ */
void AddSource(const std::string fname, std::string &source, unsigned int &blocks)
void AddSource(const std::string fname, const char *source, unsigned int &blocks)