cmake refactor

pull/494/head
zhoufeng 5 years ago
parent 7afa6d0974
commit b681cec8f2

@ -4,7 +4,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Windows")
mindspore_add_pkg(onednn mindspore_add_pkg(onednn
VER 1.1.1 VER 1.1.1
LIBS dnnl mkldnn LIBS dnnl mkldnn
HEAD_ONLY ./ HEAD_ONLY ./include
RELEASE on RELEASE on
URL https://github.com/oneapi-src/oneDNN/releases/download/v1.1.1/dnnl_win_1.1.1_cpu_vcomp.zip URL https://github.com/oneapi-src/oneDNN/releases/download/v1.1.1/dnnl_win_1.1.1_cpu_vcomp.zip
MD5 ecaab9ed549643067699c80e5cea1c23) MD5 ecaab9ed549643067699c80e5cea1c23)

@ -38,15 +38,15 @@ function(ms_protobuf_generate c_var h_var)
get_filename_component(file_dir ${abs_file} PATH) get_filename_component(file_dir ${abs_file} PATH)
file(RELATIVE_PATH rel_path ${CMAKE_CURRENT_SOURCE_DIR} ${file_dir}) file(RELATIVE_PATH rel_path ${CMAKE_CURRENT_SOURCE_DIR} ${file_dir})
list(APPEND ${c_var} "${CMAKE_BINARY_DIR}/${rel_path}/${file_name}.pb.cc") list(APPEND ${c_var} "${CMAKE_BINARY_DIR}/proto/${file_name}.pb.cc")
list(APPEND ${h_var} "${CMAKE_BINARY_DIR}/${rel_path}/${file_name}.pb.h") list(APPEND ${h_var} "${CMAKE_BINARY_DIR}/proto/${file_name}.pb.h")
add_custom_command( add_custom_command(
OUTPUT "${CMAKE_BINARY_DIR}/${rel_path}/${file_name}.pb.cc" OUTPUT "${CMAKE_BINARY_DIR}/proto/${file_name}.pb.cc"
"${CMAKE_BINARY_DIR}/${rel_path}/${file_name}.pb.h" "${CMAKE_BINARY_DIR}/proto/${file_name}.pb.h"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/${rel_path}" COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/proto"
COMMAND protobuf::protoc -I${file_dir} --cpp_out=${CMAKE_BINARY_DIR}/${rel_path} ${abs_file} COMMAND protobuf::protoc -I${file_dir} --cpp_out=${CMAKE_BINARY_DIR}/proto ${abs_file}
DEPENDS protobuf::protoc ${abs_file} DEPENDS protobuf::protoc ${abs_file}
COMMENT "Running C++ protocol buffer compiler on ${file}" VERBATIM) COMMENT "Running C++ protocol buffer compiler on ${file}" VERBATIM)
endforeach() endforeach()
@ -71,38 +71,36 @@ function(ms_protobuf_generate_py c_var h_var py_var)
get_filename_component(abs_file ${file} ABSOLUTE) get_filename_component(abs_file ${file} ABSOLUTE)
get_filename_component(file_name ${file} NAME_WE) get_filename_component(file_name ${file} NAME_WE)
get_filename_component(file_dir ${abs_file} PATH) get_filename_component(file_dir ${abs_file} PATH)
file(RELATIVE_PATH rel_path ${CMAKE_CURRENT_SOURCE_DIR} ${file_dir})
list(APPEND ${c_var} "${CMAKE_BINARY_DIR}/${rel_path}/${file_name}.pb.cc") list(APPEND ${c_var} "${CMAKE_BINARY_DIR}/proto/${file_name}.pb.cc")
list(APPEND ${h_var} "${CMAKE_BINARY_DIR}/${rel_path}/${file_name}.pb.h") list(APPEND ${h_var} "${CMAKE_BINARY_DIR}/proto/${file_name}.pb.h")
list(APPEND ${py_var} "${CMAKE_BINARY_DIR}/${rel_path}/${file_name}_pb2.py") list(APPEND ${py_var} "${CMAKE_BINARY_DIR}/proto/${file_name}_pb2.py")
if (WIN32) if (WIN32)
add_custom_command( add_custom_command(
OUTPUT "${CMAKE_BINARY_DIR}/${rel_path}/${file_name}.pb.cc" OUTPUT "${CMAKE_BINARY_DIR}/proto/${file_name}.pb.cc"
"${CMAKE_BINARY_DIR}/${rel_path}/${file_name}.pb.h" "${CMAKE_BINARY_DIR}/proto/${file_name}.pb.h"
"${CMAKE_BINARY_DIR}/${rel_path}/${file_name}_pb2.py" "${CMAKE_BINARY_DIR}/proto/${file_name}_pb2.py"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/${rel_path}" COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/proto"
COMMAND protobuf::protoc -I${file_dir} --cpp_out=${CMAKE_BINARY_DIR}/${rel_path} ${abs_file} COMMAND protobuf::protoc -I${file_dir} --cpp_out=${CMAKE_BINARY_DIR}/proto ${abs_file}
COMMAND protobuf::protoc -I${file_dir} --python_out=${CMAKE_BINARY_DIR}/${rel_path} ${abs_file} COMMAND protobuf::protoc -I${file_dir} --python_out=${CMAKE_BINARY_DIR}/proto ${abs_file}
COMMAND protobuf::protoc -I${file_dir} --python_out=${CMAKE_BINARY_DIR}/${rel_path} ${abs_file} COMMAND protobuf::protoc -I${file_dir} --python_out=${CMAKE_BINARY_DIR}/proto ${abs_file}
COMMAND perl -pi.bak -e "s/import (.+_pb2.*)/from . import \\1/" "${CMAKE_BINARY_DIR}/${rel_path}/${file_name}_pb2.py" COMMAND perl -pi.bak -e "s/import (.+_pb2.*)/from . import \\1/" "${CMAKE_BINARY_DIR}/proto/${file_name}_pb2.py"
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/${rel_path}/${file_name}_pb2.py" "${PROJECT_SOURCE_DIR}/mindspore/train/" COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/proto/${file_name}_pb2.py" "${PROJECT_SOURCE_DIR}/mindspore/train/"
DEPENDS protobuf::protoc ${abs_file} DEPENDS protobuf::protoc ${abs_file}
COMMENT "Running C++ protocol buffer compiler on ${file}" VERBATIM ) COMMENT "Running C++ protocol buffer compiler on ${file}" VERBATIM )
else() else()
add_custom_command( add_custom_command(
OUTPUT "${CMAKE_BINARY_DIR}/${rel_path}/${file_name}.pb.cc" OUTPUT "${CMAKE_BINARY_DIR}/proto/${file_name}.pb.cc"
"${CMAKE_BINARY_DIR}/${rel_path}/${file_name}.pb.h" "${CMAKE_BINARY_DIR}/proto/${file_name}.pb.h"
"${CMAKE_BINARY_DIR}/${rel_path}/${file_name}_pb2.py" "${CMAKE_BINARY_DIR}/proto/${file_name}_pb2.py"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/${rel_path}" COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/proto"
COMMAND protobuf::protoc -I${file_dir} --cpp_out=${CMAKE_BINARY_DIR}/${rel_path} ${abs_file} COMMAND protobuf::protoc -I${file_dir} --cpp_out=${CMAKE_BINARY_DIR}/proto ${abs_file}
COMMAND protobuf::protoc -I${file_dir} --python_out=${CMAKE_BINARY_DIR}/${rel_path} ${abs_file} COMMAND protobuf::protoc -I${file_dir} --python_out=${CMAKE_BINARY_DIR}/proto ${abs_file}
COMMAND protobuf::protoc -I${file_dir} --python_out=${CMAKE_BINARY_DIR}/${rel_path} ${abs_file} COMMAND protobuf::protoc -I${file_dir} --python_out=${CMAKE_BINARY_DIR}/proto ${abs_file}
COMMAND perl -pi -e "s/import (.+_pb2.*)/from . import \\1/" "${CMAKE_BINARY_DIR}/${rel_path}/${file_name}_pb2.py" COMMAND perl -pi -e "s/import (.+_pb2.*)/from . import \\1/" "${CMAKE_BINARY_DIR}/proto/${file_name}_pb2.py"
COMMAND cp "${CMAKE_BINARY_DIR}/${rel_path}/${file_name}_pb2.py" "${PROJECT_SOURCE_DIR}/mindspore/train/" COMMAND cp "${CMAKE_BINARY_DIR}/proto/${file_name}_pb2.py" "${PROJECT_SOURCE_DIR}/mindspore/train/"
DEPENDS protobuf::protoc ${abs_file} DEPENDS protobuf::protoc ${abs_file}
COMMENT "Running C++ protocol buffer compiler on ${file}" VERBATIM) COMMENT "Running C++ protocol buffer compiler on ${file}" VERBATIM)
endif() endif()

