Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MegEngine 天元
MegEngine
提交
7fa5f6f4
MegEngine
项目概览
MegEngine 天元
/
MegEngine
1 年多 前同步成功
通知
410
Star
4707
Fork
583
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
MegEngine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
7fa5f6f4
编写于
10月 29, 2021
作者:
M
Megvii Engine Team
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(mgb): correct version of fbs serialization
GitOrigin-RevId: 2a71d9afc29befae4619edbc146f1bad038d89c2
上级
a404c508
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
38 addition
and
22 deletion
+38
-22
CMakeLists.txt
CMakeLists.txt
+1
-1
cmake/FetchMegBrainVersion.cmake
cmake/FetchMegBrainVersion.cmake
+15
-2
imperative/CMakeLists.txt
imperative/CMakeLists.txt
+7
-1
imperative/python/gen_version.py
imperative/python/gen_version.py
+6
-5
imperative/python/version_template.py
imperative/python/version_template.py
+0
-9
src/core/impl/version.cpp
src/core/impl/version.cpp
+4
-0
src/core/include/megbrain/version.h
src/core/include/megbrain/version.h
+4
-3
src/serialization/impl/serializer_oss.cpp
src/serialization/impl/serializer_oss.cpp
+1
-1
未找到文件。
CMakeLists.txt
浏览文件 @
7fa5f6f4
...
...
@@ -1199,7 +1199,7 @@ if (NOT MGE_WITH_DISTRIBUTED)
)
write_basic_package_version_file
(
${
CMAKE_CURRENT_BINARY_DIR
}
/MegEngineConfigVersion.cmake
VERSION
${
MGB_VER_
MAJOR
}
.
${
MGB_VER_MINOR
}
.
${
MGB_VER_PATCH
}
VERSION
${
MGB_VER_
STRING
}
COMPATIBILITY SameMajorVersion
)
install
(
EXPORT
${
MGE_EXPORT_TARGETS
}
DESTINATION
${
MGE_INSTALL_CMAKEDIR
}
)
...
...
cmake/FetchMegBrainVersion.cmake
浏览文件 @
7fa5f6f4
...
...
@@ -18,6 +18,15 @@ set (MGB_VER_MINOR ${CMAKE_MATCH_1})
string
(
REGEX MATCH
"MGB_PATCH *([0-9]+)"
_
${
content
}
)
set
(
MGB_VER_PATCH
${
CMAKE_MATCH_1
}
)
string
(
REGEX MATCH
"MGE_MAJOR +([0-9]+)"
_
${
content
}
)
set
(
MGE_VER_MAJOR
${
CMAKE_MATCH_1
}
)
string
(
REGEX MATCH
"MGE_MINOR +([0-9]+)"
_
${
content
}
)
set
(
MGE_VER_MINOR
${
CMAKE_MATCH_1
}
)
string
(
REGEX MATCH
"MGE_PATCH *([0-9]+)"
_
${
content
}
)
set
(
MGE_VER_PATCH
${
CMAKE_MATCH_1
}
)
if
(
MGB_FORCE_DEV_VERSION
)
set
(
MGB_IS_DEV 1
)
else
()
...
...
@@ -25,8 +34,12 @@ else()
set
(
MGB_IS_DEV
${
CMAKE_MATCH_1
}
)
endif
()
set
(
MGB_VER_STRING
"
${
MGB_VER_MAJOR
}
.
${
MGB_VER_MINOR
}
.
${
MGB_VER_PATCH
}
"
)
if
(
MGB_IS_DEV
)
if
(
DEFINED MGB_VER_MAJOR
)
set
(
MGB_VER_STRING
"
${
MGB_VER_MAJOR
}
.
${
MGB_VER_MINOR
}
.
${
MGB_VER_PATCH
}
"
)
else
()
set
(
MGB_VER_STRING
"
${
MGE_VER_MAJOR
}
.
${
MGE_VER_MINOR
}
.
${
MGE_VER_PATCH
}
"
)
endif
(
DEFINED MGB_VER_MAJOR
)
if
(
MGB_IS_DEV
)
set
(
MGB_VER_STRING
"
${
MGB_VER_STRING
}
-dev"
)
endif
()
...
...
imperative/CMakeLists.txt
浏览文件 @
7fa5f6f4
...
...
@@ -75,7 +75,13 @@ add_custom_command(
COMMAND
${
CMAKE_COMMAND
}
-E copy
${
CMAKE_CURRENT_SOURCE_DIR
}
/python/requires-test.txt
${
CMAKE_CURRENT_BINARY_DIR
}
/python/requires-test.txt
)
if
(
DEFINED MGB_VER_MAJOR
)
set
(
IS_INTERNAL
"--internal"
)
else
()
set
(
IS_INTERNAL
""
)
endif
()
add_custom_command
(
TARGET
${
MODULE_NAME
}
POST_BUILD
COMMAND
"
${
PYTHON_EXECUTABLE
}
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/python/gen_version.py --output
${
CMAKE_CURRENT_BINARY_DIR
}
/python/megengine/version.py
COMMAND
"
${
PYTHON_EXECUTABLE
}
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/python/gen_version.py --output
${
CMAKE_CURRENT_BINARY_DIR
}
/python/megengine/version.py
--major
${
MGE_VER_MAJOR
}
--minor
${
MGE_VER_MINOR
}
--patch
${
MGE_VER_PATCH
}
${
IS_INTERNAL
}
)
imperative/python/gen_version.py
浏览文件 @
7fa5f6f4
...
...
@@ -17,15 +17,16 @@ def get_mge_version(version_txt_path):
if
__name__
==
"__main__"
:
parser
=
argparse
.
ArgumentParser
(
description
=
"generate version.py to build path"
)
parser
.
add_argument
(
"--output"
,
type
=
str
,
required
=
True
)
parser
.
add_argument
(
"--major"
,
type
=
int
,
required
=
True
)
parser
.
add_argument
(
"--minor"
,
type
=
int
,
required
=
True
)
parser
.
add_argument
(
"--patch"
,
type
=
int
,
required
=
True
)
parser
.
add_argument
(
"--internal"
,
action
=
'store_true'
)
args
=
parser
.
parse_args
()
python_dir
=
os
.
path
.
dirname
(
__file__
)
version_txt_path
=
os
.
path
.
join
(
python_dir
,
'version_template.py'
)
commit_id
=
get_git_commit
(
python_dir
)
mge_ver_map
=
get_mge_version
(
version_txt_path
)
mge_ver
=
mge_ver_map
[
'__version__'
]
if
'__version__'
in
mge_ver_map
else
'unknown'
mge_intl
=
mge_ver_map
[
'__internal__'
]
if
'__internal__'
in
mge_ver_map
else
False
mge_ver
=
str
(
args
.
major
)
+
"."
+
str
(
args
.
minor
)
+
"."
+
str
(
args
.
patch
)
with
open
(
args
.
output
,
'w'
)
as
f
:
f
.
write
(
"__version__ = '{}'
\n
"
.
format
(
mge_ver
))
f
.
write
(
"git_version = {}
\n
"
.
format
(
repr
(
commit_id
)))
if
mge_int
l
:
if
args
.
interna
l
:
f
.
write
(
"__internal__ = True
\n
"
)
imperative/python/version_template.py
已删除
100644 → 0
浏览文件 @
a404c508
# -*- coding: utf-8 -*-
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
__version__
=
"1.7.0.dev"
src/core/impl/version.cpp
浏览文件 @
7fa5f6f4
...
...
@@ -14,7 +14,11 @@
using
namespace
mgb
;
Version
mgb
::
get_version
()
{
#ifdef MGB_MAJOR
return
{
MGB_MAJOR
,
MGB_MINOR
,
MGB_PATCH
,
MGB_IS_DEV
};
#else
return
{
MGE_MAJOR
,
MGE_MINOR
,
MGE_PATCH
,
MGB_IS_DEV
};
#endif
}
// vim: syntax=cpp.doxygen foldmethod=marker foldmarker=f{{{,f}}}
src/core/include/megbrain/version.h
浏览文件 @
7fa5f6f4
...
...
@@ -13,9 +13,10 @@
#include "megbrain_build_config.h"
#define MGB_MAJOR 8
#define MGB_MINOR 9999
#define MGB_PATCH 0
#define MGE_MAJOR 1
#define MGE_MINOR 7
#define MGE_PATCH 0
//! whether it is development version
#ifndef MGB_IS_DEV
#define MGB_IS_DEV 0
...
...
src/serialization/impl/serializer_oss.cpp
浏览文件 @
7fa5f6f4
...
...
@@ -45,7 +45,7 @@ using namespace mgb::serialization;
namespace
{
constexpr
uint32_t
MGB_VERSION
=
(
MG
B_MAJOR
*
1000
+
MGB_MINOR
)
*
100
+
MGB
_PATCH
;
constexpr
uint32_t
MGB_VERSION
=
(
MG
E_MAJOR
*
1000
+
MGE_MINOR
)
*
100
+
MGE
_PATCH
;
constexpr
uint32_t
MGB_MAGIC
=
0x5342474D
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录