ONE - On-device Neural Engine
Loading...
Searching...
No Matches
dummy-compile.cpp
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
27#include <iostream>
28#include <fstream>
29#include <string>
30
31int main(int argc, char **argv)
32{
33 if (argc != 2 and argc != 4 and argc != 6)
34 return EXIT_FAILURE;
35
36 if (argc == 2)
37 {
38 std::string help_o{"-h"};
39 std::string argv_1{argv[1]};
40 if (help_o != argv_1)
41 return EXIT_FAILURE;
42
43 std::cout << "HELP MESSAGE!!" << std::endl;
44 return EXIT_SUCCESS;
45 }
46 if (argc == 4)
47 {
48 std::string opt_o{"-o"};
49 std::string argv_1{argv[1]};
50 if (opt_o != argv_1)
51 return EXIT_FAILURE;
52
53 std::string output_name{argv[2]};
54 std::ofstream outfile(output_name);
55 outfile << "dummy-compile dummy output!!" << std::endl;
56 outfile.close();
57 }
58 if (argc == 6)
59 {
60 std::string opt_T{"--target"};
61 std::string argv_1{argv[1]};
62 if (opt_T != argv_1)
63 return EXIT_FAILURE;
64 std::string target_name{argv[2]};
65
66 std::string opt_o{"-o"};
67 std::string argv_3{argv[3]};
68 if (opt_o != argv_3)
69 return EXIT_FAILURE;
70
71 std::string output_name{argv[4]};
72 std::ofstream outfile(output_name);
73 outfile << "dummy-compile with " << target_name << " target" << std::endl;
74 outfile.close();
75 }
76
77 return EXIT_SUCCESS;
78}
int main(void)