giuseros commented on a change in pull request #8014:
URL: https://github.com/apache/tvm/pull/8014#discussion_r630169041



##########
File path: tests/python/relay/aot/aot_test_utils.py
##########
@@ -55,28 +62,16 @@ def subprocess_with_stdout_and_log(cmd, cwd, logfile, 
stdout):
                     print(text, end="")
 
 
-def create_main(test_name, input_list, output_list, output_path):
-    file_path = pathlib.Path(f"{output_path}/" + test_name).resolve()
-    # create header file
-    raw_path = file_path.with_suffix(".c").resolve()
-    with open(raw_path, "w") as main_file:
-        main_file.write("#include <stdio.h>\n")
-        main_file.write("#include <math.h>\n")
-        main_file.write('#include 
"tvm/runtime/crt/internal/aot_executor/aot_executor.h"\n')
-        main_file.write('#include "tvm/runtime/crt/stack_allocator.h"\n')
-        main_file.write("#define WORKSPACE_SIZE (16384*1024)\n")
-        main_file.write("static uint8_t g_aot_memory[WORKSPACE_SIZE];\n")
-
-        for i in range(0, len(input_list)):
-            main_file.write('#include "input_data%i.h"\n' % i)
-        for i in range(0, len(output_list)):
-            main_file.write('#include "expected_output_data%i.h"\n' % i)
-            main_file.write('#include "output_data%i.h"\n' % i)
-
-        main_file.write("extern tvm_model_t network;\n")
-        main_file.write("tvm_workspace_t app_workspace;\n")
-        main_file.write(
-            """
+def emit_main_network_definition(main_file, mod_name):
+    main_file.write(f'extern tvm_model_t {mangle_name(mod_name,"network")};\n')

Review comment:
       I am not addressing this here. In AOT, as of now, we are producing a 
global struct, and I am simply making that global struct prefixed (and hence I 
need to prefix also the `extern` definition used by the user to point to that 
`struct`)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to