IterationCompiler.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. #ifdef WITH_OPENCL
  28. std::unique_ptr<MandelGenerator> compileClFloat(const ir::Formula&, MandelDevice&);
  29. std::unique_ptr<MandelGenerator> compileClDouble(const ir::Formula&, MandelDevice&);
  30. std::unique_ptr<MandelGenerator> compileClDoubleDouble(const ir::Formula&, MandelDevice&);
  31. #endif // WITH_OPENCL
  32. }
  33. //void squareTest();
  34. struct mnd::GeneratorCollection
  35. {
  36. std::vector<std::unique_ptr<mnd::MandelGenerator>> cpuGenerators;
  37. std::vector<std::unique_ptr<mnd::MandelGenerator>> clGenerators;
  38. std::unique_ptr<mnd::AdaptiveGenerator> adaptiveGenerator;
  39. GeneratorCollection(void);
  40. GeneratorCollection(const GeneratorCollection&) = delete;
  41. GeneratorCollection(GeneratorCollection&&) = default;
  42. ~GeneratorCollection(void) = default;
  43. GeneratorCollection& operator=(GeneratorCollection&&) = default;
  44. GeneratorCollection& operator=(const GeneratorCollection&) = delete;
  45. };
  46. namespace mnd
  47. {
  48. CompiledGenerator compile(const ir::Formula& formula);
  49. std::unique_ptr<MandelGenerator> compileCl(const ir::Formula& formula, MandelDevice& md);
  50. }
  51. #endif // MANDEL_ITERATIONCOMPILER_H