Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
63712848
M
mindspore
项目概览
magicwindyyd
/
mindspore
与 Fork 源项目一致
Fork自
MindSpore / mindspore
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindspore
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
63712848
编写于
4月 27, 2020
作者:
M
mindspore-ci-bot
提交者:
Gitee
4月 27, 2020
浏览文件
操作
浏览文件
下载
差异文件
!494 Split ccsrc cmake to individual sub-directories
Merge pull request !494 from zhoufeng/cmake-sub
上级
ef71ae94
b681cec8
变更
31
隐藏空白更改
内联
并排
Showing
31 changed file
with
333 addition
and
485 deletion
+333
-485
cmake/external_libs/mkl_dnn.cmake
cmake/external_libs/mkl_dnn.cmake
+1
-1
cmake/external_libs/protobuf.cmake
cmake/external_libs/protobuf.cmake
+29
-31
mindspore/ccsrc/CMakeLists.txt
mindspore/ccsrc/CMakeLists.txt
+85
-285
mindspore/ccsrc/common/CMakeLists.txt
mindspore/ccsrc/common/CMakeLists.txt
+2
-2
mindspore/ccsrc/dataset/engine/datasetops/source/tf_buffer.h
mindspore/ccsrc/dataset/engine/datasetops/source/tf_buffer.h
+1
-1
mindspore/ccsrc/dataset/engine/datasetops/source/tf_client.cc
...spore/ccsrc/dataset/engine/datasetops/source/tf_client.cc
+1
-1
mindspore/ccsrc/dataset/engine/datasetops/source/tf_client.h
mindspore/ccsrc/dataset/engine/datasetops/source/tf_client.h
+1
-1
mindspore/ccsrc/dataset/engine/datasetops/source/tf_reader_op.cc
...re/ccsrc/dataset/engine/datasetops/source/tf_reader_op.cc
+1
-1
mindspore/ccsrc/debug/CMakeLists.txt
mindspore/ccsrc/debug/CMakeLists.txt
+12
-8
mindspore/ccsrc/debug/dump_proto.cc
mindspore/ccsrc/debug/dump_proto.cc
+1
-1
mindspore/ccsrc/device/CMakeLists.txt
mindspore/ccsrc/device/CMakeLists.txt
+47
-31
mindspore/ccsrc/gvar/CMakeLists.txt
mindspore/ccsrc/gvar/CMakeLists.txt
+5
-0
mindspore/ccsrc/ir/CMakeLists.txt
mindspore/ccsrc/ir/CMakeLists.txt
+2
-5
mindspore/ccsrc/kernel/CMakeLists.txt
mindspore/ccsrc/kernel/CMakeLists.txt
+40
-34
mindspore/ccsrc/onnx/CMakeLists.txt
mindspore/ccsrc/onnx/CMakeLists.txt
+2
-5
mindspore/ccsrc/onnx/onnx_exporter.cc
mindspore/ccsrc/onnx/onnx_exporter.cc
+1
-1
mindspore/ccsrc/operator/CMakeLists.txt
mindspore/ccsrc/operator/CMakeLists.txt
+2
-5
mindspore/ccsrc/optimizer/CMakeLists.txt
mindspore/ccsrc/optimizer/CMakeLists.txt
+2
-9
mindspore/ccsrc/parallel/CMakeLists.txt
mindspore/ccsrc/parallel/CMakeLists.txt
+6
-0
mindspore/ccsrc/parallel/strategy_checkpoint/parallel_strategy_checkpoint.cc
...allel/strategy_checkpoint/parallel_strategy_checkpoint.cc
+1
-1
mindspore/ccsrc/pipeline/CMakeLists.txt
mindspore/ccsrc/pipeline/CMakeLists.txt
+16
-11
mindspore/ccsrc/pre_activate/CMakeLists.txt
mindspore/ccsrc/pre_activate/CMakeLists.txt
+13
-0
mindspore/ccsrc/predict/CMakeLists.txt
mindspore/ccsrc/predict/CMakeLists.txt
+13
-7
mindspore/ccsrc/predict/generator/ir/ir_task_info.h
mindspore/ccsrc/predict/generator/ir/ir_task_info.h
+1
-1
mindspore/ccsrc/pybind_api/CMakeLists.txt
mindspore/ccsrc/pybind_api/CMakeLists.txt
+2
-5
mindspore/ccsrc/pynative/CMakeLists.txt
mindspore/ccsrc/pynative/CMakeLists.txt
+8
-5
mindspore/ccsrc/session/CMakeLists.txt
mindspore/ccsrc/session/CMakeLists.txt
+19
-19
mindspore/ccsrc/transform/CMakeLists.txt
mindspore/ccsrc/transform/CMakeLists.txt
+7
-4
mindspore/ccsrc/transform/convert.cc
mindspore/ccsrc/transform/convert.cc
+2
-2
mindspore/ccsrc/utils/CMakeLists.txt
mindspore/ccsrc/utils/CMakeLists.txt
+8
-3
mindspore/ccsrc/vm/CMakeLists.txt
mindspore/ccsrc/vm/CMakeLists.txt
+2
-5
未找到文件。
cmake/external_libs/mkl_dnn.cmake
浏览文件 @
63712848
...
...
@@ -4,7 +4,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Windows")
mindspore_add_pkg
(
onednn
VER 1.1.1
LIBS dnnl mkldnn
HEAD_ONLY ./
HEAD_ONLY ./
include
RELEASE on
URL https://github.com/oneapi-src/oneDNN/releases/download/v1.1.1/dnnl_win_1.1.1_cpu_vcomp.zip
MD5 ecaab9ed549643067699c80e5cea1c23
)
...
...
cmake/external_libs/protobuf.cmake
浏览文件 @
63712848
...
...
@@ -38,17 +38,17 @@ function(ms_protobuf_generate c_var h_var)
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
${
h_var
}
"
${
CMAKE_BINARY_DIR
}
/
${
rel_path
}
/
${
file_name
}
.pb.h"
)
list
(
APPEND
${
c_var
}
"
${
CMAKE_BINARY_DIR
}
/
proto
/
${
file_name
}
.pb.cc"
)
list
(
APPEND
${
h_var
}
"
${
CMAKE_BINARY_DIR
}
/
proto
/
${
file_name
}
.pb.h"
)
add_custom_command
(
OUTPUT
"
${
CMAKE_BINARY_DIR
}
/
${
rel_path
}
/
${
file_name
}
.pb.cc"
"
${
CMAKE_BINARY_DIR
}
/
${
rel_path
}
/
${
file_name
}
.pb.h"
OUTPUT
"
${
CMAKE_BINARY_DIR
}
/
proto
/
${
file_name
}
.pb.cc"
"
${
CMAKE_BINARY_DIR
}
/
proto
/
${
file_name
}
.pb.h"
WORKING_DIRECTORY
${
PROJECT_SOURCE_DIR
}
COMMAND
${
CMAKE_COMMAND
}
-E make_directory
"
${
CMAKE_BINARY_DIR
}
/
${
rel_path
}
"
COMMAND protobuf::protoc -I
${
file_dir
}
--cpp_out=
${
CMAKE_BINARY_DIR
}
/
${
rel_path
}
${
abs_file
}
COMMAND
${
CMAKE_COMMAND
}
-E make_directory
"
${
CMAKE_BINARY_DIR
}
/
proto
"
COMMAND protobuf::protoc -I
${
file_dir
}
--cpp_out=
${
CMAKE_BINARY_DIR
}
/
proto
${
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
()
set_source_files_properties
(
${${
c_var
}}
${${
h_var
}}
PROPERTIES GENERATED TRUE
)
...
...
@@ -71,40 +71,38 @@ function(ms_protobuf_generate_py c_var h_var py_var)
get_filename_component
(
abs_file
${
file
}
ABSOLUTE
)
get_filename_component
(
file_name
${
file
}
NAME_WE
)
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
${
h_var
}
"
${
CMAKE_BINARY_DIR
}
/
${
rel_path
}
/
${
file_name
}
.pb.h"
)
list
(
APPEND
${
py_var
}
"
${
CMAKE_BINARY_DIR
}
/
${
rel_path
}
/
${
file_name
}
_pb2.py"
)
list
(
APPEND
${
c_var
}
"
${
CMAKE_BINARY_DIR
}
/
proto
/
${
file_name
}
.pb.cc"
)
list
(
APPEND
${
h_var
}
"
${
CMAKE_BINARY_DIR
}
/
proto
/
${
file_name
}
.pb.h"
)
list
(
APPEND
${
py_var
}
"
${
CMAKE_BINARY_DIR
}
/
proto
/
${
file_name
}
_pb2.py"
)
if
(
WIN32
)
add_custom_command
(
OUTPUT
"
${
CMAKE_BINARY_DIR
}
/
${
rel_path
}
/
${
file_name
}
.pb.cc"
"
${
CMAKE_BINARY_DIR
}
/
${
rel_path
}
/
${
file_name
}
.pb.h"
"
${
CMAKE_BINARY_DIR
}
/
${
rel_path
}
/
${
file_name
}
_pb2.py"
OUTPUT
"
${
CMAKE_BINARY_DIR
}
/
proto
/
${
file_name
}
.pb.cc"
"
${
CMAKE_BINARY_DIR
}
/
proto
/
${
file_name
}
.pb.h"
"
${
CMAKE_BINARY_DIR
}
/
proto
/
${
file_name
}
_pb2.py"
WORKING_DIRECTORY
${
PROJECT_SOURCE_DIR
}
COMMAND
${
CMAKE_COMMAND
}
-E make_directory
"
${
CMAKE_BINARY_DIR
}
/
${
rel_path
}
"
COMMAND protobuf::protoc -I
${
file_dir
}
--cpp_out=
${
CMAKE_BINARY_DIR
}
/
${
rel_path
}
${
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
}
/
${
rel_path
}
${
abs_file
}
COMMAND perl -pi.bak -e
"s/import (.+_pb2.*)/from . import
\\
1/"
"
${
CMAKE_BINARY_DIR
}
/
${
rel_path
}
/
${
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 make_directory
"
${
CMAKE_BINARY_DIR
}
/
proto
"
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
}
/
proto
${
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
}
/
proto
/
${
file_name
}
_pb2.py"
COMMAND
${
CMAKE_COMMAND
}
-E copy
"
${
CMAKE_BINARY_DIR
}
/
proto
/
${
file_name
}
_pb2.py"
"
${
PROJECT_SOURCE_DIR
}
/mindspore/train/"
DEPENDS protobuf::protoc
${
abs_file
}
COMMENT
"Running C++ protocol buffer compiler on
${
file
}
"
VERBATIM
)
else
()
add_custom_command
(
OUTPUT
"
${
CMAKE_BINARY_DIR
}
/
${
rel_path
}
/
${
file_name
}
.pb.cc"
"
${
CMAKE_BINARY_DIR
}
/
${
rel_path
}
/
${
file_name
}
.pb.h"
"
${
CMAKE_BINARY_DIR
}
/
${
rel_path
}
/
${
file_name
}
_pb2.py"
OUTPUT
"
${
CMAKE_BINARY_DIR
}
/
proto
/
${
file_name
}
.pb.cc"
"
${
CMAKE_BINARY_DIR
}
/
proto
/
${
file_name
}
.pb.h"
"
${
CMAKE_BINARY_DIR
}
/
proto
/
${
file_name
}
_pb2.py"
WORKING_DIRECTORY
${
PROJECT_SOURCE_DIR
}
COMMAND
${
CMAKE_COMMAND
}
-E make_directory
"
${
CMAKE_BINARY_DIR
}
/
${
rel_path
}
"
COMMAND protobuf::protoc -I
${
file_dir
}
--cpp_out=
${
CMAKE_BINARY_DIR
}
/
${
rel_path
}
${
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
}
/
${
rel_path
}
${
abs_file
}
COMMAND perl -pi -e
"s/import (.+_pb2.*)/from . import
\\
1/"
"
${
CMAKE_BINARY_DIR
}
/
${
rel_path
}
/
${
file_name
}
_pb2.py"
COMMAND cp
"
${
CMAKE_BINARY_DIR
}
/
${
rel_path
}
/
${
file_name
}
_pb2.py"
"
${
PROJECT_SOURCE_DIR
}
/mindspore/train/"
COMMAND
${
CMAKE_COMMAND
}
-E make_directory
"
${
CMAKE_BINARY_DIR
}
/
proto
"
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
}
/
proto
${
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
}
/
proto
/
${
file_name
}
_pb2.py"
COMMAND cp
"
${
CMAKE_BINARY_DIR
}
/
proto
/
${
file_name
}
_pb2.py"
"
${
PROJECT_SOURCE_DIR
}
/mindspore/train/"
DEPENDS protobuf::protoc
${
abs_file
}
COMMENT
"Running C++ protocol buffer compiler on
${
file
}
"
VERBATIM
)
COMMENT
"Running C++ protocol buffer compiler on
${
file
}
"
VERBATIM
)
endif
()
endforeach
()
set_source_files_properties
(
${${
c_var
}}
${${
h_var
}}
${${
py_var
}}
PROPERTIES GENERATED TRUE
)
...
...
mindspore/ccsrc/CMakeLists.txt
浏览文件 @
63712848
## common setting
include_directories
(
${
CMAKE_CURRENT_SOURCE_DIR
}
)
if
(
ENABLE_CPU
)
include
(
ExternalProject
)
add_compile_definitions
(
CPUSESSION
)
file
(
GLOB_RECURSE CPU_SRC_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"device/cpu/*.cc"
)
if
(
CMAKE_SYSTEM_NAME MATCHES
"Windows"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-attributes -DHAVE_SNPRINTF"
)
add_compile_definitions
(
BUILDING_DLL
)
endif
()
include_directories
(
${
CMAKE_BINARY_DIR
}
)
link_directories
(
${
CMAKE_SOURCE_DIR
}
/build/mindspore/graphengine
)
if
(
CMAKE_SYSTEM_NAME MATCHES
"Windows"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-attributes -DHAVE_SNPRINTF"
)
add_compile_definitions
(
BUILDING_DLL
)
endif
()
if
(
ENABLE_GPU
)
...
...
@@ -20,7 +17,7 @@ if(ENABLE_GPU)
enable_language
(
CUDA
)
if
(
NOT CUDA_PATH OR CUDA_PATH STREQUAL
""
)
if
(
DEFINED ENV{CUDA_HOME}
)
set
(
CUDA_PATH $ENV{CUDA_HOME}
)
set
(
CUDA_PATH $ENV{CUDA_HOME}
)
else
()
set
(
CUDA_PATH
${
CUDA_TOOLKIT_ROOT_DIR
}
)
endif
()
...
...
@@ -41,261 +38,101 @@ if(ENABLE_GPU)
"kernel/akg/akgkernelbuild.cc"
"kernel/akg/akg_kernel_attrs_process.cc"
)
file
(
GLOB_RECURSE GPU_KERNEL_SRC_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"kernel/gpu/*.cc"
)
list
(
APPEND CUDA_NVCC_FLAGS -arch=sm_53
)
list
(
REMOVE_ITEM GPU_SRC_LIST
"device/gpu/blocking_queue.cc"
"device/gpu/gpu_buffer_mgr.cc"
)
add_library
(
gpu_queue SHARED
"device/gpu/blocking_queue.cc"
"device/gpu/gpu_buffer_mgr.cc"
)
target_link_libraries
(
gpu_queue
${
CMAKE_THREAD_LIBS_INIT
}
${
CUDA_PATH
}
/lib64/libcudart.so
)
file
(
GLOB_RECURSE MS_STEPS_SRC_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"session/gpu_session.cc"
)
list
(
REMOVE_ITEM GPU_SRC_LIST
"device/gpu/mpi/mpi_initializer.cc"
"device/gpu/distribution/collective_wrapper.cc"
"device/gpu/distribution/mpi_wrapper.cc"
"device/gpu/distribution/nccl_wrapper.cc"
)
list
(
REMOVE_ITEM GPU_KERNEL_SRC_LIST
"device/gpu/mpi/mpi_initializer.cc"
"kernel/gpu/nccl/nccl_gpu_kernel.cc"
)
set
(
NVCC_TMP_CMAKE_CXX_FLAGS
${
CMAKE_CXX_FLAGS
}
)
string
(
REPLACE
"-std=c++17"
"-std=c++11"
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
"
)
cuda_add_library
(
gpu_cuda_lib STATIC
${
GPU_SRC_LIST
}
)
set
(
CMAKE_CXX_FLAGS
${
NVCC_TMP_CMAKE_CXX_FLAGS
}
)
endif
()
if
(
ENABLE_MPI
)
include
(
ExternalProject
)
file
(
GLOB_RECURSE GPU_NCCL_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"kernel/gpu/nccl/*.cc"
)
file
(
GLOB_RECURSE GPU_MPI_PYTHON_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"device/gpu/mpi/mpi_initializer.cc"
)
add_library
(
gpu_collective SHARED
"device/gpu/distribution/collective_wrapper.cc"
"device/gpu/distribution/mpi_wrapper.cc"
"device/gpu/distribution/nccl_wrapper.cc"
)
endif
()
endif
()
## make flatuffer files
include_directories
(
"
${
CMAKE_BINARY_DIR
}
/predict/schema/inner"
)
file
(
GLOB_RECURSE FLATBUFFER_IN RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"predict/schema/*.fbs"
)
set
(
FLATBUFFER_OU
"
${
CMAKE_BINARY_DIR
}
/predict/schema/inner"
)
ms_build_flatbuffers
(
"
${
FLATBUFFER_IN
}
"
"
${
FLATBUFFER_IN
}
"
GENERATED_OUTPUT_DIR
"
${
FLATBUFFER_OU
}
"
)
ms_build_flatbuffers
(
"
${
FLATBUFFER_IN
}
"
"
${
FLATBUFFER_IN
}
"
flat_input
"
${
FLATBUFFER_OU
}
"
)
file
(
GLOB_RECURSE MINDSPORE_SRC_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"ir/*.cc"
"ir/dtype/*.cc"
"utils/context/ms_context.cc"
"utils/symbolic.cc"
"utils/tensorprint_utils.cc"
"utils/convert_utils.cc"
"utils/graph_utils.cc"
"utils/misc.cc"
"utils/callbacks.cc"
"utils/profile.cc"
"utils/base_ref.cc"
"utils/summary/event_writer.cc"
"utils/log_adapter.cc"
"utils/comm_manager.cc"
"utils/any.cc"
"utils/config_manager.cc"
"utils/system/file_system.cc"
"utils/system/crc32c.cc"
"common/*.cc"
"parallel/*.cc"
"pipeline/pipeline.cc"
"pipeline/resource.cc"
"pipeline/pass.cc"
"pipeline/action.cc"
"pipeline/validator.cc"
"pipeline/remove_value_node_dup.cc"
"pipeline/parse/*.cc"
"pipeline/static_analysis/*.cc"
"optimizer/*.cc"
"debug/*.cc"
"onnx/onnx_exporter.cc"
"operator/*.cc"
"session/kernel_graph.cc"
"utils/node_utils.cc"
"session/session_basic.cc"
"session/session_factory.cc"
"session/anf_runtime_algorithm.cc"
"vm/*.cc"
"pynative/base.cc"
"pynative/pynative_execute.cc"
"pybind_api/*.cc"
"device/common/*.cc"
"kernel/kernel_query.cc"
"kernel/kernel_build_info.cc"
"kernel/kash/*.cc"
"device/kernel_info.cc"
"device/kernel_runtime.cc"
"device/memory_manager.cc"
"device/kernel_runtime_manager.cc"
"device/convert_tensor_utils.cc"
"pre_activate/common/*.cc"
"pre_activate/pass/*.cc"
"pre_activate/gpu/*.cc"
"pre_activate/mem_reuse/*.cc"
"predict/predict.cc"
"predict/generator/utils/ir_model_util.cc"
"predict/converter/*.cc"
"predict/converter/attr_utils/*.cc"
"predict/converter/lite_model/*.cc"
"predict/converter/lite_model/operations/*.cc"
"kernel/common_utils.cc"
"kernel/oplib/*.cc"
"kernel/kash/*.cc"
"device/gpu/distribution/collective_init.cc"
)
if
(
ENABLE_CPU
)
list
(
REMOVE_ITEM MINDSPORE_SRC_LIST
"device/gpu/distribution/collective_init.cc"
)
if
(
${
CMAKE_SYSTEM_NAME
}
MATCHES
"Windows"
)
list
(
REMOVE_ITEM MINDSPORE_SRC_LIST
"kernel/kernel_query.cc"
)
endif
()
endif
()
if
(
NOT ENABLE_GPU
)
list
(
APPEND MINDSPORE_SRC_LIST
"device/gpu/distribution/collective_fake_init.cc"
)
endif
()
file
(
GLOB_RECURSE MEM_REUSE_SRC_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"pre_activate/mem_reuse/*.cc"
)
if
(
NOT ENABLE_DUMP_E2E
)
list
(
REMOVE_ITEM MINDSPORE_SRC_LIST
"debug/e2e_dump.cc"
)
endif
()
file
(
COPY
"
${
ms_onnx_INC
}
/onnx/onnx.proto"
DESTINATION
${
CMAKE_CURRENT_SOURCE_DIR
}
)
file
(
GLOB_RECURSE ONNX_PROTO RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/onnx.proto"
)
message
(
"onnx proto path is :
${
ONNX_PROTO
}
"
)
## make protobuf files
file
(
COPY
"
${
ms_onnx_INC
}
/onnx/onnx.proto"
DESTINATION
${
CMAKE_BINARY_DIR
}
/proto
)
file
(
GLOB ONNX_PROTO
""
${
CMAKE_BINARY_DIR
}
/proto/onnx.proto
)
message
(
"onnx proto path is :"
${
ONNX_PROTO
}
)
ms_protobuf_generate
(
ONNX_PROTO_SRCS ONNX_PROTO_HDRS
${
ONNX_PROTO
}
)
list
(
APPEND MINDSPORE_PROTO_LIST
${
ONNX_PROTO_SRCS
}
)
if
(
ENABLE_DUMP_PROTO
)
if
(
ENABLE_DUMP_PROTO
)
include_directories
(
${
CMAKE_BINARY_DIR
}
)
file
(
GLOB_RECURSE PROTO_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"utils/node_strategy.proto"
)
file
(
GLOB_RECURSE PROTO_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"utils/node_strategy.proto"
)
ms_protobuf_generate
(
PROTO_SRCS PROTO_HDRS
${
PROTO_LIST
}
)
file
(
GLOB_RECURSE PROTO_PY RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"utils/anf_ir.proto"
"utils/summary.proto"
"utils/checkpoint.proto"
)
"utils/anf_ir.proto"
"utils/summary.proto"
"utils/checkpoint.proto"
)
ms_protobuf_generate_py
(
PY_SRCS PY_HDRS PY_PYS
${
PROTO_PY
}
)
list
(
APPEND MINDSPORE_PROTO_DUMP_LIST
${
PROTO_SRCS
}
)
list
(
APPEND MINDSPORE_PROTO_DUMP_LIST
${
PY_SRCS
}
)
list
(
APPEND MINDSPORE_SRC_LIST
"debug/dump_proto.cc"
)
list
(
APPEND MINDSPORE_SRC_LIST
"parallel/strategy_checkpoint/parallel_strategy_checkpoint.cc"
)
add_compile_definitions
(
ENABLE_DUMP_PROTO
)
endif
()
if
(
ENABLE_GE
)
file
(
GLOB_RECURSE GE_SRC_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"transform/*.cc"
"pynative/pynative_execute_ge.cc"
"utils/callbacks_ge.cc"
"pipeline/pipeline_ge.cc"
)
list
(
APPEND MINDSPORE_SRC_LIST
${
GE_SRC_LIST
}
)
endif
()
list
(
APPEND MINDSPORE_PROTO_LIST
${
PROTO_SRCS
}
)
list
(
APPEND MINDSPORE_PROTO_LIST
${
PY_SRCS
}
)
endif
()
if
(
ENABLE_D
)
if
(
ENABLE_D
)
include_directories
(
"
${
CMAKE_BINARY_DIR
}
/kernel/aicpu"
)
file
(
GLOB_RECURSE PROTO_IN RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"kernel/aicpu/proto/*.proto"
)
ms_protobuf_generate
(
PROTOSRCS PROTOHDRS
${
PROTO_IN
}
)
include_directories
(
"
${
CMAKE_BINARY_DIR
}
/predict/generator/ir"
)
file
(
GLOB_RECURSE PROTO_INNER RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"predict/proto/*.proto"
)
file
(
GLOB_RECURSE PROTO_IN RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"kernel/aicpu/proto/*.proto"
)
ms_protobuf_generate
(
PROTOSRCS PROTOHDRS
${
PROTO_IN
}
)
file
(
GLOB_RECURSE PROTO_INNER RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"predict/proto/*.proto"
)
ms_protobuf_generate
(
PREDICT_PROTOSRCS PREDICT_PROTOHDRS
${
PROTO_INNER
}
)
file
(
GLOB_RECURSE D_SRC_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"device/ascend/*.cc"
"device/ascend/profiling/*.cc"
"device/ascend/tasksink/*.cc"
"device/kernel_adjust.cc"
"kernel/kernel_fusion.cc"
"kernel/tbe/*.cc"
"pre_activate/ascend/*.cc"
"transform/*.cc"
"pipeline/pipeline_ge.cc"
)
list
(
APPEND MINDSPORE_SRC_LIST
${
D_SRC_LIST
}
)
list
(
APPEND MINDSPORE_PROTO_AICPU_LIST
${
PROTOSRCS
}
)
list
(
APPEND MINDSPORE_PROTO_PREDICT_LIST
${
PREDICT_PROTOSRCS
}
)
list
(
APPEND MINDSPORE_PROTO_LIST
${
PROTOSRCS
}
)
list
(
APPEND MINDSPORE_PROTO_LIST
${
PREDICT_PROTOSRCS
}
)
file
(
GLOB_RECURSE MS_STEPS_SRC_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"session/ascend_session.cc"
)
file
(
GLOB_RECURSE MS_TASKINFO_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"device/ascend/tasksink/taskinfo/*.cc"
)
file
(
GLOB_RECURSE MS_AICPU_SRC_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"kernel/aicpu/*.cc"
)
file
(
GLOB_RECURSE MS_RT_SRC_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"kernel/mng/*.cc"
)
file
(
GLOB_RECURSE MS_HCCL_SRC_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"kernel/hccl/*.cc"
)
file
(
GLOB_RECURSE MS_PREDICT_SRC_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"predict/generator/ir/*.cc"
)
add_compile_definitions
(
ENABLE_D
)
endif
()
file
(
GLOB_RECURSE MS_GVAR_SRC_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"gvar/*.cc"
)
add_library
(
mindspore_gvar SHARED
${
MS_GVAR_SRC_LIST
}
)
add_library
(
mindspore STATIC
${
MINDSPORE_SRC_LIST
}
)
add_dependencies
(
mindspore GENERATED_OUTPUT_DIR
)
endif
()
if
(
ENABLE_D
)
list
(
APPEND MINDSPORE_PROTO_LIST
${
MINDSPORE_PROTO_AICPU_LIST
}
)
endif
()
if
(
ENABLE_DUMP_PROTO
)
list
(
APPEND MINDSPORE_PROTO_LIST
${
MINDSPORE_PROTO_DUMP_LIST
}
)
endif
()
list
(
APPEND MINDSPORE_PROTO_LIST
${
MINDSPORE_PROTO_PREDICT_LIST
}
)
if
(
MINDSPORE_PROTO_LIST
)
if
(
MINDSPORE_PROTO_LIST
)
add_library
(
proto_input STATIC
${
MINDSPORE_PROTO_LIST
}
)
set_target_properties
(
proto_input PROPERTIES COMPILE_FLAGS
"-Wno-unused-variable"
)
target_link_libraries
(
mindspore proto_input
)
endif
()
if
(
APPLE
)
set_target_properties
(
mindspore_gvar PROPERTIES MACOSX_RPATH ON
)
endif
()
## make sub objects
set
(
SUB_COMP
transform pre_activate parallel pipeline device kernel common debug gvar ir onnx operator optimizer predict
pybind_api pynative session utils vm
)
link_directories
(
${
CMAKE_SOURCE_DIR
}
/build/mindspore/graphengine
)
foreach
(
_comp
${
SUB_COMP
}
)
add_subdirectory
(
${
_comp
}
)
if
(
TARGET _mindspore_
${
_comp
}
_obj
)
list
(
APPEND SUB_OBJECTS_SRC $<TARGET_OBJECTS:_mindspore_
${
_comp
}
_obj>
)
add_dependencies
(
_mindspore_
${
_comp
}
_obj proto_input flat_input
)
endif
()
endforeach
()
add_library
(
mindspore STATIC
${
SUB_OBJECTS_SRC
}
)
target_link_libraries
(
mindspore proto_input
)
target_link_libraries
(
mindspore securec mindspore::flatbuffers
)
if
(
NOT WIN32
)
target_link_libraries
(
mindspore dl
)
endif
()
if
(
ENABLE_GE
)
if
(
ENABLE_TRAIN
)
target_link_libraries
(
mindspore graph ge_client_train
)
else
()
target_link_libraries
(
mindspore graph ge_client
)
endif
()
target_link_libraries
(
mindspore tsdclient
)
elseif
(
ENABLE_D
)
add_compile_definitions
(
NO_GE_CLIENT
)
target_link_libraries
(
mindspore graph
)
else
()
add_compile_definitions
(
NO_GE_CLIENT
)
target_link_libraries
(
mindspore ge_client_train
)
else
()
target_link_libraries
(
mindspore ge_client
)
endif
()
target_link_libraries
(
mindspore graph tsdclient
)
endif
()
if
(
ENABLE_D
)
if
(
ENABLE_D
)
if
(
DEFINED ENV{D_LINK_PATH}
)
if
(
CMAKE_HOST_SYSTEM_PROCESSOR MATCHES
"aarch64"
)
MESSAGE
(
"system processor matches aarch64"
)
...
...
@@ -306,13 +143,13 @@ if(ENABLE_D)
else
()
MESSAGE
(
"system
${
CMAKE_HOST_SYSTEM_PROCESSOR
}
not support"
)
endif
()
else
()
else
()
MESSAGE
(
"use system default lib"
)
if
(
DEFINED ENV{ASCEND_CUSTOM_PATH}
)
if
(
DEFINED ENV{ASCEND_CUSTOM_PATH}
)
set
(
ASCEND_PATH $ENV{ASCEND_CUSTOM_PATH}
)
else
()
else
()
set
(
ASCEND_PATH /usr/local/Ascend
)
endif
()
endif
()
set
(
ASCEND_DRIVER_PATH
${
ASCEND_PATH
}
/driver/lib64/common
)
set
(
ASCEND_DRIVER_BACK_PATH
${
ASCEND_PATH
}
/driver/lib64/driver
)
set
(
ASCEND_RUNTIME_PATH
${
ASCEND_PATH
}
/fwkacllib/lib64
)
...
...
@@ -327,37 +164,14 @@ if(ENABLE_D)
target_link_libraries
(
mindspore ge_runtime
${
CCE_LIB
}
${
RUNTIME_LIB
}
${
TSDCLIENT
}
${
PROFILING
}
${
HCCL
}
${
TSDCLIENT
}
)
endif
()
target_link_libraries
(
mindspore securec
)
if
(
NOT WIN32
)
target_link_libraries
(
mindspore dl
)
endif
()
target_link_libraries
(
mindspore mindspore::flatbuffers
)
# link protobuf
if
(
ENABLE_D
)
target_link_libraries
(
mindspore mindspore::protobuf
)
endif
()
if
(
${
CMAKE_SYSTEM_NAME
}
MATCHES
"Windows"
)
target_link_libraries
(
mindspore
${
PYTHON_LIBRARIES
}
mindspore_gvar
)
endif
()
# set c_expression building
if
(
${
CMAKE_SYSTEM_NAME
}
MATCHES
"Windows"
)
set
(
PYTHON_MODULE_SOURCE
${
MS_GVAR_SRC_LIST
}
pipeline/init.cc
kernel/oplib/oplib.cc
${
MINDSPORE_SRC_LIST
}
${
MS_STEPS_SRC_LIST
}
${
MS_CCE_SRC_LIST
}
${
MS_AICPU_SRC_LIST
}
${
MS_TASKINFO_LIST
}
${
MS_RT_SRC_LIST
}
${
GPU_NCCL_LIST
}
${
MS_HCCL_SRC_LIST
}
${
MS_PREDICT_SRC_LIST
}
${
CPU_SRC_LIST
}
${
MEM_REUSE_SRC_LIST
}
${
GPU_KERNEL_SRC_LIST
}
)
else
()
set
(
PYTHON_MODULE_SOURCE
pipeline/init.cc
kernel/oplib/oplib.cc
${
MS_STEPS_SRC_LIST
}
${
MS_CCE_SRC_LIST
}
${
MS_AICPU_SRC_LIST
}
${
MS_TASKINFO_LIST
}
${
MS_RT_SRC_LIST
}
${
GPU_NCCL_LIST
}
${
MS_HCCL_SRC_LIST
}
${
MS_PREDICT_SRC_LIST
}
${
CPU_SRC_LIST
}
${
MEM_REUSE_SRC_LIST
}
${
GPU_KERNEL_SRC_LIST
}
)
endif
()
set
(
CMAKE_BUILD_WITH_INSTALL_RPATH TRUE
)
pybind11_add_module
(
_c_expression
${
PYTHON_MODULE_SOURCE
}
)
pybind11_add_module
(
_c_expression
"pipeline/init.cc"
)
MESSAGE
(
STATUS
"operation system is
${
CMAKE_SYSTEM
}
"
)
if
(
CMAKE_SYSTEM_NAME MATCHES
"Linux"
)
...
...
@@ -372,55 +186,41 @@ else ()
MESSAGE
(
FATAL_ERROR
"other platform:
${
CMAKE_SYSTEM_NAME
}
"
)
endif
()
set
(
ORIGIN_PATH
${
ORIGIN_PATH
}
/lib
)
set_target_properties
(
_c_expression PROPERTIES INSTALL_RPATH
${
ORIGIN_PATH
}
)
if
(
WIN32
)
target_link_libraries
(
_c_expression PRIVATE
mindspore::pybind11_module
securec
proto_input
mindspore::flatbuffers
)
else
()
target_link_libraries
(
_c_expression PRIVATE
mindspore::pybind11_module
mindspore
mindspore_gvar
)
endif
()
if
(
USE_GLOG
)
if
(
CMAKE_SYSTEM_NAME MATCHES
"Windows"
)
target_link_libraries
(
mindspore mindspore::pybind11_module
)
target_link_libraries
(
mindspore mindspore_gvar
)
else
()
target_link_libraries
(
_c_expression PRIVATE mindspore::pybind11_module
)
target_link_libraries
(
_c_expression PRIVATE mindspore_gvar
)
endif
()
target_link_libraries
(
_c_expression PRIVATE -Wl,--whole-archive mindspore -Wl,--no-whole-archive
)
if
(
USE_GLOG
)
target_link_libraries
(
_c_expression PRIVATE mindspore::glog
)
endif
()
endif
()
if
(
ENABLE_DUMP_PROTO
)
if
(
ENABLE_DUMP_PROTO
)
target_link_libraries
(
_c_expression PRIVATE mindspore::protobuf
)
endif
()
endif
()
if
(
ENABLE_GPU
)
if
(
ENABLE_GPU
)
message
(
"add gpu lib to c_expression"
)
target_link_libraries
(
_c_expression PRIVATE
gpu_cuda_lib
gpu_queue
cublas
target_link_libraries
(
_c_expression PRIVATE gpu_cuda_lib gpu_queue cublas
${
CUDA_PATH
}
/lib64/libcurand.so
${
CUDNN_PATH
}
/lib64/libcudnn.so
${
CUDA_PATH
}
/lib64/libcudart.so
${
CUDA_PATH
}
/lib64/stubs/libcuda.so
)
if
(
ENABLE_MPI
)
pybind11_add_module
(
_ms_mpi
${
GPU_MPI_PYTHON_LIST
}
)
target_link_libraries
(
_ms_mpi PRIVATE mindspore::pybind11_module mindspore::ompi
)
target_link_libraries
(
gpu_collective PRIVATE mindspore::ompi mindspore::nccl
)
endif
()
endif
()
endif
()
if
(
ENABLE_CPU
)
if
(
ENABLE_CPU
)
target_link_libraries
(
_c_expression PRIVATE mindspore::dnnl mindspore::mkldnn
)
endif
()
endif
()
if
(
ENABLE_MINDDATA
)
if
(
ENABLE_MINDDATA
)
add_subdirectory
(
mindrecord
)
add_subdirectory
(
dataset
)
endif
()
endif
()
mindspore/ccsrc/common/CMakeLists.txt
浏览文件 @
63712848
add_library
(
_mindspore_common_obj OBJECT
${
CMAKE_CURRENT_SOURCE_DIR
}
/*.cc
)
\ No newline at end of file
file
(
GLOB_RECURSE _COMMON_ALL_SRC_FILES RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"*.cc"
)
add_library
(
_mindspore_common_obj OBJECT
${
_COMMON_ALL_SRC_FILES
}
)
mindspore/ccsrc/dataset/engine/datasetops/source/tf_buffer.h
浏览文件 @
63712848
...
...
@@ -21,7 +21,7 @@
#include <string>
#include <vector>
#include "dataset/engine/data_buffer.h"
#include "
.
/example.pb.h"
#include "
proto
/example.pb.h"
#include "dataset/engine/datasetops/source/tf_client.h"
namespace
mindspore
{
...
...
mindspore/ccsrc/dataset/engine/datasetops/source/tf_client.cc
浏览文件 @
63712848
...
...
@@ -24,7 +24,7 @@
#include <algorithm>
#include "common/utils.h"
#include "
.
/example.pb.h"
#include "
proto
/example.pb.h"
#include "dataset/engine/datasetops/source/storage_client.h"
#include "dataset/util/path.h"
#include "dataset/util/status.h"
...
...
mindspore/ccsrc/dataset/engine/datasetops/source/tf_client.h
浏览文件 @
63712848
...
...
@@ -25,7 +25,7 @@
#include <utility>
#include <vector>
#include <map>
#include "
.
/example.pb.h"
#include "
proto
/example.pb.h"
#include "dataset/engine/datasetops/source/storage_client.h"
#include "dataset/util/status.h"
...
...
mindspore/ccsrc/dataset/engine/datasetops/source/tf_reader_op.cc
浏览文件 @
63712848
...
...
@@ -23,7 +23,7 @@
#include <utility>
#include <unordered_map>
#include "
.
/example.pb.h"
#include "
proto
/example.pb.h"
#include "./securec.h"
#include "common/utils.h"
#include "dataset/core/config_manager.h"
...
...
mindspore/ccsrc/debug/CMakeLists.txt
浏览文件 @
63712848
set
(
_DEBUG_SRC_LIST
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/anf_ir_dump.cc"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/anf_ir_utils.cc"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/draw.cc"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/dump_proto.cc"
)
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/anf_ir_dump.cc"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/anf_ir_utils.cc"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/draw.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"
)
endif
(
ENABLE_DUMP_E2E
)
endif
(
ENABLE_DUMP_E2E
)
add_library
(
_mindspore_debug_obj OBJECT
${
_DEBUG_SRC_LIST
}
)
\ No newline at end of file
add_library
(
_mindspore_debug_obj OBJECT
${
_DEBUG_SRC_LIST
}
)
mindspore/ccsrc/debug/dump_proto.cc
浏览文件 @
63712848
...
...
@@ -23,7 +23,7 @@
#include <algorithm>
#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/symbolic.h"
...
...
mindspore/ccsrc/device/CMakeLists.txt
浏览文件 @
63712848
file
(
GLOB_RECURSE _DEVICE_ALL_SRC_FILES *.cc
)
add_library
(
_mindspore_device_obj OBJECT
${
_DEVICE_ALL_SRC_FILES
}
)
if
(
ENABLE_CPU
)
target_compile_definitions
(
_mindspore_device_obj PRIVATE CPUSESSION
)
file
(
GLOB_RECURSE _CPU_SRC_LIST cpu/*.cc
)
add_library
(
_c_expression_cpu_device_obj OBJECT
${
_CPU_SRC_LIST
}
)
endif
()
if
(
ENABLE_GPU
)
file
(
GLOB_RECURSE _GPU_SRC_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"gpu/*.cc"
"gpu/*.cu"
)
list
(
REMOVE_ITEM _GPU_SRC_LIST
"gpu/blocking_queue.cc"
"gpu/gpu_buffer_mgr.cc"
"gpu/mpi/mpi_initializer.cc"
file
(
GLOB_RECURSE DEVICE_SRC_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"common/*.cc"
"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
)
file
(
GLOB_RECURSE CPU_SRC_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"cpu/*.cc"
)
endif
()
# gpu
if
(
ENABLE_GPU
)
file
(
GLOB_RECURSE CUDA_SRC_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"gpu/*.cc"
"gpu/*.cu"
)
# gpu_queue
list
(
REMOVE_ITEM CUDA_SRC_LIST
"gpu/blocking_queue.cc"
"gpu/gpu_buffer_mgr.cc"
)
add_library
(
gpu_queue SHARED
"gpu/blocking_queue.cc"
"gpu/gpu_buffer_mgr.cc"
)
target_link_libraries
(
gpu_queue
${
CMAKE_THREAD_LIBS_INIT
}
${
CUDA_PATH
}
/lib64/libcudart.so
)
list
(
REMOVE_ITEM CUDA_SRC_LIST
"gpu/mpi/mpi_initializer.cc"
"gpu/distribution/collective_wrapper.cc"
"gpu/distribution/mpi_wrapper.cc"
"gpu/distribution/nccl_wrapper.cc"
)
add_library
(
_cuda_gpu_device_obj OBJECT
${
_GPU_SRC_LIST
}
)
endif
()
if
(
ENABLE_D
)
file
(
GLOB_RECURSE _D_SRC_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"ascend/*.cc"
"ascend/profiling/*.cc"
"ascend/tasksink/*.cc"
"kernel_adjust.cc"
"ascend/tasksink/taskinfo/*.cc"
)
target_sources
(
_mindspore_device_obj PRIVATE
${
_D_SRC_LIST
}
)
endif
()
"gpu/distribution/nccl_wrapper.cc"
)
if
(
ENABLE_MPI
)
include
(
ExternalProject
)
# gpu_collective
add_library
(
gpu_collective SHARED
"gpu/distribution/collective_wrapper.cc"
"gpu/distribution/mpi_wrapper.cc"
"gpu/distribution/nccl_wrapper.cc"
)
# _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
()
add_library
(
_mindspore_device_obj OBJECT
${
DEVICE_SRC_LIST
}
${
D_SRC_LIST
}
${
CPU_SRC_LIST
}
)
mindspore/ccsrc/gvar/CMakeLists.txt
0 → 100644
浏览文件 @
63712848
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
()
mindspore/ccsrc/ir/CMakeLists.txt
浏览文件 @
63712848
file
(
GLOB_RECURSE _IR_ALL_SRC_FILES
./*.cc
dtype/*.cc
)
add_library
(
_mindspore_ir_obj OBJECT
${
_IR_ALL_SRC_FILES
}
)
\ No newline at end of file
file
(
GLOB_RECURSE _IR_SRC_LIST ./*.cc dtype/*.cc
)
add_library
(
_mindspore_ir_obj OBJECT
${
_IR_SRC_LIST
}
)
mindspore/ccsrc/kernel/CMakeLists.txt
浏览文件 @
63712848
file
(
GLOB_RECURSE _SESSION_ALL_SRC_FILES RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"kernel_query.cc"
"kernel_fusion.cc"
"kernel_build_info.cc"
"kash/*.cc"
"common_utils.cc"
"oplib/*.cc"
)
add_library
(
_mindspore_kernel_obj OBJECT
${
_SESSION_ALL_SRC_FILES
}
)
if
(
ENABLE_GPU
)
file
(
GLOB_RECURSE _CUDA_GPU_SRC_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"gpu/*.cu"
"akg/gpu/*.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
}
"gpu/*.cc"
)
list
(
REMOVE_ITEM _C_EXPRESSION_GPU_SRC_LIST
"gpu/nccl/nccl_gpu_kernel.cc"
)
add_library
(
_c_expression_gpu_device_obj OBJECT
${
_C_EXPRESSION_GPU_SRC_LIST
}
)
endif
()
if
(
ENABLE_D
)
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
()
file
(
GLOB_RECURSE KERNEL_SRC_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"kernel_build_info.cc"
"kash/*.cc"
"common_utils.cc"
"oplib/*.cc"
)
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
)
file
(
GLOB_RECURSE CUDA_SRC_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"gpu/*.cu"
"akg/gpu/*.cc"
"akg/akgkernelbuild.cc"
"akg/akg_kernel_attrs_process.cc"
)
file
(
GLOB_RECURSE GPU_SRC_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"gpu/*.cc"
)
list
(
REMOVE_ITEM GPU_SRC_LIST
"gpu/nccl/nccl_gpu_kernel.cc"
)
if
(
ENABLE_MPI
)
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
()
# add_library(_mindspore_kernel_cuda_obj OBJECT ${CUDA_SRC_LIST})
endif
()
add_library
(
_mindspore_kernel_obj OBJECT
${
KERNEL_SRC_LIST
}
${
GPU_SRC_LIST
}
${
D_SRC_LIST
}
)
mindspore/ccsrc/onnx/CMakeLists.txt
浏览文件 @
63712848
file
(
GLOB_RECURSE _ONNX_ALL_SRC_FILES RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"*.cc"
)
add_library
(
_mindspore_onnx_obj OBJECT
${
_ONNX_ALL_SRC_FILES
}
)
file
(
GLOB_RECURSE _ONNX_SRC_FILES RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"*.cc"
)
add_library
(
_mindspore_onnx_obj OBJECT
${
_ONNX_SRC_FILES
}
)
mindspore/ccsrc/onnx/onnx_exporter.cc
浏览文件 @
63712848
...
...
@@ -24,7 +24,7 @@
#include <functional>
#include "debug/anf_ir_utils.h"
#include "
.
/onnx.pb.h"
#include "
proto
/onnx.pb.h"
#include "operator/ops.h"
namespace
mindspore
{
...
...
mindspore/ccsrc/operator/CMakeLists.txt
浏览文件 @
63712848
file
(
GLOB_RECURSE _OPERATOR_ALL_SRC_FILES RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"*.cc"
)
add_library
(
_mindspore_operator_obj OBJECT
${
_OPERATOR_ALL_SRC_FILES
}
)
file
(
GLOB_RECURSE _OPERATOR_SRC_FILES RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"*.cc"
)
add_library
(
_mindspore_operator_obj OBJECT
${
_OPERATOR_SRC_FILES
}
)
mindspore/ccsrc/optimizer/CMakeLists.txt
浏览文件 @
63712848
file
(
GLOB_RECURSE _OPTIMIZER_ALL_SRC_FILES RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"*.cc"
)
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
()
\ No newline at end of file
file
(
GLOB_RECURSE _OPTIMIZER_SRC_FILES RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"*.cc"
)
add_library
(
_mindspore_optimizer_obj OBJECT
${
_OPTIMIZER_SRC_FILES
}
)
mindspore/ccsrc/parallel/CMakeLists.txt
0 → 100644
浏览文件 @
63712848
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
}
)
mindspore/ccsrc/parallel/strategy_checkpoint/parallel_strategy_checkpoint.cc
浏览文件 @
63712848
...
...
@@ -23,7 +23,7 @@
#include "common/utils.h"
#include "utils/convert_utils.h"
#include "utils/log_adapter.h"
#include "
utils
/node_strategy.pb.h"
#include "
proto
/node_strategy.pb.h"
namespace
mindspore
{
namespace
parallel
{
...
...
mindspore/ccsrc/pipeline/CMakeLists.txt
浏览文件 @
63712848
file
(
GLOB_RECURSE _PIPELINE_
ALL_
SRC_FILES RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"pipeline.cc"
"resource.cc"
"pass.cc"
"action.cc"
"validator.cc"
"remove_value_node_dup.cc"
"parse/*.cc"
"static_analysis/*.cc"
)
file
(
GLOB_RECURSE _PIPELINE_SRC_FILES RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"pipeline.cc"
"resource.cc"
"pass.cc"
"action.cc"
"validator.cc"
"remove_value_node_dup.cc"
"parse/*.cc"
"static_analysis/*.cc"
)
add_library
(
_mindspore_pipeline_obj OBJECT
${
_PIPELINE_ALL_SRC_FILES
}
)
\ No newline at end of file
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
}
)
mindspore/ccsrc/pre_activate/CMakeLists.txt
0 → 100644
浏览文件 @
63712848
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
}
)
\ No newline at end of file
mindspore/ccsrc/predict/CMakeLists.txt
浏览文件 @
63712848
file
(
GLOB_RECURSE _PRE_ACTIVE_ALL_SRC_FILES RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"ascend/*.cc"
"common/*.cc"
"pass/*.cc"
"gpu/*.cc"
)
file
(
GLOB_RECURSE _PREDICT_SRC_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"predict.cc"
"generator/utils/ir_model_util.cc"
"converter/*.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
}
)
\ No newline at end of file
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
}
)
\ No newline at end of file
mindspore/ccsrc/predict/generator/ir/ir_task_info.h
浏览文件 @
63712848
...
...
@@ -21,7 +21,7 @@
#include <memory>
#include <string>
#include <vector>
#include "pr
edict/pr
oto/ge_runtime_taskinfo.pb.h"
#include "proto/ge_runtime_taskinfo.pb.h"
namespace
mindspore
{
namespace
generator
{
...
...
mindspore/ccsrc/pybind_api/CMakeLists.txt
浏览文件 @
63712848
file
(
GLOB_RECURSE _PYNATIVE_ALL_SRC_FILES RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"*.cc"
)
add_library
(
_mindspore_pynative_obj OBJECT
${
_PYNATIVE_ALL_SRC_FILES
}
)
\ No newline at end of file
file
(
GLOB_RECURSE _PYBIND_API_SRC_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"*.cc"
)
add_library
(
_mindspore_pybind_api_obj OBJECT
${
_PYBIND_API_SRC_LIST
}
)
\ No newline at end of file
mindspore/ccsrc/pynative/CMakeLists.txt
浏览文件 @
63712848
file
(
GLOB_RECURSE _PYNATIVE_ALL_SRC_FILES RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"*.cc"
)
add_library
(
_mindspore_pynative_obj OBJECT
${
_PYNATIVE_ALL_SRC_FILES
}
)
\ No newline at end of file
file
(
GLOB_RECURSE _PYNATIVE_SRC_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"base.cc"
"pynative_execute.cc"
)
if
(
ENABLE_GE
)
file
(
GLOB_RECURSE _GE_SRC_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"pynative_execute_ge.cc"
)
list
(
APPEND _PYNATIVE_SRC_LIST
${
_GE_SRC_LIST
}
)
endif
()
add_library
(
_mindspore_pynative_obj OBJECT
${
_PYNATIVE_SRC_LIST
}
)
mindspore/ccsrc/session/CMakeLists.txt
浏览文件 @
63712848
file
(
GLOB_RECURSE _SESSION_ALL_SRC_FILES RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"kernel_graph.cc"
"session_basic.cc"
"session_factory.cc"
"anf_runtime_algorithm.cc"
file
(
GLOB_RECURSE _SESSION_SRC_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"kernel_graph.cc"
"session_basic.cc"
"session_factory.cc"
"anf_runtime_algorithm.cc"
)
if
(
ENABLE_GPU
)
file
(
GLOB_RECURSE _GPU_SRC_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"gpu_session.cc"
)
#TODO : Not include session_context.cc
add_library
(
_mindspore_session_obj OBJECT
${
_SESSION_ALL_SRC_FILES
}
)
list
(
APPEND _SESSION_SRC_LIST
${
_GPU_SRC_LIST
}
)
endif
(
)
if
(
ENABLE_D
)
file
(
GLOB_RECURSE _D_SRC_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"ascend_session.cc"
)
add_library
(
_mindspore_session_obj OBJEC
T
${
_D_SRC_LIST
}
)
endif
()
if
(
ENABLE_D
)
file
(
GLOB_RECURSE _D_SRC_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"ascend_session.cc"
)
list
(
APPEND _SESSION_SRC_LIS
T
${
_D_SRC_LIST
}
)
endif
()
if
(
ENABLE_GPU
)
file
(
GLOB_RECURSE _C_EXPRESSION_GPU_SRC_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"gpu_session.cc"
)
add_library
(
_c_expression_gpu_session_obj OBJECT
${
_C_EXPRESSION_GPU_SRC_LIST
}
)
endif
()
\ No newline at end of file
add_library
(
_mindspore_session_obj OBJECT
${
_SESSION_SRC_LIST
}
)
\ No newline at end of file
mindspore/ccsrc/transform/CMakeLists.txt
浏览文件 @
63712848
file
(
GLOB_RECURSE _TRANSFORM_ALL_SRC_FILES RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"*.cc"
)
if
(
ENABLE_GE OR ENABLE_D
)
file
(
GLOB_RECURSE _TRANSFORM_SRC_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"*.cc"
)
add_library
(
_mindspore_transform_obj OBJECT
${
_TRANSFORM_SRC_LIST
}
)
add_library
(
_mindspore_transform_obj OBJECT
${
_TRANSFORM_ALL_SRC_FILES
}
)
if
(
NOT ENABLE_GE
)
target_compile_definitions
(
_mindspore_transform_obj PRIVATE NO_GE_CLIENT
)
endif
()
endif
()
mindspore/ccsrc/transform/convert.cc
浏览文件 @
63712848
...
...
@@ -125,6 +125,7 @@ const char kNameSplitD[] = "Split";
const
char
kNameBatchToSpaceNd
[]
=
"BatchToSpaceNd"
;
const
char
kNameFloor
[]
=
"Floor"
;
const
char
kNameNPUGetFloatStatus
[]
=
"NPUGetFloatStatus"
;
const
char
kNameAssign
[]
=
"Assign"
;
const
char
kNameAssignAdd
[]
=
"AssignAdd"
;
const
char
kNameAssignSub
[]
=
"AssignSub"
;
const
char
kNameNPUAllocFloatStatus
[]
=
"NPUAllocFloatStatus"
;
...
...
@@ -1155,8 +1156,7 @@ void DfGraphConvertor::SetOpControlInput(const AnfNodePtr node) {
}
}
const
std
::
vector
<
std
::
string
>
trans_var_list
=
{
prim
::
kPrimAssign
->
name
(),
string
(
kNameAssignAdd
),
string
(
kNameAssignSub
)};
const
std
::
vector
<
std
::
string
>
trans_var_list
=
{
string
(
kNameAssign
),
string
(
kNameAssignAdd
),
string
(
kNameAssignSub
)};
void
DfGraphConvertor
::
SetOpInput
(
const
OpAdapterPtr
&
adpt
,
const
CNodePtr
&
node
)
{
OperatorPtr
src
=
Convert
(
node
);
...
...
mindspore/ccsrc/utils/CMakeLists.txt
浏览文件 @
63712848
file
(
GLOB_RECURSE _UTILS_ALL_SRC_FILES *.cc
)
#TODO : "utils/node_utils.cc"
add_library
(
_mindspore_utils_obj OBJECT
${
_UTILS_ALL_SRC_FILES
}
)
file
(
GLOB_RECURSE _UTILS_SRC_LIST ./*.cc
)
if
(
NOT ENABLE_GE
)
file
(
GLOB_RECURSE _UTILS_GE_SRC_FILES ./callbacks_ge.cc
)
list
(
REMOVE_ITEM _UTILS_SRC_LIST
${
_UTILS_GE_SRC_FILES
}
)
endif
()
add_library
(
_mindspore_utils_obj OBJECT
${
_UTILS_SRC_LIST
}
)
mindspore/ccsrc/vm/CMakeLists.txt
浏览文件 @
63712848
file
(
GLOB_RECURSE _VM_ALL_SRC_FILES RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"*.cc"
)
add_library
(
_mindspore_vm_obj OBJECT
${
_VM_ALL_SRC_FILES
}
)
\ No newline at end of file
file
(
GLOB_RECURSE _VM_SRC_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"*.cc"
)
add_library
(
_mindspore_vm_obj OBJECT
${
_VM_SRC_LIST
}
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录