#ifndef MANDEL_MANDEL_H #define MANDEL_MANDEL_H #include #include #include #include #include "MandelUtil.h" #include "Generators.h" #include "CpuGenerators.h" #include "Hardware.h" //#include "Fixedp.h" namespace mnd { enum class GeneratorType; class MandelContext; class MandelDevice; extern MandelContext initializeContext(void); } enum class mnd::GeneratorType { FLOAT, FLOAT_SSE2, FLOAT_AVX, FLOAT_AVX512, FLOAT_NEON, DOUBLE, DOUBLE_SSE2, DOUBLE_AVX, DOUBLE_AVX512, DOUBLE_NEON, DOUBLE_DOUBLE, QUAD_DOUBLE, FLOAT128, FLOAT256 }; class mnd::MandelDevice { private: friend class MandelContext; std::string vendor; std::string name; std::map> generators; MandelDevice(void); public: MandelDevice(const MandelDevice&) = delete; MandelDevice(MandelDevice&&) = default; MandelDevice& operator=(const MandelDevice&) = delete; MandelDevice& operator=(MandelDevice&&) = default; inline const std::string& getVendor(void) const { return vendor; } inline const std::string& getName(void) const { return name; } Generator* getGenerator(GeneratorType type) const; }; class mnd::MandelContext { private: friend MandelContext mnd::initializeContext(void); CpuInfo cpuInfo; std::map> cpuGenerators; std::unique_ptr adaptiveGenerator; std::vector devices; MandelContext(void); std::unique_ptr createAdaptiveGenerator(void); std::vector createDevices(void); public: MandelContext(const MandelContext&) = delete; MandelContext(MandelContext&&) = default; MandelContext& operator=(const MandelContext&) = delete; MandelContext& operator=(MandelContext&&) = default; Generator& getDefaultGenerator(void); const std::vector& getDevices(void); Generator* getCpuGenerator(mnd::GeneratorType type); const CpuInfo& getCpuInfo(void) const { return cpuInfo; } }; #endif // MANDEL_MANDEL_H