提交 f91881ff 编写于 作者: M Megvii Engine Team

MegEngine: Initial commit of MegEngine.

GitOrigin-RevId: f0c8338beb9cac953bd2d8b76710790940dc9300
上级

要显示的变更太多。

To preserve performance only 1000 of 1000+ files are displayed.
# Mark generated files as binary, ignore them in git diff.
# dnn
dnn/src/cuda/conv_bias/int8/kimpl/* binary
dnn/src/cuda/conv_bias/int8_imma/kimpl/* binary
dnn/src/cuda/batch_conv_bias/int8/kimpl/* binary
---
name: Bug Issue
about: 请使用此模板提出您遇到的问题
title: BUG Issue
labels: ''
assignees: ''
---
<!-- 请您简介清晰的描述您遇到的问题 -->
## 环境
1.系统环境:
2.MegEngine版本:
3.python版本:
## 复现步骤
1.
2.
3.
## 请提供关键的代码片段便于追查问题
## 请提供完整的日志及报错信息
---
name: Documentation Issue
about: 请使用此模板提出在文档中遇到的问题
title: ''
labels: ''
assignees: ''
---
## 文档链接
<!-- 请您贴出有问题的文档链接 -->
## 问题描述
<!-- 请您简要清晰的描述您的问题 -->
---
name: Feature Request
about: 请使用此模板提出您的建议
title: Feature Request
labels: ''
assignees: ''
---
<!-- 请简介清晰的描述您的需求 -->
## 背景
<!-- 请简单描述您将在什么场景下需要这个功能 -->
## 需求描述
<!-- 请详细描述您的需求并给出验收目标 -->
---
name: Others Issue
about: 如上述分类不符合,请使用此模板提出您的问题
title: ''
labels: ''
assignees: ''
---
## 请简要描述您的需求
/build/
__pycache__/
[submodule "third_party/Halide"]
path = third_party/Halide
url = https://github.com/halide/Halide.git
[submodule "third_party/OpenBLAS"]
path = third_party/OpenBLAS
url = https://github.com/xianyi/OpenBLAS.git
[submodule "third_party/cppzmq"]
path = third_party/cppzmq
url = https://github.com/zeromq/cppzmq.git
[submodule "third_party/gtest"]
path = third_party/gtest
url = https://github.com/google/googletest.git
[submodule "third_party/mkl-dnn"]
path = third_party/intel-mkl-dnn
url = https://github.com/intel/mkl-dnn.git
[submodule "third_party/libzmq"]
path = third_party/libzmq
url = https://github.com/zeromq/libzmq.git
[submodule "third_party/protobuf"]
path = third_party/protobuf
url = https://github.com/protocolbuffers/protobuf
[submodule "third_party/MegRay"]
path = third_party/MegRay
url = https://github.com/MegEngine/MegRay.git
[submodule "third_party/flatbuffers"]
path = third_party/flatbuffers
url = https://github.com/google/flatbuffers.git
因为 它太大了无法显示 source diff 。你可以改为 查看blob
cmake_minimum_required(VERSION 3.9.0)
project(MegEngine)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules)
if(NOT MSVC)
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> Dqc <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> Dq <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> -D <TARGET>")
endif()
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG(-Wclass-memaccess CXX_SUPPORT_WCLASS_MEMACCESS)
set(MGE_ARCH AUTO CACHE STRING "Architecture on which MegEngine to be built.")
set_property(CACHE MGE_ARCH PROPERTY STRINGS AUTO
x86_64 i386
naive fallback
)
if(${MGE_ARCH} STREQUAL "AUTO")
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
set(MGE_ARCH "x86_64")
elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i386" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i686")
set(MGE_ARCH "i386")
else()
message(FATAL "Unknown machine architecture for MegEngine.")
endif()
endif()
CHECK_CXX_COMPILER_FLAG(-fuse-ld=gold CXX_SUPPORT_GOLD)
if(CXX_SUPPORT_GOLD)
message("-- Using GNU gold linker.")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fuse-ld=gold")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=gold")
endif()
option(MGE_WITH_JIT "Build MegEngine with JIT." ON)
option(MGE_WITH_HALIDE "Build MegEngine with Halide JIT" ON)
option(MGE_DISABLE_FLOAT16 "Disable MegEngine float16 support." OFF)
option(MGE_WITH_CUDA "Enable MegEngine CUDA support." ON)
option(MGE_CUDA_USE_STATIC "Enable MegEngine CUDA static linking." ON)
option(MGE_WITH_TRT "Build MegEngine with TensorRT." ON)
option(MGE_USE_SYSTEM_LIB "Build MegEngine with system libraries." OFF)
option(MGB_WITH_FLATBUFFERS "Build MegBrain with FlatBuffers serialization support." ON)
if(MGE_WITH_CUDA)
include(CheckLanguage)
check_language(CUDA)
if(NOT CMAKE_CUDA_COMPILER)
message(FATAL_ERROR "CUDA compiler not found in PATH")
endif()
enable_language(CUDA)
set(CMAKE_CUDA_STANDARD 14)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
endif()
if(NOT MGE_WITH_CUDA)
message("-- Disable JIT support, as CUDA is not enabled.")
set(MGE_WITH_JIT OFF)
set(MGE_WITH_HALIDE OFF)
message("-- Disable TensorRT support, as CUDA is not enabled.")
set(MGE_WITH_TRT OFF)
endif()