ClGenerators.h 818 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef MANDEL_CLGENERATORS_H
  2. #define MANDEL_CLGENERATORS_H
  3. #include "Generators.h"
  4. #ifdef __APPLE__
  5. #include <OpenCL/cl.hpp>
  6. #else
  7. #include <CL/cl.hpp>
  8. #endif
  9. namespace mnd
  10. {
  11. class ClGenerator;
  12. class ClGeneratorFloat;
  13. }
  14. class mnd::ClGenerator : public Generator
  15. {
  16. protected:
  17. cl::Device device;
  18. cl::Context context;
  19. cl::Program program;
  20. cl::CommandQueue queue;
  21. public:
  22. ClGenerator(void);
  23. ~ClGenerator(void);
  24. virtual void generate(const MandelInfo& info, float* data);
  25. protected:
  26. virtual std::string getKernelCode(void) const = 0;
  27. };
  28. class mnd::ClGeneratorFloat : public ClGenerator
  29. {
  30. public:
  31. ClGeneratorFloat(void) = default;
  32. ~ClGeneratorFloat(void) = default;
  33. protected:
  34. virtual std::string getKernelCode(void) const;
  35. };
  36. #endif // MANDEL_CLGENERATORS_H