diff options
Diffstat (limited to 'compiler/one-cmds/dummy-driver/src')
12 files changed, 484 insertions, 0 deletions
diff --git a/compiler/one-cmds/dummy-driver/src/dummy-compile.cpp b/compiler/one-cmds/dummy-driver/src/dummy-compile.cpp new file mode 100644 index 000000000..2ad09a3dd --- /dev/null +++ b/compiler/one-cmds/dummy-driver/src/dummy-compile.cpp @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * dummy-compile only tests its interface rather than its functionality. + * + * ./dummy-compile -o ${OUTPUT_NAME} ${INPUT_NAME} + * + * NOTE argv[3](INPUT_NAME) is not used here. + */ + +#include <iostream> +#include <fstream> +#include <string> + +int main(int argc, char **argv) +{ + if (argc != 4) + return EXIT_FAILURE; + + std::string opt_o{"-o"}; + std::string argv_1{argv[1]}; + + if (opt_o != argv_1) + return EXIT_FAILURE; + + std::string output_name{argv[2]}; + std::ofstream outfile(output_name); + + outfile << "dummy-compile dummy output!!" << std::endl; + + outfile.close(); + + return EXIT_SUCCESS; +} diff --git a/compiler/one-cmds/dummy-driver/src/dummy-infer.cpp b/compiler/one-cmds/dummy-driver/src/dummy-infer.cpp new file mode 100644 index 000000000..60f5faefa --- /dev/null +++ b/compiler/one-cmds/dummy-driver/src/dummy-infer.cpp @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * dummy-infer only tests its interface rather than its functionality. + * + * ./dummy-infer ${INPUT_NAME} + * dummy-infer dummy output!!! + */ + +#include <iostream> + +int main(int argc, char **argv) +{ + if (argc != 2) + return EXIT_FAILURE; + + std::cout << "dummy-infer dummy output!!!" << std::endl; + + return EXIT_SUCCESS; +} diff --git a/compiler/one-cmds/dummy-driver/src/dummy-inferV2.cpp b/compiler/one-cmds/dummy-driver/src/dummy-inferV2.cpp new file mode 100644 index 000000000..4b93c70a3 --- /dev/null +++ b/compiler/one-cmds/dummy-driver/src/dummy-inferV2.cpp @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * dummy-infer only tests its interface rather than its functionality. + * + * ./dummy-infer ${INPUT_NAME} + * Do inference of ${INPUT_NAME} + */ + +#include <iostream> + +int main(int argc, char **argv) +{ + if (argc != 2) + return EXIT_FAILURE; + + std::cout << "Do inference of " + std::string(argv[1]) << std::endl; + + return EXIT_SUCCESS; +} diff --git a/compiler/one-cmds/dummy-driver/src/dummy-onnx-ext.cpp b/compiler/one-cmds/dummy-driver/src/dummy-onnx-ext.cpp new file mode 100644 index 000000000..845445bf5 --- /dev/null +++ b/compiler/one-cmds/dummy-driver/src/dummy-onnx-ext.cpp @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2023 Samsung Electronics Co., Ltd. All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * dummy-onnx-ext only tests its interface rather than its functionality. + * + * ./dummy-onnx-ext [options] + * one-import-onnx-ext dummy output!!! + */ + +#include <iostream> +#include <fstream> +#include <string> + +int main(int argc, char **argv) +{ + (void)argc; + (void)argv; + + std::cout << "one-import-onnx-ext dummy output!!!" << std::endl; + + return EXIT_SUCCESS; +} diff --git a/compiler/one-cmds/dummy-driver/src/dummy-profile.cpp b/compiler/one-cmds/dummy-driver/src/dummy-profile.cpp new file mode 100644 index 000000000..b997e0514 --- /dev/null +++ b/compiler/one-cmds/dummy-driver/src/dummy-profile.cpp @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2021 Samsung Electronics Co., Ltd. All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * dummy-profile only tests its interface rather than its functionality. + * + * ./dummy-profile ${INPUT_NAME} + * dummy-profile dummy output!!! + */ + +#include <iostream> +#include <fstream> +#include <string> + +int main(int argc, char **argv) +{ + if (argc != 2) + return EXIT_FAILURE; + + std::cout << "dummy-profile dummy output!!!" << std::endl; + + return EXIT_SUCCESS; +} diff --git a/compiler/one-cmds/dummy-driver/src/dummyEnv-compile.cpp b/compiler/one-cmds/dummy-driver/src/dummyEnv-compile.cpp new file mode 100644 index 000000000..b16ea3000 --- /dev/null +++ b/compiler/one-cmds/dummy-driver/src/dummyEnv-compile.cpp @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2023 Samsung Electronics Co., Ltd. All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * dummyEnv-compile only tests its interface rather than its functionality. + * + * ./dummyEnv-compile ${DUMMY_OUTPUT} + */ + +#include <cstdlib> +#include <fstream> +#include <iostream> +#include <string> + +int main(int argc, char **argv) +{ + if (argc != 2) + return EXIT_FAILURE; + + std::string spm_size; + + if (const char *env_p = std::getenv("SPM_SIZE")) + spm_size = std::string(env_p); + + std::ofstream outfile(argv[1]); + + outfile << "SPM_SIZE=" << spm_size; + + outfile.close(); + + return EXIT_SUCCESS; +} diff --git a/compiler/one-cmds/dummy-driver/src/dummyV2-compile.cpp b/compiler/one-cmds/dummy-driver/src/dummyV2-compile.cpp new file mode 100644 index 000000000..bc7372e2e --- /dev/null +++ b/compiler/one-cmds/dummy-driver/src/dummyV2-compile.cpp @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2023 Samsung Electronics Co., Ltd. All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * dummyV2-compile only tests its interface rather than its functionality. + * + * ./dummyV2-compile -o ${OUTPUT_NAME} ${INPUT_NAME} + * + * NOTE argv[3](INPUT_NAME) is not used here. + */ + +#include <iostream> +#include <fstream> +#include <string> + +int main(int argc, char **argv) +{ + if (argc != 4) + return EXIT_FAILURE; + + std::string opt_o{"-O"}; + std::string argv_1{argv[1]}; + + if (opt_o != argv_1) + { + std::cout << "dummyV2-compile: Invalid option" << std::endl; + return EXIT_FAILURE; + } + + std::string output_name{argv[2]}; + std::ofstream outfile(output_name); + + outfile << "dummyV2-compile dummy output!!" << std::endl; + + outfile.close(); + + return EXIT_SUCCESS; +} diff --git a/compiler/one-cmds/dummy-driver/src/dummyV2-profile.cpp b/compiler/one-cmds/dummy-driver/src/dummyV2-profile.cpp new file mode 100644 index 000000000..020f320d9 --- /dev/null +++ b/compiler/one-cmds/dummy-driver/src/dummyV2-profile.cpp @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2023 Samsung Electronics Co., Ltd. All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * dummyV2-profile only tests its interface rather than its functionality. + * + * ./dummyV2-profile ${INPUT_NAME} + * dummyV2-profile dummy output!!! + */ + +#include <iostream> +#include <fstream> +#include <string> + +int main(int argc, char **argv) +{ + if (argc != 2) + return EXIT_FAILURE; + + std::cout << "dummyV2-profile dummy output!!!" << std::endl; + + return EXIT_SUCCESS; +} diff --git a/compiler/one-cmds/dummy-driver/src/dummyV3-profile.cpp b/compiler/one-cmds/dummy-driver/src/dummyV3-profile.cpp new file mode 100644 index 000000000..d10644696 --- /dev/null +++ b/compiler/one-cmds/dummy-driver/src/dummyV3-profile.cpp @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2023 Samsung Electronics Co., Ltd. All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * dummyV3-profile only tests its interface rather than its functionality. + * + * ./dummyV3-profile ${INPUT_TO_PRINT} + * dummyV3-profile with ${INPUT_TO_PRINT} + */ + +#include <iostream> +#include <fstream> +#include <string> + +int main(int argc, char **argv) +{ + if (argc != 2) + return EXIT_FAILURE; + + std::string input_to_print{argv[1]}; + + std::cout << "dummyV3-profile with " << input_to_print << std::endl; + + return EXIT_SUCCESS; +} diff --git a/compiler/one-cmds/dummy-driver/src/help-compile.cpp b/compiler/one-cmds/dummy-driver/src/help-compile.cpp new file mode 100644 index 000000000..9be9018f3 --- /dev/null +++ b/compiler/one-cmds/dummy-driver/src/help-compile.cpp @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2021 Samsung Electronics Co., Ltd. All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * help-compile prints dummy help message. + * + * $ ./help-compile -h + * HELP MESSAGE!! + */ + +#include <iostream> +#include <fstream> +#include <string> + +int main(int argc, char **argv) +{ + if (argc != 2) + return EXIT_FAILURE; + + std::string opt_h{"-h"}; + std::string argv_1{argv[1]}; + + if (opt_h != argv_1) + return EXIT_FAILURE; + + std::cout << "HELP MESSAGE!!" << std::endl; + + return EXIT_SUCCESS; +} diff --git a/compiler/one-cmds/dummy-driver/src/help-infer.cpp b/compiler/one-cmds/dummy-driver/src/help-infer.cpp new file mode 100644 index 000000000..821d368d4 --- /dev/null +++ b/compiler/one-cmds/dummy-driver/src/help-infer.cpp @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * help-infer prints dummy help message. + * + * $ ./help-infer -h + * HELP MESSAGE!! + */ + +#include <iostream> +#include <fstream> +#include <string> + +int main(int argc, char **argv) +{ + if (argc != 2) + return EXIT_FAILURE; + + std::string opt_h{"-h"}; + std::string argv_1{argv[1]}; + + if (opt_h != argv_1) + return EXIT_FAILURE; + + std::cout << "HELP MESSAGE!!" << std::endl; + + return EXIT_SUCCESS; +} diff --git a/compiler/one-cmds/dummy-driver/src/help-profile.cpp b/compiler/one-cmds/dummy-driver/src/help-profile.cpp new file mode 100644 index 000000000..51425360c --- /dev/null +++ b/compiler/one-cmds/dummy-driver/src/help-profile.cpp @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2021 Samsung Electronics Co., Ltd. All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * help-profile prints dummy help message. + * + * $ ./help-profile -h + * HELP MESSAGE!! + */ + +#include <iostream> +#include <fstream> +#include <string> + +int main(int argc, char **argv) +{ + if (argc != 2) + return EXIT_FAILURE; + + std::string opt_h{"-h"}; + std::string argv_1{argv[1]}; + + if (opt_h != argv_1) + return EXIT_FAILURE; + + std::cout << "HELP MESSAGE!!" << std::endl; + + return EXIT_SUCCESS; +} |