File diff suppressed because it is too large Load Diff

@ -1,2 +1,2 @@
file(GLOB_RECURSE _COMMON_ALL_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cc")
add_library(_mindspore_common_obj OBJECT ${CMAKE_CURRENT_SOURCE_DIR}/*.cc) add_library(_mindspore_common_obj OBJECT ${_COMMON_ALL_SRC_FILES})

@ -21,7 +21,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "dataset/engine/data_buffer.h" #include "dataset/engine/data_buffer.h"
#include "./example.pb.h" #include "proto/example.pb.h"
#include "dataset/engine/datasetops/source/tf_client.h" #include "dataset/engine/datasetops/source/tf_client.h"
namespace mindspore { namespace mindspore {

@ -24,7 +24,7 @@
#include <algorithm> #include <algorithm>
#include "common/utils.h" #include "common/utils.h"
#include "./example.pb.h" #include "proto/example.pb.h"
#include "dataset/engine/datasetops/source/storage_client.h" #include "dataset/engine/datasetops/source/storage_client.h"
#include "dataset/util/path.h" #include "dataset/util/path.h"
#include "dataset/util/status.h" #include "dataset/util/status.h"

@ -25,7 +25,7 @@
#include <utility> #include <utility>
#include <vector> #include <vector>
#include <map> #include <map>
#include "./example.pb.h" #include "proto/example.pb.h"
#include "dataset/engine/datasetops/source/storage_client.h" #include "dataset/engine/datasetops/source/storage_client.h"
#include "dataset/util/status.h" #include "dataset/util/status.h"

@ -23,7 +23,7 @@
#include <utility> #include <utility>
#include <unordered_map> #include <unordered_map>
#include "./example.pb.h" #include "proto/example.pb.h"
#include "./securec.h" #include "./securec.h"
#include "common/utils.h" #include "common/utils.h"
#include "dataset/core/config_manager.h" #include "dataset/core/config_manager.h"

@ -1,9 +1,13 @@
set(_DEBUG_SRC_LIST set(_DEBUG_SRC_LIST
"${CMAKE_CURRENT_SOURCE_DIR}/anf_ir_dump.cc" "${CMAKE_CURRENT_SOURCE_DIR}/anf_ir_dump.cc"
"${CMAKE_CURRENT_SOURCE_DIR}/anf_ir_utils.cc" "${CMAKE_CURRENT_SOURCE_DIR}/anf_ir_utils.cc"
"${CMAKE_CURRENT_SOURCE_DIR}/draw.cc" "${CMAKE_CURRENT_SOURCE_DIR}/draw.cc"
"${CMAKE_CURRENT_SOURCE_DIR}/dump_proto.cc") "${CMAKE_CURRENT_SOURCE_DIR}/dump_proto.cc"
"${CMAKE_CURRENT_SOURCE_DIR}/info.cc"
"${CMAKE_CURRENT_SOURCE_DIR}/label.cc"
"${CMAKE_CURRENT_SOURCE_DIR}/trace_info.cc"
"${CMAKE_CURRENT_SOURCE_DIR}/trace.cc"
)
if (ENABLE_DUMP_E2E) if (ENABLE_DUMP_E2E)
list(APPEND _DEBUG_SRC_LIST "${CMAKE_CURRENT_SOURCE_DIR}/e2e_dump.cc") list(APPEND _DEBUG_SRC_LIST "${CMAKE_CURRENT_SOURCE_DIR}/e2e_dump.cc")

@ -23,7 +23,7 @@
#include <algorithm> #include <algorithm>
#include "debug/anf_ir_utils.h" #include "debug/anf_ir_utils.h"
#include "utils/anf_ir.pb.h" #include "proto/anf_ir.pb.h"
#include "utils/graph_utils.h" #include "utils/graph_utils.h"
#include "utils/symbolic.h" #include "utils/symbolic.h"

@ -1,34 +1,50 @@
file(GLOB_RECURSE _DEVICE_ALL_SRC_FILES *.cc) file(GLOB_RECURSE DEVICE_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "common/*.cc"
add_library(_mindspore_device_obj OBJECT ${_DEVICE_ALL_SRC_FILES}) "kernel_info.cc" "kernel_runtime.cc" "memory_manager.cc" "kernel_runtime_manager.cc" "convert_tensor_utils.cc"
)
if (ENABLE_GPU)
list(APPEND DEVICE_SRC_LIST "gpu/distribution/collective_init.cc")
else ()
list(APPEND DEVICE_SRC_LIST "gpu/distribution/collective_fake_init.cc")
endif ()
if (ENABLE_D)
file(GLOB_RECURSE D_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "ascend/*.cc" "kernel_adjust.cc")
endif ()
if (ENABLE_CPU) if (ENABLE_CPU)
target_compile_definitions(_mindspore_device_obj PRIVATE CPUSESSION) file(GLOB_RECURSE CPU_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "cpu/*.cc")
file(GLOB_RECURSE _CPU_SRC_LIST cpu/*.cc)
add_library(_c_expression_cpu_device_obj OBJECT ${_CPU_SRC_LIST})
endif () endif ()
# gpu
if (ENABLE_GPU) if (ENABLE_GPU)
file(GLOB_RECURSE _GPU_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} file(GLOB_RECURSE CUDA_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "gpu/*.cc" "gpu/*.cu")
"gpu/*.cc"
"gpu/*.cu" # gpu_queue
) list(REMOVE_ITEM CUDA_SRC_LIST "gpu/blocking_queue.cc" "gpu/gpu_buffer_mgr.cc")
list(REMOVE_ITEM _GPU_SRC_LIST "gpu/blocking_queue.cc" add_library(gpu_queue SHARED "gpu/blocking_queue.cc" "gpu/gpu_buffer_mgr.cc")
"gpu/gpu_buffer_mgr.cc" target_link_libraries(gpu_queue ${CMAKE_THREAD_LIBS_INIT} ${CUDA_PATH}/lib64/libcudart.so)
"gpu/mpi/mpi_initializer.cc"
list(REMOVE_ITEM CUDA_SRC_LIST "gpu/mpi/mpi_initializer.cc"
"gpu/distribution/collective_wrapper.cc" "gpu/distribution/collective_wrapper.cc"
"gpu/distribution/mpi_wrapper.cc" "gpu/distribution/mpi_wrapper.cc"
"gpu/distribution/nccl_wrapper.cc") "gpu/distribution/nccl_wrapper.cc"
add_library(_cuda_gpu_device_obj OBJECT ${_GPU_SRC_LIST}) )
endif()
if(ENABLE_D) if (ENABLE_MPI)
file(GLOB_RECURSE _D_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} include(ExternalProject)
"ascend/*.cc" # gpu_collective
"ascend/profiling/*.cc" add_library(gpu_collective SHARED "gpu/distribution/collective_wrapper.cc"
"ascend/tasksink/*.cc" "gpu/distribution/mpi_wrapper.cc"
"kernel_adjust.cc" "gpu/distribution/nccl_wrapper.cc"
"ascend/tasksink/taskinfo/*.cc"
) )
target_sources(_mindspore_device_obj PRIVATE ${_D_SRC_LIST}) # _ms_mpi
pybind11_add_module(_ms_mpi "gpu/mpi/mpi_initializer.cc")
target_link_libraries(_ms_mpi PRIVATE mindspore::pybind11_module mindspore::ompi)
target_link_libraries(gpu_collective PRIVATE mindspore::ompi mindspore::nccl)
endif ()
# add_library(_mindspore_device_cuda_obj OBJECT ${CUDA_SRC_LIST})
endif () endif ()
add_library(_mindspore_device_obj OBJECT ${DEVICE_SRC_LIST} ${D_SRC_LIST} ${CPU_SRC_LIST})

@ -0,0 +1,5 @@
file(GLOB_RECURSE MS_GVAR_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cc)
add_library(mindspore_gvar SHARED ${MS_GVAR_SRC_LIST})
if (APPLE)
set_target_properties(mindspore_gvar PROPERTIES MACOSX_RPATH ON)
endif ()

@ -1,5 +1,2 @@
file(GLOB_RECURSE _IR_ALL_SRC_FILES file(GLOB_RECURSE _IR_SRC_LIST ./*.cc dtype/*.cc)
./*.cc add_library(_mindspore_ir_obj OBJECT ${_IR_SRC_LIST})
dtype/*.cc)
add_library(_mindspore_ir_obj OBJECT ${_IR_ALL_SRC_FILES})

@ -1,34 +1,40 @@
file(GLOB_RECURSE _SESSION_ALL_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} file(GLOB_RECURSE KERNEL_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
"kernel_query.cc"
"kernel_fusion.cc"
"kernel_build_info.cc" "kernel_build_info.cc"
"kash/*.cc" "kash/*.cc"
"common_utils.cc" "common_utils.cc"
"oplib/*.cc" "oplib/*.cc"
) )
add_library(_mindspore_kernel_obj OBJECT ${_SESSION_ALL_SRC_FILES}) if (ENABLE_D)
file(GLOB_RECURSE D_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
"kernel_query.cc"
"kernel_fusion.cc"
"tbe/*.cc"
"aicpu/*.cc"
"mng/*.cc"
"hccl/*.cc"
)
add_compile_definitions(ENABLE_D)
endif ()
if (ENABLE_GPU) if (ENABLE_GPU)
file(GLOB_RECURSE _CUDA_GPU_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} file(GLOB_RECURSE CUDA_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
"gpu/*.cu" "gpu/*.cu"
"akg/gpu/*.cc" "akg/gpu/*.cc"
"akg/akgkernelbuild.cc"
"akg/akg_kernel_attrs_process.cc"
) )
add_library(_cuda_gpu_kernel_obj OBJECT ${_CUDA_GPU_SRC_LIST})
file(GLOB_RECURSE _C_EXPRESSION_GPU_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} file(GLOB_RECURSE GPU_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "gpu/*.cc")
"gpu/*.cc" list(REMOVE_ITEM GPU_SRC_LIST "gpu/nccl/nccl_gpu_kernel.cc")
)
list(REMOVE_ITEM _C_EXPRESSION_GPU_SRC_LIST "gpu/nccl/nccl_gpu_kernel.cc") if (ENABLE_MPI)
add_library(_c_expression_gpu_device_obj OBJECT ${_C_EXPRESSION_GPU_SRC_LIST}) include(ExternalProject)
file(GLOB_RECURSE GPU_NCCL_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "gpu/nccl/*.cc")
list(APPEND GPU_SRC_LIST ${GPU_NCCL_LIST})
endif () endif ()
if(ENABLE_D) # add_library(_mindspore_kernel_cuda_obj OBJECT ${CUDA_SRC_LIST})
file(GLOB_RECURSE _D_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
"tbe/*.cc"
"aicpu/*.cc"
"mng/*.cc"
"hccl/*.cc"
)
target_sources(_mindspore_kernel_obj PRIVATE ${_D_SRC_LIST})
endif() endif()
add_library(_mindspore_kernel_obj OBJECT ${KERNEL_SRC_LIST} ${GPU_SRC_LIST} ${D_SRC_LIST})

@ -1,5 +1,2 @@
file(GLOB_RECURSE _ONNX_ALL_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} file(GLOB_RECURSE _ONNX_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cc")
"*.cc" add_library(_mindspore_onnx_obj OBJECT ${_ONNX_SRC_FILES})
)
add_library(_mindspore_onnx_obj OBJECT ${_ONNX_ALL_SRC_FILES})

@ -24,7 +24,7 @@
#include <functional> #include <functional>
#include "debug/anf_ir_utils.h" #include "debug/anf_ir_utils.h"
#include "./onnx.pb.h" #include "proto/onnx.pb.h"
#include "operator/ops.h" #include "operator/ops.h"
namespace mindspore { namespace mindspore {

@ -1,5 +1,2 @@
file(GLOB_RECURSE _OPERATOR_ALL_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} file(GLOB_RECURSE _OPERATOR_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cc")
"*.cc" add_library(_mindspore_operator_obj OBJECT ${_OPERATOR_SRC_FILES})
)
add_library(_mindspore_operator_obj OBJECT ${_OPERATOR_ALL_SRC_FILES})

@ -1,9 +1,2 @@
file(GLOB_RECURSE _OPTIMIZER_ALL_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} file(GLOB_RECURSE _OPTIMIZER_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cc")
"*.cc" add_library(_mindspore_optimizer_obj OBJECT ${_OPTIMIZER_SRC_FILES})
)
add_library(_mindspore_optimizer_obj OBJECT ${_OPTIMIZER_ALL_SRC_FILES})
if(ENABLE_DUMP_PROTO)
file(GLOB_RECURSE _PROTO_SRC_LIST "parallel/strategy_checkpoint/parallel_strategy_checkpoint.cc")
target_sources(_mindspore_optimizer_obj PRIVATE ${_PROTO_SRC_LIST})
endif()

@ -0,0 +1,6 @@
file(GLOB_RECURSE _PARALLEL_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cc")
if (ENABLE_DUMP_PROTO)
list(REMOVE_ITEM _PARALLEL_SRC_FILES "parallel/strategy_checkpoint/parallel_strategy_checkpoint.cc")
endif ()
add_library(_mindspore_parallel_obj OBJECT ${_PARALLEL_SRC_FILES})

@ -23,7 +23,7 @@
#include "common/utils.h" #include "common/utils.h"
#include "utils/convert_utils.h" #include "utils/convert_utils.h"
#include "utils/log_adapter.h" #include "utils/log_adapter.h"
#include "utils/node_strategy.pb.h" #include "proto/node_strategy.pb.h"
namespace mindspore { namespace mindspore {
namespace parallel { namespace parallel {

@ -1,4 +1,4 @@
file(GLOB_RECURSE _PIPELINE_ALL_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} file(GLOB_RECURSE _PIPELINE_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
"pipeline.cc" "pipeline.cc"
"resource.cc" "resource.cc"
"pass.cc" "pass.cc"
@ -9,4 +9,9 @@ file(GLOB_RECURSE _PIPELINE_ALL_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
"static_analysis/*.cc" "static_analysis/*.cc"
) )
add_library(_mindspore_pipeline_obj OBJECT ${_PIPELINE_ALL_SRC_FILES}) if (ENABLE_GE OR ENABLE_D)
file(GLOB_RECURSE _PIPELINE_GE_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "pipeline_ge.cc")
list(APPEND _PIPELINE_SRC_FILES ${_PIPELINE_GE_SRC_FILES})
endif ()
add_library(_mindspore_pipeline_obj OBJECT ${_PIPELINE_SRC_FILES})

@ -0,0 +1,13 @@
file(GLOB_RECURSE _PREACTIVATE_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
"common/*.cc"
"mem_reuse/*.cc"
"pass/*.cc"
"gpu/*.cc"
)
if (ENABLE_D)
file(GLOB_RECURSE _D_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "ascend/*.cc")
list(APPEND _PREACTIVATE_SRC_LIST ${_D_SRC_LIST})
endif ()
add_library(_mindspore_pre_activate_obj OBJECT ${_PREACTIVATE_SRC_LIST})

@ -1,8 +1,14 @@
file(GLOB_RECURSE _PRE_ACTIVE_ALL_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} file(GLOB_RECURSE _PREDICT_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
"ascend/*.cc" "predict.cc"
"common/*.cc" "generator/utils/ir_model_util.cc"
"pass/*.cc" "converter/*.cc"
"gpu/*.cc" "converter/attr_utils/*.cc"
"converter/lite_model/*.cc"
"converter/lite_model/operations/*.cc"
) )
add_library(_mindspore_pre_active_obj OBJECT ${_PRE_ACTIVE_ALL_SRC_FILES}) if (ENABLE_D)
file(GLOB_RECURSE _D_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "generator/ir/*.cc")
list(APPEND _PREDICT_SRC_LIST ${_D_SRC_LIST})
endif ()
add_library(_mindspore_predict_obj OBJECT ${_PREDICT_SRC_LIST})

@ -21,7 +21,7 @@
#include <memory> #include <memory>
#include <string> #include <string>
#include <vector> #include <vector>
#include "predict/proto/ge_runtime_taskinfo.pb.h" #include "proto/ge_runtime_taskinfo.pb.h"
namespace mindspore { namespace mindspore {
namespace generator { namespace generator {

@ -1,5 +1,2 @@
file(GLOB_RECURSE _PYNATIVE_ALL_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} file(GLOB_RECURSE _PYBIND_API_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cc")
"*.cc" add_library(_mindspore_pybind_api_obj OBJECT ${_PYBIND_API_SRC_LIST})
)
add_library(_mindspore_pynative_obj OBJECT ${_PYNATIVE_ALL_SRC_FILES})

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save