IterationCompiler.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #ifndef MANDEL_ITERATIONCOMPILER_H
  2. #define MANDEL_ITERATIONCOMPILER_H
  3. #include "Generators.h"
  4. #include "ClGenerators.h"
  5. #include "IterationIR.h"
  6. #include <memory>
  7. namespace mnd
  8. {
  9. struct ExecData;
  10. class CompiledGenerator;
  11. class CompiledClGenerator;
  12. // forward declare
  13. class MandelContext;
  14. class MandelDevice;
  15. mnd::ExecData compile(mnd::MandelContext& mndCtxt);
  16. }
  17. void squareTest();
  18. class mnd::CompiledGenerator : public mnd::MandelGenerator
  19. {
  20. std::unique_ptr<ExecData> execData;
  21. public:
  22. CompiledGenerator(MandelContext& mndContext);
  23. CompiledGenerator(std::unique_ptr<ExecData> execData);
  24. CompiledGenerator(CompiledGenerator&&);
  25. virtual ~CompiledGenerator(void);
  26. virtual void generate(const MandelInfo& info, float* data);
  27. std::string dump(void) const;
  28. };
  29. #ifdef WITH_OPENCL
  30. class mnd::CompiledClGenerator : public mnd::ClGeneratorFloat
  31. {
  32. public:
  33. CompiledClGenerator(const MandelDevice& device, const std::string& code);
  34. //virtual ~CompiledGenerator(void);
  35. //virtual void generate(const MandelInfo& info, float* data);
  36. virtual std::string getKernelCode(bool smooth) const override;
  37. virtual void generate(const MandelInfo& info, float* data);
  38. //std::string dump(void) const;
  39. };
  40. #endif // WITH_OPENCL
  41. namespace mnd
  42. {
  43. CompiledGenerator compile(const ir::Formula& formula);
  44. std::unique_ptr<MandelGenerator> compileCl(const ir::Formula& formula, const MandelDevice& md);
  45. }
  46. #endif // MANDEL_ITERATIONCOMPILER_H