IterationCompiler.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. enum class GeneratorType : int;
  16. struct GeneratorCollection;
  17. //mnd::ExecData compile(mnd::MandelContext& mndCtxt);
  18. std::vector<std::unique_ptr<mnd::MandelGenerator>> compileCpu(mnd::MandelContext& mndCtxt,
  19. const IterationFormula& z0,
  20. const IterationFormula& zi);
  21. std::vector<std::unique_ptr<mnd::MandelGenerator>> compileOpenCl(mnd::MandelDevice& dev,
  22. const IterationFormula& z0,
  23. const IterationFormula& zi);
  24. GeneratorCollection compileFormula(mnd::MandelContext& mndCtxt,
  25. const IterationFormula& z0,
  26. const IterationFormula& zi);
  27. }
  28. //void squareTest();
  29. struct mnd::GeneratorCollection
  30. {
  31. std::vector<std::unique_ptr<mnd::MandelGenerator>> cpuGenerators;
  32. std::vector<std::unique_ptr<mnd::MandelGenerator>> clGenerators;
  33. std::unique_ptr<mnd::AdaptiveGenerator> adaptiveGenerator;
  34. GeneratorCollection(void);
  35. GeneratorCollection(const GeneratorCollection&) = delete;
  36. GeneratorCollection(GeneratorCollection&&) = default;
  37. ~GeneratorCollection(void) = default;
  38. GeneratorCollection& operator=(GeneratorCollection&&) = default;
  39. GeneratorCollection& operator=(const GeneratorCollection&) = delete;
  40. };
  41. namespace mnd
  42. {
  43. CompiledGenerator compile(const ir::Formula& formula);
  44. std::unique_ptr<MandelGenerator> compileCl(const ir::Formula& formula, MandelDevice& md);
  45. }
  46. #endif // MANDEL_ITERATIONCOMPILER_H