Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
860a01a7
P
Paddle-Lite
项目概览
PaddlePaddle
/
Paddle-Lite
通知
331
Star
4
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
271
列表
看板
标记
里程碑
合并请求
78
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle-Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
271
Issue
271
列表
看板
标记
里程碑
合并请求
78
合并请求
78
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
860a01a7
编写于
6月 07, 2018
作者:
L
liuruilong
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'upstream/develop' into develop
上级
984ff95d
d9a4c8c4
变更
10
显示空白变更内容
内联
并排
Showing
10 changed file
with
58 addition
and
38 deletion
+58
-38
CMakeLists.txt
CMakeLists.txt
+33
-6
src/common/macros.h
src/common/macros.h
+17
-0
src/framework/data_layout.h
src/framework/data_layout.h
+1
-1
src/framework/ddim.cpp
src/framework/ddim.cpp
+1
-22
src/framework/ddim.h
src/framework/ddim.h
+4
-0
src/framework/scope.cpp
src/framework/scope.cpp
+0
-2
src/framework/scope.h
src/framework/scope.h
+0
-3
src/framework/tensor.h
src/framework/tensor.h
+1
-1
src/operators/op_param.h
src/operators/op_param.h
+0
-2
tools/build.sh
tools/build.sh
+1
-1
未找到文件。
CMakeLists.txt
浏览文件 @
860a01a7
cmake_minimum_required
(
VERSION 3.0
)
project
(
paddle-mobile
)
#add_definitions(-DPADDLE_MOBILE_DEBUG)
#add_definitions(-DENABLE_EXCEPTION)
option
(
DEBUGING
"enable debug mode"
OFF
)
option
(
USE_OPENMP
"openmp support"
OFF
)
option
(
USE_EXCEPTION
"use std exception"
OFF
)
if
(
DEBUGING
)
set
(
CMAKE_BUILD_TYPE Debug
)
else
()
set
(
CMAKE_BUILD_TYPE Release
)
endif
()
if
(
DEBUGING
)
message
(
STATUS
"debuging"
)
add_definitions
(
-DPADDLE_MOBILE_DEBUG
)
else
()
message
(
STATUS
"releasing"
)
add_definitions
(
-fvisibility=hidden -fvisibility-inlines-hidden
)
endif
()
if
(
USE_EXCEPTION
)
add_definitions
(
-DENABLE_EXCEPTION
)
add_definitions
(
-fexceptions
)
else
()
add_definitions
(
-fno-exceptions
)
endif
()
if
(
IS_MAC
)
add_definitions
(
-DX86
)
...
...
@@ -15,9 +40,7 @@ else ()
add_definitions
(
-DX86
)
endif
()
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-std=c++14"
)
set
(
CMAKE_BUILD_TYPE Release
)
set
(
CMAKE_VERBOSE_MAKEFILE ON
)
set
(
CMAKE_EXPORT_COMPILE_COMMANDS ON
)
set
(
CMAKE_ARCHIVE_OUTPUT_DIRECTORY build
)
...
...
@@ -29,7 +52,6 @@ file(GLOB_RECURSE PADDLE_MOBILE_H src/*.h)
include_directories
(
src/
)
option
(
USE_OPENMP
"openmp support"
OFF
)
if
(
USE_OPENMP
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-fopenmp"
)
add_definitions
(
-DPADDLE_MOBILE_USE_OPENMP
)
...
...
@@ -97,6 +119,11 @@ else ()
add_definitions
(
-DTRANSPOSE_OP
)
endif
()
add_library
(
paddle-mobile SHARED
${
PADDLE_MOBILE_CC
}
${
PADDLE_MOBILE_H
}
)
add_subdirectory
(
test
)
if
(
DEBUGING
)
add_subdirectory
(
test
)
endif
()
src/common/macros.h
0 → 100644
浏览文件 @
860a01a7
/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. */
#pragma once
#define EXPORT __attribute__((visibility("default")))
src/framework/data_layout.h
浏览文件 @
860a01a7
...
...
@@ -39,7 +39,7 @@ inline DataLayout StringToDataLayout(const std::string &str) {
}
else
if
(
s
==
"ANYLAYOUT"
)
{
return
DataLayout
::
kAnyLayout
;
}
else
{
PADDLE_MOBILE_THROW_EXCEPTION
(
"Unknown storage order string: %s"
,
s
)
PADDLE_MOBILE_THROW_EXCEPTION
(
"Unknown storage order string: %s"
,
s
.
c_str
()
)
}
}
...
...
src/framework/ddim.cpp
浏览文件 @
860a01a7
...
...
@@ -277,30 +277,9 @@ int arity(const DDim &d) {
ArityVisitor
arityVisitor
=
ArityVisitor
();
return
DDim
::
ApplyVistor
(
arityVisitor
,
d
);
}
/// \cond HIDDEN
/// \endcond
// struct OSVistor : Vistor<std::ostream &> {
// OSVistor(std::ostream &os) : os_(os) {}
//
// template <int D>
// std::ostream &operator()(Dim<D> dim) const {
// return os_ << dim;
// }
//
// private:
// std::ostream &os_;
//};
// std::ostream &operator<<(std::ostream &os, const DDim &ddim) {
// auto vistor = OSVistor(os);
// DDim::ApplyVistor(vistor, ddim);
// return os;
//}
#ifdef PADDLE_MOBILE_DEBUG
inline
Print
&
operator
<<
(
Print
&
printer
,
const
DDim
&
ddim
)
{
Print
&
operator
<<
(
Print
&
printer
,
const
DDim
&
ddim
)
{
for
(
int
j
=
0
;
j
<
ddim
.
size
();
++
j
)
{
printer
<<
ddim
[
j
]
<<
" "
;
}
...
...
src/framework/ddim.h
浏览文件 @
860a01a7
...
...
@@ -147,5 +147,9 @@ DDim flatten_to_1d(const DDim &src);
DDim
stride
(
const
DDim
&
ddim
);
DDim
stride_numel
(
const
DDim
&
ddim
);
#ifdef PADDLE_MOBILE_DEBUG
Print
&
operator
<<
(
Print
&
printer
,
const
DDim
&
ddim
);
#endif
}
// namespace framework
}
// namespace paddle_mobile
src/framework/scope.cpp
浏览文件 @
860a01a7
...
...
@@ -22,7 +22,6 @@ namespace paddle_mobile {
namespace
framework
{
Scope
&
Scope
::
NewScope
()
const
{
std
::
unique_lock
<
std
::
mutex
>
lock
(
mutex_
);
kids_
.
push_back
(
new
Scope
(
this
));
return
*
kids_
.
back
();
}
...
...
@@ -72,7 +71,6 @@ std::vector<std::string> Scope::LocalVarNames() const {
}
void
Scope
::
DeleteScope
(
Scope
*
scope
)
const
{
std
::
unique_lock
<
std
::
mutex
>
lock
(
mutex_
);
auto
it
=
std
::
find
(
kids_
.
begin
(),
kids_
.
end
(),
scope
);
kids_
.
erase
(
it
);
delete
scope
;
...
...
src/framework/scope.h
浏览文件 @
860a01a7
...
...
@@ -15,7 +15,6 @@ limitations under the License. */
#pragma once
#include <list>
#include <mutex>
#include <unordered_map>
#include "variable.h"
...
...
@@ -70,8 +69,6 @@ class Scope {
mutable
std
::
unordered_map
<
std
::
string
,
Variable
*>
vars_
;
mutable
std
::
list
<
Scope
*>
kids_
;
Scope
const
*
parent_
{
nullptr
};
mutable
std
::
mutex
mutex_
;
};
}
// namespace framework
}
// namespace paddle_mobile
src/framework/tensor.h
浏览文件 @
860a01a7
...
...
@@ -14,13 +14,13 @@ limitations under the License. */
#pragma once
#include <common/enforce.h>
#include <cstdint>
#include <cstring>
#include <memory>
#include <type_traits>
#include <typeindex>
#include <vector>
#include "common/enforce.h"
#include "framework/data_layout.h"
#include "framework/ddim.h"
...
...
src/operators/op_param.h
浏览文件 @
860a01a7
...
...
@@ -167,8 +167,6 @@ class OpParam {
const
Scope
&
scope
)
{
auto
var_vec
=
var_map
.
at
(
key
);
if
(
!
var_vec
.
empty
())
{
// std::cout << " get var value -- " << var_vec[0] <<
// std::endl;
auto
var
=
scope
.
FindVar
(
var_vec
[
0
]);
return
var
->
GetMutable
<
T
>
();
}
else
{
...
...
tools/build.sh
浏览文件 @
860a01a7
...
...
@@ -46,7 +46,7 @@ build_for_android() {
if
[
"
${
PLATFORM
}
"
=
"arm-v7a"
]
;
then
ABI
=
"armeabi-v7a with NEON"
ARM_PLATFORM
=
"V7"
CXX_FLAGS
=
"-O3 -std=c++11 -s -march=armv7-a -mfpu=neon -mfloat-abi=softfp -pie -fPIE -w -Wno-error=format-security
-fno-exceptions
"
CXX_FLAGS
=
"-O3 -std=c++11 -s -march=armv7-a -mfpu=neon -mfloat-abi=softfp -pie -fPIE -w -Wno-error=format-security"
elif
[
"
${
PLATFORM
}
"
=
"arm-v8a"
]
;
then
ABI
=
"arm64-v8a"
ARM_PLATFORM
=
"V8"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录