Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MegEngine 天元
MegEngine
提交
30561d72
MegEngine
项目概览
MegEngine 天元
/
MegEngine
大约 1 年 前同步成功
通知
399
Star
4705
Fork
582
代码
文件
提交
分支
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
30561d72
编写于
4月 01, 2022
作者:
M
Megvii Engine Team
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(windows): fix dll install on windows
GitOrigin-RevId: 49029071c864460d5d5340e2c7689061c2043ad4
上级
d9c4ef59
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
36 addition
and
26 deletion
+36
-26
lite/CMakeLists.txt
lite/CMakeLists.txt
+33
-23
lite/example/cpp_example/main.cpp
lite/example/cpp_example/main.cpp
+1
-1
lite/example/cpp_example/mge/user_allocator.cpp
lite/example/cpp_example/mge/user_allocator.cpp
+2
-2
未找到文件。
lite/CMakeLists.txt
浏览文件 @
30561d72
...
...
@@ -99,26 +99,32 @@ endif()
# MegEngine/megbrain ROOT_DIR/CMakeLists.txt, just depends lite_static or lite_shared
# TODO: need refine lite_static_all_in_one depend objects, but now cmake do not support
# define a add_library which OBJECTS args is a set or list or string
if
(
MGE_ENABLE_CPUINFO AND MGE_WITH_OPENCL
)
add_library
(
lite_static_all_in_one STATIC
$<TARGET_OBJECTS:flatbuffers> $<TARGET_OBJECTS:cpuinfo> $<TARGET_OBJECTS:clog>
$<TARGET_OBJECTS:OpenCL> $<TARGET_OBJECTS:lite_static>
)
elseif
(
MGE_ENABLE_CPUINFO AND NOT MGE_WITH_OPENCL
)
add_library
(
lite_static_all_in_one STATIC
$<TARGET_OBJECTS:flatbuffers> $<TARGET_OBJECTS:cpuinfo> $<TARGET_OBJECTS:clog>
$<TARGET_OBJECTS:lite_static>
)
elseif
(
NOT MGE_ENABLE_CPUINFO AND MGE_WITH_OPENCL
)
add_library
(
lite_static_all_in_one STATIC
$<TARGET_OBJECTS:flatbuffers> $<TARGET_OBJECTS:OpenCL>
$<TARGET_OBJECTS:lite_static>
)
if
(
NOT WIN32
)
if
(
MGE_ENABLE_CPUINFO AND MGE_WITH_OPENCL
)
add_library
(
lite_static_all_in_one STATIC
$<TARGET_OBJECTS:flatbuffers> $<TARGET_OBJECTS:cpuinfo> $<TARGET_OBJECTS:clog>
$<TARGET_OBJECTS:OpenCL> $<TARGET_OBJECTS:lite_static>
)
elseif
(
MGE_ENABLE_CPUINFO AND NOT MGE_WITH_OPENCL
)
add_library
(
lite_static_all_in_one STATIC
$<TARGET_OBJECTS:flatbuffers> $<TARGET_OBJECTS:cpuinfo> $<TARGET_OBJECTS:clog>
$<TARGET_OBJECTS:lite_static>
)
elseif
(
NOT MGE_ENABLE_CPUINFO AND MGE_WITH_OPENCL
)
add_library
(
lite_static_all_in_one STATIC
$<TARGET_OBJECTS:flatbuffers> $<TARGET_OBJECTS:OpenCL>
$<TARGET_OBJECTS:lite_static>
)
else
()
add_library
(
lite_static_all_in_one STATIC $<TARGET_OBJECTS:flatbuffers>
$<TARGET_OBJECTS:lite_static>
)
endif
()
else
()
add_library
(
lite_static_all_in_one STATIC $<TARGET_OBJECTS:flatbuffers>
$<TARGET_OBJECTS:lite_static>
)
message
(
WARNING
"do not support lite_static_all_in_one on Windows, please use lite_shared"
)
endif
()
if
(
LITE_BUILD_WITH_MGE
)
if
(
LITE_BUILD_WITH_MGE AND NOT WIN32
)
target_link_libraries
(
lite_static_all_in_one PRIVATE megbrain megdnn
${
MGE_CUDA_LIBS
}
)
endif
()
...
...
@@ -157,15 +163,19 @@ install(
install
(
TARGETS lite_shared
RUNTIME DESTINATION lite/lib/
${
MGE_ARCH
}
LIBRARY DESTINATION lite/lib/
${
MGE_ARCH
}
FRAMEWORK DESTINATION lite/lib/
${
MGE_ARCH
}
ARCHIVE DESTINATION lite/lib/
${
MGE_ARCH
}
)
install
(
TARGETS lite_static_all_in_one
LIBRARY DESTINATION lite/lib/
${
MGE_ARCH
}
FRAMEWORK DESTINATION lite/lib/
${
MGE_ARCH
}
ARCHIVE DESTINATION lite/lib/
${
MGE_ARCH
}
)
if
(
NOT WIN32
)
install
(
TARGETS lite_static_all_in_one
LIBRARY DESTINATION lite/lib/
${
MGE_ARCH
}
FRAMEWORK DESTINATION lite/lib/
${
MGE_ARCH
}
ARCHIVE DESTINATION lite/lib/
${
MGE_ARCH
}
)
endif
()
install
(
FILES
${
PROJECT_SOURCE_DIR
}
/lite/include/lite/common_enum_c.h
DESTINATION
${
CMAKE_INSTALL_PREFIX
}
/lite/include/lite-c
)
...
...
lite/example/cpp_example/main.cpp
浏览文件 @
30561d72
...
...
@@ -109,7 +109,7 @@ std::shared_ptr<Tensor> lite::example::parse_npy(
}
void
lite
::
example
::
set_cpu_affinity
(
const
std
::
vector
<
int
>&
cpuset
)
{
#if defined(__APPLE__) || defined(WIN32)
#if defined(__APPLE__) || defined(WIN32)
|| defined(_WIN32)
#pragma message("set_cpu_affinity not enabled on apple and windows platform")
#else
cpu_set_t
mask
;
...
...
lite/example/cpp_example/mge/user_allocator.cpp
浏览文件 @
30561d72
...
...
@@ -19,7 +19,7 @@ class CheckAllocator : public lite::Allocator {
public:
//! allocate memory of size in the given device with the given align
void
*
allocate
(
LiteDeviceType
,
int
,
size_t
size
,
size_t
align
)
override
{
#if
def WIN32
#if
defined(WIN32) || defined(_WIN32)
return
_aligned_malloc
(
size
,
align
);
#elif defined(__ANDROID__) || defined(ANDROID)
return
memalign
(
align
,
size
);
...
...
@@ -35,7 +35,7 @@ public:
//! free the memory pointed by ptr in the given device
void
free
(
LiteDeviceType
,
int
,
void
*
ptr
)
override
{
#if
def WIN32
#if
defined(WIN32) || defined(_WIN32)
_aligned_free
(
ptr
);
#else
::
free
(
ptr
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录