Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
9b791af6
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看板
提交
9b791af6
编写于
6月 12, 2018
作者:
R
Ruilong Liu
提交者:
GitHub
6月 12, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #398 from codeWorm2015/develop
#397
modify ios cmake tool chain, add macro option for multi-platform
上级
eb3c7f79
6cfe0ced
变更
30
展开全部
显示空白变更内容
内联
并排
Showing
30 changed file
with
486 addition
and
453 deletion
+486
-453
CMakeLists.txt
CMakeLists.txt
+21
-4
src/framework/op_registry.h
src/framework/op_registry.h
+65
-15
src/framework/operator.cpp
src/framework/operator.cpp
+5
-0
src/framework/operator.h
src/framework/operator.h
+1
-0
src/operators/batchnorm_op.cpp
src/operators/batchnorm_op.cpp
+8
-2
src/operators/box_coder_op.cpp
src/operators/box_coder_op.cpp
+8
-2
src/operators/concat_op.cpp
src/operators/concat_op.cpp
+8
-2
src/operators/conv_op.cpp
src/operators/conv_op.cpp
+12
-2
src/operators/depthwise_conv_op.cpp
src/operators/depthwise_conv_op.cpp
+8
-2
src/operators/elementwise_add_op.cpp
src/operators/elementwise_add_op.cpp
+8
-2
src/operators/feed_op.h
src/operators/feed_op.h
+8
-2
src/operators/fetch_op.h
src/operators/fetch_op.h
+8
-2
src/operators/fusion_conv_add.cpp
src/operators/fusion_conv_add.cpp
+8
-2
src/operators/fusion_conv_add.h
src/operators/fusion_conv_add.h
+7
-1
src/operators/fusion_conv_add_relu_op.h
src/operators/fusion_conv_add_relu_op.h
+8
-2
src/operators/fusion_fc_op.cpp
src/operators/fusion_fc_op.cpp
+8
-2
src/operators/fusion_fc_op.h
src/operators/fusion_fc_op.h
+8
-3
src/operators/kernel/fpga/conv_kernel.cpp
src/operators/kernel/fpga/conv_kernel.cpp
+7
-6
src/operators/lrn_op.cpp
src/operators/lrn_op.cpp
+8
-2
src/operators/mul_op.cpp
src/operators/mul_op.cpp
+8
-2
src/operators/multiclass_nms_op.cpp
src/operators/multiclass_nms_op.cpp
+8
-2
src/operators/pool_op.cpp
src/operators/pool_op.cpp
+8
-2
src/operators/prior_box_op.cpp
src/operators/prior_box_op.cpp
+8
-2
src/operators/relu_op.cpp
src/operators/relu_op.cpp
+8
-2
src/operators/reshape_op.cpp
src/operators/reshape_op.cpp
+8
-2
src/operators/sigmoid_op.cpp
src/operators/sigmoid_op.cpp
+8
-2
src/operators/softmax_op.cpp
src/operators/softmax_op.cpp
+8
-2
src/operators/transpose_op.cpp
src/operators/transpose_op.cpp
+8
-2
tools/build.sh
tools/build.sh
+1
-1
tools/ios-cmake/ios.toolchain.cmake
tools/ios-cmake/ios.toolchain.cmake
+199
-381
未找到文件。
CMakeLists.txt
浏览文件 @
9b791af6
cmake_minimum_required
(
VERSION 3.0
)
cmake_minimum_required
(
VERSION 3.0
)
project
(
paddle-mobile
)
project
(
paddle-mobile
)
option
(
DEBUGING
"enable debug mode"
O
FF
)
option
(
DEBUGING
"enable debug mode"
O
N
)
option
(
USE_OPENMP
"openmp support"
OFF
)
option
(
USE_OPENMP
"openmp support"
OFF
)
option
(
USE_EXCEPTION
"use std exception"
OFF
)
option
(
USE_EXCEPTION
"use std exception"
ON
)
option
(
CPU
"cpu"
ON
)
option
(
MALI_GPU
"mali gpu"
OFF
)
option
(
FPGA
"fpga"
OFF
)
if
(
CPU
)
add_definitions
(
-DPADDLE_MOBILE_CPU
)
elseif
(
MALI_GPU
)
add_definitions
(
-DPADDLE_MOBILE_MALI_GPU
)
elseif
(
FPGA
)
add_definitions
(
-DPADDLE_MOBILE_FPGA
)
endif
()
if
(
DEBUGING
)
if
(
DEBUGING
)
set
(
CMAKE_BUILD_TYPE Debug
)
set
(
CMAKE_BUILD_TYPE Debug
)
...
@@ -127,8 +139,13 @@ else ()
...
@@ -127,8 +139,13 @@ else ()
add_definitions
(
-DTRANSPOSE_OP
)
add_definitions
(
-DTRANSPOSE_OP
)
endif
()
endif
()
if
(
IS_IOS
)
add_library
(
paddle-mobile SHARED
${
PADDLE_MOBILE_CC
}
${
PADDLE_MOBILE_H
}
)
add_library
(
paddle-mobile STATIC
${
PADDLE_MOBILE_CC
}
${
PADDLE_MOBILE_H
}
)
elseif
(
ANDROID
)
add_library
(
paddle-mobile SHARED
${
PADDLE_MOBILE_CC
}
${
PADDLE_MOBILE_H
}
)
else
()
add_library
(
paddle-mobile SHARED
${
PADDLE_MOBILE_CC
}
${
PADDLE_MOBILE_H
}
)
endif
()
if
(
DEBUGING
)
if
(
DEBUGING
)
add_subdirectory
(
test
)
add_subdirectory
(
test
)
...
...
src/framework/op_registry.h
浏览文件 @
9b791af6
...
@@ -96,24 +96,74 @@ class OpRegistry {
...
@@ -96,24 +96,74 @@ class OpRegistry {
}
}
};
};
#define REGISTER_OPERATOR(op_type, op_class) \
#ifdef PADDLE_MOBILE_CPU
#define REGISTER_OPERATOR_CPU(op_type, op_class) \
template <typename Dtype, typename T> \
class _OpClass_##op_type##_cpu : public op_class<Dtype, T> { \
public: \
DEFINE_OP_CONSTRUCTOR(_OpClass_##op_type##_cpu, op_class); \
}; \
static paddle_mobile::framework::OperatorRegistrar< \
paddle_mobile::CPU, _OpClass_##op_type##_cpu<paddle_mobile::CPU, float>> \
__op_registrar_##op_type##__cpu(#op_type); \
int TouchOpRegistrar_##op_type##_cpu() { \
__op_registrar_##op_type##__cpu.Touch(); \
return 0; \
}
#define USE_OP_CPU(op_type) \
extern int TouchOpRegistrar_##op_type##_cpu(); \
static int use_op_itself_##op_type##_ __attribute__((unused)) = \
TouchOpRegistrar_##op_type##_cpu()
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#define REGISTER_OPERATOR_MALI_GPU(op_type, op_class) \
template <typename Dtype, typename T> \
template <typename Dtype, typename T> \
class _OpClass_##op_type##_
: public op_class<Dtype, T> {
\
class _OpClass_##op_type##_
mali_gpu : public op_class<Dtype, T> {
\
public: \
public: \
DEFINE_OP_CONSTRUCTOR(_OpClass_##op_type##_
, op_class);
\
DEFINE_OP_CONSTRUCTOR(_OpClass_##op_type##_
mali_gpu, op_class);
\
}; \
}; \
static paddle_mobile::framework::OperatorRegistrar< \
static paddle_mobile::framework::OperatorRegistrar< \
paddle_mobile::CPU, _OpClass_##op_type##_<paddle_mobile::CPU, float>> \
paddle_mobile::CPU, \
__op_registrar_##op_type##__(#op_type); \
_OpClass_##op_type##_mali_gpu<paddle_mobile::CPU, float>> \
int TouchOpRegistrar_##op_type() { \
__op_registrar_##op_type##__mali_gpu(#op_type); \
__op_registrar_##op_type##__.Touch(); \
int TouchOpRegistrar_##op_type##_mali_gpu() { \
__op_registrar_##op_type##__mali_gpu.Touch(); \
return 0; \
return 0; \
}
}
#define USE_OP
(op_type)
\
#define USE_OP
_MALI_GPU(op_type)
\
extern int TouchOpRegistrar_##op_type
();
\
extern int TouchOpRegistrar_##op_type
##_mali_gpu();
\
static int use_op_itself_##op_type##_ __attribute__((unused)) = \
static int use_op_itself_##op_type##_ __attribute__((unused)) = \
TouchOpRegistrar_##op_type()
TouchOpRegistrar_##op_type##_mali_gpu()
#endif
#ifdef PADDLE_MOBILE_FPGA
#define REGISTER_OPERATOR_FPGA(op_type, op_class) \
template <typename Dtype, typename T> \
class _OpClass_##op_type##_fpga : public op_class<Dtype, T> { \
public: \
DEFINE_OP_CONSTRUCTOR(_OpClass_##op_type##_fpga, op_class); \
}; \
static paddle_mobile::framework::OperatorRegistrar< \
paddle_mobile::CPU, \
_OpClass_##op_type##_fpga<paddle_mobile::CPU, float>> \
__op_registrar_##op_type##__fpga(#op_type); \
int TouchOpRegistrar_##op_type##_fpga() { \
__op_registrar_##op_type##__fpga.Touch(); \
return 0; \
}
#define USE_OP_FPGA(op_type) \
extern int TouchOpRegistrar_##op_type##_fpga(); \
static int use_op_itself_##op_type##_ __attribute__((unused)) = \
TouchOpRegistrar_##op_type##_fpga()
#endif
}
// namespace framework
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace paddle_mobile
src/framework/operator.cpp
浏览文件 @
9b791af6
...
@@ -58,7 +58,12 @@ void OperatorBase<Dtype>::Run() const {
...
@@ -58,7 +58,12 @@ void OperatorBase<Dtype>::Run() const {
}
}
template
class
OperatorBase
<
CPU
>;
template
class
OperatorBase
<
CPU
>;
template
class
OperatorBase
<
FPGA
>;
template
class
OperatorBase
<
GPU_MALI
>;
template
class
OperatorWithKernel
<
CPU
>;
template
class
OperatorWithKernel
<
CPU
>;
template
class
OperatorWithKernel
<
FPGA
>;
template
class
OperatorWithKernel
<
GPU_MALI
>;
}
// namespace framework
}
// namespace framework
}
// namespace paddle_mobile
}
// namespace paddle_mobile
src/framework/operator.h
浏览文件 @
9b791af6
...
@@ -153,6 +153,7 @@ class FusionOpMatcher {
...
@@ -153,6 +153,7 @@ class FusionOpMatcher {
std
::
string
BeginType
()
{
return
node_
.
Type
();
}
std
::
string
BeginType
()
{
return
node_
.
Type
();
}
// virtual bool Fusion();
protected:
protected:
Node
node_
;
Node
node_
;
std
::
string
type_
;
std
::
string
type_
;
...
...
src/operators/batchnorm_op.cpp
浏览文件 @
9b791af6
...
@@ -31,7 +31,13 @@ template class BatchNormOp<CPU, float>;
...
@@ -31,7 +31,13 @@ template class BatchNormOp<CPU, float>;
}
// namespace paddle_mobile
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
batch_norm
);
#ifdef PADDLE_MOBILE_CPU
REGISTER_OPERATOR
(
batch_norm
,
ops
::
BatchNormOp
);
USE_OP_CPU
(
batch_norm
);
REGISTER_OPERATOR_CPU
(
batch_norm
,
ops
::
BatchNormOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
#endif
#endif
src/operators/box_coder_op.cpp
浏览文件 @
9b791af6
...
@@ -52,7 +52,13 @@ template class BoxCoderOp<CPU, float>;
...
@@ -52,7 +52,13 @@ template class BoxCoderOp<CPU, float>;
}
// namespace paddle_mobile
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
box_coder
);
#ifdef PADDLE_MOBILE_CPU
REGISTER_OPERATOR
(
box_coder
,
ops
::
BoxCoderOp
);
USE_OP_CPU
(
box_coder
);
REGISTER_OPERATOR_CPU
(
box_coder
,
ops
::
BoxCoderOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
#endif
#endif
src/operators/concat_op.cpp
浏览文件 @
9b791af6
...
@@ -62,7 +62,13 @@ template class ConcatOp<CPU, float>;
...
@@ -62,7 +62,13 @@ template class ConcatOp<CPU, float>;
}
// namespace paddle_mobile
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
concat
);
#ifdef PADDLE_MOBILE_CPU
REGISTER_OPERATOR
(
concat
,
ops
::
ConcatOp
);
USE_OP_CPU
(
concat
);
REGISTER_OPERATOR_CPU
(
concat
,
ops
::
ConcatOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
#endif
#endif
src/operators/conv_op.cpp
浏览文件 @
9b791af6
...
@@ -53,7 +53,17 @@ template class ConvOp<CPU, float>;
...
@@ -53,7 +53,17 @@ template class ConvOp<CPU, float>;
}
// namespace paddle_mobile
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
conv2d
);
#ifdef PADDLE_MOBILE_CPU
REGISTER_OPERATOR
(
conv2d
,
ops
::
ConvOp
);
USE_OP_CPU
(
conv2d
);
REGISTER_OPERATOR_CPU
(
conv2d
,
ops
::
ConvOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
USE_OP_MALI_GPU
(
conv2d
);
REGISTER_OPERATOR_MALI_GPU
(
conv2d
,
ops
::
ConvOp
);
#endif
#ifdef PADDLE_MOBILE_FPGA
USE_OP_FPGA
(
conv2d
);
REGISTER_OPERATOR_FPGA
(
conv2d
,
ops
::
ConvOp
);
#endif
#endif
#endif
src/operators/depthwise_conv_op.cpp
浏览文件 @
9b791af6
...
@@ -54,7 +54,13 @@ template class DepthwiseConvOp<CPU, float>;
...
@@ -54,7 +54,13 @@ template class DepthwiseConvOp<CPU, float>;
}
// namespace paddle_mobile
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
depthwise_conv2d
);
#ifdef PADDLE_MOBILE_CPU
REGISTER_OPERATOR
(
depthwise_conv2d
,
ops
::
DepthwiseConvOp
);
USE_OP_CPU
(
depthwise_conv2d
);
REGISTER_OPERATOR_CPU
(
depthwise_conv2d
,
ops
::
DepthwiseConvOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
#endif
#endif
src/operators/elementwise_add_op.cpp
浏览文件 @
9b791af6
...
@@ -29,7 +29,13 @@ template class ElementwiseAddOp<CPU, float>;
...
@@ -29,7 +29,13 @@ template class ElementwiseAddOp<CPU, float>;
}
// namespace paddle_mobile
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
elementwise_add
);
#ifdef PADDLE_MOBILE_CPU
REGISTER_OPERATOR
(
elementwise_add
,
ops
::
ElementwiseAddOp
);
USE_OP_CPU
(
elementwise_add
);
REGISTER_OPERATOR_CPU
(
elementwise_add
,
ops
::
ElementwiseAddOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
#endif
#endif
src/operators/feed_op.h
浏览文件 @
9b791af6
...
@@ -43,8 +43,14 @@ class FeedOp : public framework::OperatorBase<DeviceType> {
...
@@ -43,8 +43,14 @@ class FeedOp : public framework::OperatorBase<DeviceType> {
};
};
namespace
ops
=
paddle_mobile
::
operators
;
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
feed
);
#ifdef PADDLE_MOBILE_CPU
REGISTER_OPERATOR
(
feed
,
ops
::
FeedOp
);
USE_OP_CPU
(
feed
);
REGISTER_OPERATOR_CPU
(
feed
,
ops
::
FeedOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
}
// namespace operators
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace paddle_mobile
src/operators/fetch_op.h
浏览文件 @
9b791af6
...
@@ -43,8 +43,14 @@ class FetchOp : public framework::OperatorBase<DeviceType> {
...
@@ -43,8 +43,14 @@ class FetchOp : public framework::OperatorBase<DeviceType> {
};
};
namespace
ops
=
paddle_mobile
::
operators
;
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
fetch
);
#ifdef PADDLE_MOBILE_CPU
REGISTER_OPERATOR
(
fetch
,
ops
::
FetchOp
);
USE_OP_CPU
(
fetch
);
REGISTER_OPERATOR_CPU
(
fetch
,
ops
::
FetchOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
}
// namespace operators
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace paddle_mobile
src/operators/fusion_conv_add.cpp
浏览文件 @
9b791af6
...
@@ -25,7 +25,13 @@ template class FushionConvAddOp<CPU, float>;
...
@@ -25,7 +25,13 @@ template class FushionConvAddOp<CPU, float>;
}
// namespace paddle_mobile
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
conv_add
);
#ifdef PADDLE_MOBILE_CPU
REGISTER_OPERATOR
(
conv_add
,
ops
::
FushionConvAddOp
);
USE_OP_CPU
(
conv_add
);
REGISTER_OPERATOR_CPU
(
conv_add
,
ops
::
FushionConvAddOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
#endif
#endif
src/operators/fusion_conv_add.h
浏览文件 @
9b791af6
...
@@ -64,7 +64,13 @@ class FushionConvAddOp : public framework::OperatorWithKernel<DeviceType> {
...
@@ -64,7 +64,13 @@ class FushionConvAddOp : public framework::OperatorWithKernel<DeviceType> {
// FushionFcParam param_;
// FushionFcParam param_;
};
};
// static framework::FusionOpRegistrar fc_registrar(new FusionConvAddMatcher());
#ifdef PADDLE_MOBILE_CPU
static
framework
::
FusionOpRegistrar
fc_registrar
(
new
FusionConvAddMatcher
());
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
}
// namespace operators
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace paddle_mobile
...
...
src/operators/fusion_conv_add_relu_op.h
浏览文件 @
9b791af6
...
@@ -46,8 +46,14 @@ class ConvAddReluOp {
...
@@ -46,8 +46,14 @@ class ConvAddReluOp {
private:
private:
};
};
// static framework::FusionOpRegistrar fc_registrar(
#ifdef PADDLE_MOBILE_CPU
// static framework::FusionOpRegistrar fusion_conv_add_relu_registrar(
// new FushionConvAddReluOpMatcher());
// new FushionConvAddReluOpMatcher());
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
}
// namespace operators
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace paddle_mobile
...
...
src/operators/fusion_fc_op.cpp
浏览文件 @
9b791af6
...
@@ -54,7 +54,13 @@ template class FushionFcOp<CPU, float>;
...
@@ -54,7 +54,13 @@ template class FushionFcOp<CPU, float>;
}
// namespace paddle_mobile
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
fc
);
#ifdef PADDLE_MOBILE_CPU
REGISTER_OPERATOR
(
fc
,
ops
::
FushionFcOp
);
USE_OP_CPU
(
fc
);
REGISTER_OPERATOR_CPU
(
fc
,
ops
::
FushionFcOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
#endif
#endif
src/operators/fusion_fc_op.h
浏览文件 @
9b791af6
...
@@ -37,8 +37,6 @@ class FusionFcMatcher : public framework::FusionOpMatcher {
...
@@ -37,8 +37,6 @@ class FusionFcMatcher : public framework::FusionOpMatcher {
void
FolderNodes
(
void
FolderNodes
(
framework
::
Node
*
node
,
framework
::
Node
*
node
,
std
::
vector
<
std
::
shared_ptr
<
framework
::
Node
>>
*
removed_nodes
)
{
std
::
vector
<
std
::
shared_ptr
<
framework
::
Node
>>
*
removed_nodes
)
{
vector
<
std
::
shared_ptr
<
framework
::
OpDesc
>>
origin_descs
=
node
->
OpDescs
(
node_
.
Depth
());
node
->
Folder
(
node_
.
Depth
(),
Type
(),
node
->
Folder
(
node_
.
Depth
(),
Type
(),
{{
G_OP_TYPE_ELEMENTWISE_ADD
,
{
"Y"
,
"Z"
}}},
removed_nodes
);
{{
G_OP_TYPE_ELEMENTWISE_ADD
,
{
"Y"
,
"Z"
}}},
removed_nodes
);
}
}
...
@@ -69,7 +67,14 @@ class FushionFcOp : public framework::OperatorWithKernel<DeviceType> {
...
@@ -69,7 +67,14 @@ class FushionFcOp : public framework::OperatorWithKernel<DeviceType> {
FushionFcParam
param_
;
FushionFcParam
param_
;
};
};
// static framework::FusionOpRegistrar fc_registrar(new FusionFcMatcher());
#ifdef PADDLE_MOBILE_CPU
static
framework
::
FusionOpRegistrar
fc_registrar
(
new
FusionFcMatcher
());
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
static
framework
::
FusionOpRegistrar
fc_registrar
(
new
FusionFcMatcher
());
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
}
// namespace operators
}
// namespace operators
}
// namespace paddle_mobile
}
// namespace paddle_mobile
...
...
src/operators/kernel/fpga/conv_kernel.cpp
浏览文件 @
9b791af6
...
@@ -14,15 +14,16 @@ limitations under the License. */
...
@@ -14,15 +14,16 @@ limitations under the License. */
#ifdef CONV_OP
#ifdef CONV_OP
#include "operators/kernel/conv_kernel.h"
namespace
paddle_mobile
{
namespace
paddle_mobile
{
namespace
operators
{
namespace
operators
{
// template<>
template
<
>
// void ConvKernel<FPGA, float>::Compute(const ConvParam ¶m) const
void
ConvKernel
<
FPGA
,
float
>::
Compute
(
const
ConvParam
&
param
)
const
{}
// {}
template
class
ConvKernel
<
FPGA
,
float
>;
//
// template class ConvKernel<FPGA, float>;
}
// namespace operators
}
}
// namespace paddle_mobile
}
// namespace paddle_mobile
#endif
#endif
src/operators/lrn_op.cpp
浏览文件 @
9b791af6
...
@@ -29,7 +29,13 @@ template class LrnOp<CPU, float>;
...
@@ -29,7 +29,13 @@ template class LrnOp<CPU, float>;
}
// namespace paddle_mobile
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
lrn
);
#ifdef PADDLE_MOBILE_CPU
REGISTER_OPERATOR
(
lrn
,
ops
::
LrnOp
);
USE_OP_CPU
(
lrn
);
REGISTER_OPERATOR_CPU
(
lrn
,
ops
::
LrnOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
#endif
#endif
src/operators/mul_op.cpp
浏览文件 @
9b791af6
...
@@ -55,7 +55,13 @@ template class MulOp<CPU, float>;
...
@@ -55,7 +55,13 @@ template class MulOp<CPU, float>;
}
// namespace paddle_mobile
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
mul
);
#ifdef PADDLE_MOBILE_CPU
REGISTER_OPERATOR
(
mul
,
ops
::
MulOp
);
USE_OP_CPU
(
mul
);
REGISTER_OPERATOR_CPU
(
mul
,
ops
::
MulOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
#endif
#endif
src/operators/multiclass_nms_op.cpp
浏览文件 @
9b791af6
...
@@ -39,7 +39,13 @@ template class MultiClassNMSOp<CPU, float>;
...
@@ -39,7 +39,13 @@ template class MultiClassNMSOp<CPU, float>;
}
// namespace paddle_mobile
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
multiclass_nms
);
#ifdef PADDLE_MOBILE_CPU
REGISTER_OPERATOR
(
multiclass_nms
,
ops
::
MultiClassNMSOp
);
USE_OP_CPU
(
multiclass_nms
);
REGISTER_OPERATOR_CPU
(
multiclass_nms
,
ops
::
MultiClassNMSOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
#endif
#endif
src/operators/pool_op.cpp
浏览文件 @
9b791af6
...
@@ -59,7 +59,13 @@ template class PoolOp<CPU, float>;
...
@@ -59,7 +59,13 @@ template class PoolOp<CPU, float>;
}
// namespace paddle_mobile
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
pool2d
);
#ifdef PADDLE_MOBILE_CPU
REGISTER_OPERATOR
(
pool2d
,
ops
::
PoolOp
);
USE_OP_CPU
(
pool2d
);
REGISTER_OPERATOR_CPU
(
pool2d
,
ops
::
PoolOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
#endif
#endif
src/operators/prior_box_op.cpp
浏览文件 @
9b791af6
...
@@ -49,7 +49,13 @@ template class PriorBoxOp<CPU, float>;
...
@@ -49,7 +49,13 @@ template class PriorBoxOp<CPU, float>;
}
// namespace paddle_mobile
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
prior_box
);
#ifdef PADDLE_MOBILE_CPU
REGISTER_OPERATOR
(
prior_box
,
ops
::
PriorBoxOp
);
USE_OP_CPU
(
prior_box
);
REGISTER_OPERATOR_CPU
(
prior_box
,
ops
::
PriorBoxOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
#endif
#endif
src/operators/relu_op.cpp
浏览文件 @
9b791af6
...
@@ -33,7 +33,13 @@ template class ReluOp<CPU, float>;
...
@@ -33,7 +33,13 @@ template class ReluOp<CPU, float>;
* 都是需要和model中类型对应起来的
* 都是需要和model中类型对应起来的
* */
* */
namespace
ops
=
paddle_mobile
::
operators
;
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
relu
);
#ifdef PADDLE_MOBILE_CPU
REGISTER_OPERATOR
(
relu
,
ops
::
ReluOp
);
USE_OP_CPU
(
relu
);
REGISTER_OPERATOR_CPU
(
relu
,
ops
::
ReluOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
#endif
#endif
src/operators/reshape_op.cpp
浏览文件 @
9b791af6
...
@@ -32,7 +32,13 @@ template class ReshapeOp<CPU, float>;
...
@@ -32,7 +32,13 @@ template class ReshapeOp<CPU, float>;
}
// namespace paddle_mobile
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
reshape
);
#ifdef PADDLE_MOBILE_CPU
REGISTER_OPERATOR
(
reshape
,
ops
::
ReshapeOp
);
USE_OP_CPU
(
reshape
);
REGISTER_OPERATOR_CPU
(
reshape
,
ops
::
ReshapeOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
#endif
#endif
src/operators/sigmoid_op.cpp
浏览文件 @
9b791af6
...
@@ -27,7 +27,13 @@ template class SigmoidOp<CPU, float>;
...
@@ -27,7 +27,13 @@ template class SigmoidOp<CPU, float>;
}
// namespace paddle_mobile
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
sigmoid
);
#ifdef PADDLE_MOBILE_CPU
REGISTER_OPERATOR
(
sigmoid
,
ops
::
SigmoidOp
);
USE_OP_CPU
(
sigmoid
);
REGISTER_OPERATOR_CPU
(
sigmoid
,
ops
::
SigmoidOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
#endif
#endif
src/operators/softmax_op.cpp
浏览文件 @
9b791af6
...
@@ -27,7 +27,13 @@ template class SoftmaxOp<CPU, float>;
...
@@ -27,7 +27,13 @@ template class SoftmaxOp<CPU, float>;
}
// namespace paddle_mobile
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
softmax
);
#ifdef PADDLE_MOBILE_CPU
REGISTER_OPERATOR
(
softmax
,
ops
::
SoftmaxOp
);
USE_OP_CPU
(
softmax
);
REGISTER_OPERATOR_CPU
(
softmax
,
ops
::
SoftmaxOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
#endif
#endif
src/operators/transpose_op.cpp
浏览文件 @
9b791af6
...
@@ -52,7 +52,13 @@ template class TransposeOp<CPU, float>;
...
@@ -52,7 +52,13 @@ template class TransposeOp<CPU, float>;
}
// namespace paddle_mobile
}
// namespace paddle_mobile
namespace
ops
=
paddle_mobile
::
operators
;
namespace
ops
=
paddle_mobile
::
operators
;
USE_OP
(
transpose
);
#ifdef PADDLE_MOBILE_CPU
REGISTER_OPERATOR
(
transpose
,
ops
::
TransposeOp
);
USE_OP_CPU
(
transpose
);
REGISTER_OPERATOR_CPU
(
transpose
,
ops
::
TransposeOp
);
#endif
#ifdef PADDLE_MOBILE_MALI_GPU
#endif
#ifdef PADDLE_MOBILE_FPGA
#endif
#endif
#endif
tools/build.sh
浏览文件 @
9b791af6
...
@@ -98,7 +98,7 @@ build_for_ios() {
...
@@ -98,7 +98,7 @@ build_for_ios() {
BUILD_DIR
=
../build/release/
"
${
PLATFORM
}
"
BUILD_DIR
=
../build/release/
"
${
PLATFORM
}
"
TOOLCHAIN_FILE
=
"./tools/ios-cmake/ios.toolchain.cmake"
TOOLCHAIN_FILE
=
"./tools/ios-cmake/ios.toolchain.cmake"
C_FLAGS
=
"-fobjc-abi-version=2 -fobjc-arc -isysroot
${
CMAKE_OSX_SYSROOT
}
"
C_FLAGS
=
"-fobjc-abi-version=2 -fobjc-arc -isysroot
${
CMAKE_OSX_SYSROOT
}
"
CXX_FLAGS
=
"-fobjc-abi-version=2 -fobjc-arc -std=gnu++1
1
-stdlib=libc++ -isysroot
${
CMAKE_OSX_SYSROOT
}
"
CXX_FLAGS
=
"-fobjc-abi-version=2 -fobjc-arc -std=gnu++1
4
-stdlib=libc++ -isysroot
${
CMAKE_OSX_SYSROOT
}
"
mkdir
-p
"
${
BUILD_DIR
}
"
mkdir
-p
"
${
BUILD_DIR
}
"
if
[
$#
-eq
1
]
;
then
if
[
$#
-eq
1
]
;
then
NET
=
$1
NET
=
$1
...
...
tools/ios-cmake/ios.toolchain.cmake
浏览文件 @
9b791af6
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录