Skip to content

Commit

Permalink
Merge pull request PaddlePaddle#20 from jim19930609/merge
Browse files Browse the repository at this point in the history
Changed AutoCodeGen to always overwrite previous contents during comp…
  • Loading branch information
JiabinYang authored Nov 17, 2021
2 parents 93397a3 + 5f39c66 commit 1703d47
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions paddle/fluid/eager/autocodegen/generate_file_structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,17 @@
"CMakeLists.txt")
forwards_level_cmakelist_path = os.path.join(forwards_dir, "CMakeLists.txt")

if not os.path.exists(nodes_level_cmakelist_path):
with open(nodes_level_cmakelist_path, "w") as f:
f.write(
"cc_library(dygraph_node SRCS %s DEPS ${eager_deps} ${fluid_deps})\n"
% " ".join([op_name + '_node.cc' for op_name in op_list]))
f.write("add_dependencies(dygraph_node eager_codegen)")
with open(nodes_level_cmakelist_path, "w") as f:
f.write(
"cc_library(dygraph_node SRCS %s DEPS ${eager_deps} ${fluid_deps})\n"
% " ".join([op_name + '_node.cc' for op_name in op_list]))
f.write("add_dependencies(dygraph_node eager_codegen)")

if not os.path.exists(forwards_level_cmakelist_path):
with open(forwards_level_cmakelist_path, "w") as f:
f.write(
"cc_library(dygraph_function SRCS %s DEPS ${eager_deps} ${fluid_deps} ${GLOB_OP_LIB})\n"
% " ".join([op_name + '_dygraph.cc' for op_name in op_list]))
f.write("add_dependencies(dygraph_function eager_codegen)")
with open(forwards_level_cmakelist_path, "w") as f:
f.write(
"cc_library(dygraph_function SRCS %s DEPS ${eager_deps} ${fluid_deps} ${GLOB_OP_LIB})\n"
% " ".join([op_name + '_dygraph.cc' for op_name in op_list]))
f.write("add_dependencies(dygraph_function eager_codegen)")

if not os.path.exists(generated_level_cmakelist_path):
with open(generated_level_cmakelist_path, "w") as f:
f.write("add_subdirectory(forwards)\nadd_subdirectory(nodes)")
with open(generated_level_cmakelist_path, "w") as f:
f.write("add_subdirectory(forwards)\nadd_subdirectory(nodes)")

0 comments on commit 1703d47

Please sign in to comment.