crown
1.0.0
|
00001 /* 00002 Copyright 2015 Nicolas Melot 00003 00004 This file is part of Crown. 00005 00006 Crown is free software: you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation, either version 3 of the License, or 00009 (at your option) any later version. 00010 00011 Crown is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with Crown. If not, see <http://www.gnu.org/licenses/>. 00018 00019 */ 00020 00021 00022 #include <fstream> 00023 00024 #include <crown/allocation.h> 00025 00026 #include <pelib/AmplOutput.hpp> 00027 #include <pelib/AmplInput.hpp> 00028 #include <pelib/Vector.hpp> 00029 #include <pelib/Set.hpp> 00030 #include <pelib/Matrix.hpp> 00031 #include <pelib/GraphML.hpp> 00032 #include <pelib/XMLSchedule.hpp> 00033 00034 using namespace std; 00035 using namespace pelib; 00036 00037 int 00038 main(int argc, char **argv) 00039 { 00040 Algebra mapp; 00041 00042 ifstream taskgraph(argv[1], std::ios::in); 00043 ifstream platform(argv[2], std::ios::in); 00044 00045 Algebra alg_arch = AmplInput(AmplInput::floatHandlers()).parse(platform); 00046 Platform arch(alg_arch); 00047 Algebra sched = AmplOutput(AmplOutput::floatHandlers()).parse(cin); 00048 Taskgraph *tg = GraphML().parse(taskgraph); 00049 Algebra input = tg->buildAlgebra(arch); 00050 taskgraph.close(); 00051 platform.close(); 00052 00053 input = input.merge(arch.buildAlgebra()); 00054 input = input.merge(sched); 00055 00056 // cout << setprecision(6) 00057 // << setiosflags(ios::fixed) 00058 // << setiosflags(ios::showpoint); 00059 00060 Schedule schedule("Generated from Algebra", Schedule::addStartTime(input, *tg, arch)); 00061 XMLSchedule().dump(cout, schedule, *tg, arch); 00062 00063 delete tg; 00064 return EXIT_SUCCESS; 00065 } 00066