2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
9 #include "optimizations/All.hpp"
17 using OptimizationPtr = std::unique_ptr<Optimization>;
18 using Optimizations = std::vector<OptimizationPtr>;
20 static void Pass(Graph& graph, const Optimizations& optimizations);
23 ~Optimizer() = default;
30 void Append(Optimizer::Optimizations& optimizations, T&& optimization)
32 optimizations.emplace_back(new T(optimization));
35 template<typename Front, typename... Others>
36 void Append(Optimizer::Optimizations& optimizations, Front&& front, Others&&... others)
38 Append<Front>(optimizations, std::forward<Front>(front));
39 Append<Others...>(optimizations, std::forward<Others>(others)...);
42 template<typename... Args>
43 Optimizer::Optimizations MakeOptimizations(Args&&... args)
45 Optimizer::Optimizations optimizations;
47 Append(optimizations, std::forward<Args>(args)...);