Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
10e64565
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
695
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
10e64565
编写于
5月 05, 2019
作者:
S
superjomn
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rename OpKernel to KernelLite
上级
29f9aade
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
15 addition
and
15 deletion
+15
-15
paddle/fluid/lite/core/kernel.h
paddle/fluid/lite/core/kernel.h
+4
-4
paddle/fluid/lite/core/kernel_test.cc
paddle/fluid/lite/core/kernel_test.cc
+1
-1
paddle/fluid/lite/core/op_registry.h
paddle/fluid/lite/core/op_registry.h
+1
-1
paddle/fluid/lite/kernels/cuda/io_copy_compute.cc
paddle/fluid/lite/kernels/cuda/io_copy_compute.cc
+2
-2
paddle/fluid/lite/kernels/cuda/mul_compute.h
paddle/fluid/lite/kernels/cuda/mul_compute.h
+1
-1
paddle/fluid/lite/kernels/host/fc_compute.h
paddle/fluid/lite/kernels/host/fc_compute.h
+1
-1
paddle/fluid/lite/kernels/host/feed_compute.cc
paddle/fluid/lite/kernels/host/feed_compute.cc
+1
-1
paddle/fluid/lite/kernels/host/fetch_compute.cc
paddle/fluid/lite/kernels/host/fetch_compute.cc
+1
-1
paddle/fluid/lite/kernels/host/mul_compute.cc
paddle/fluid/lite/kernels/host/mul_compute.cc
+1
-1
paddle/fluid/lite/kernels/host/relu_compute.h
paddle/fluid/lite/kernels/host/relu_compute.h
+1
-1
paddle/fluid/lite/kernels/host/scale_compute.cc
paddle/fluid/lite/kernels/host/scale_compute.cc
+1
-1
未找到文件。
paddle/fluid/lite/core/kernel.h
浏览文件 @
10e64565
...
@@ -150,7 +150,7 @@ class KernelBase {
...
@@ -150,7 +150,7 @@ class KernelBase {
// MKLDNN, plain CUDA C implementations.
// MKLDNN, plain CUDA C implementations.
template
<
TargetType
Target
,
PrecisionType
Precision
,
template
<
TargetType
Target
,
PrecisionType
Precision
,
DataLayoutType
DataLayout
=
DataLayoutType
::
kNCHW
>
DataLayoutType
DataLayout
=
DataLayoutType
::
kNCHW
>
class
OpKernel
:
public
KernelBase
{
class
KernelLite
:
public
KernelBase
{
public:
public:
// Set runtime context.
// Set runtime context.
void
SetContext
(
std
::
unique_ptr
<
KernelContext
>&&
ctx
)
{
ctx_
=
ctx
;
}
void
SetContext
(
std
::
unique_ptr
<
KernelContext
>&&
ctx
)
{
ctx_
=
ctx
;
}
...
@@ -166,15 +166,15 @@ class OpKernel : public KernelBase {
...
@@ -166,15 +166,15 @@ class OpKernel : public KernelBase {
void
Touch
()
{}
void
Touch
()
{}
OpKernel
()
=
default
;
KernelLite
()
=
default
;
virtual
~
OpKernel
()
=
default
;
virtual
~
KernelLite
()
=
default
;
protected:
protected:
std
::
unique_ptr
<
KernelContext
>
ctx_
;
std
::
unique_ptr
<
KernelContext
>
ctx_
;
};
};
template
<
TargetType
Target
,
PrecisionType
Precision
,
DataLayoutType
DataLayout
>
template
<
TargetType
Target
,
PrecisionType
Precision
,
DataLayoutType
DataLayout
>
std
::
string
OpKernel
<
Target
,
Precision
,
DataLayout
>::
name
()
const
{
std
::
string
KernelLite
<
Target
,
Precision
,
DataLayout
>::
name
()
const
{
return
op_type
()
+
":"
+
TargetToStr
(
Target
)
+
"/"
+
return
op_type
()
+
":"
+
TargetToStr
(
Target
)
+
"/"
+
PrecisionToStr
(
Precision
)
+
"/"
+
DataLayoutToStr
(
DataLayout
);
PrecisionToStr
(
Precision
)
+
"/"
+
DataLayoutToStr
(
DataLayout
);
}
}
...
...
paddle/fluid/lite/core/kernel_test.cc
浏览文件 @
10e64565
...
@@ -21,7 +21,7 @@ namespace lite {
...
@@ -21,7 +21,7 @@ namespace lite {
namespace
core
{
namespace
core
{
int
test_code
{
-
1
};
int
test_code
{
-
1
};
class
SomeKernel
:
public
OpKernel
<
TARGET
(
kHost
),
PRECISION
(
kFloat
)
>
{
class
SomeKernel
:
public
KernelLite
<
TARGET
(
kHost
),
PRECISION
(
kFloat
)
>
{
public:
public:
void
Run
()
override
{
void
Run
()
override
{
LOG
(
INFO
)
<<
"SomeKernel executed"
;
LOG
(
INFO
)
<<
"SomeKernel executed"
;
...
...
paddle/fluid/lite/core/op_registry.h
浏览文件 @
10e64565
...
@@ -52,7 +52,7 @@ class OpLiteRegistor : public Registor<OpClass> {
...
@@ -52,7 +52,7 @@ class OpLiteRegistor : public Registor<OpClass> {
template
<
TargetType
Target
,
PrecisionType
Precision
,
DataLayoutType
Layout
>
template
<
TargetType
Target
,
PrecisionType
Precision
,
DataLayoutType
Layout
>
using
KernelRegistryForTarget
=
using
KernelRegistryForTarget
=
Factory
<
OpKernel
<
Target
,
Precision
,
Layout
>
,
std
::
unique_ptr
<
KernelBase
>>
;
Factory
<
KernelLite
<
Target
,
Precision
,
Layout
>
,
std
::
unique_ptr
<
KernelBase
>>
;
class
KernelRegistry
final
{
class
KernelRegistry
final
{
public:
public:
...
...
paddle/fluid/lite/kernels/cuda/io_copy_compute.cc
浏览文件 @
10e64565
...
@@ -42,7 +42,7 @@ void CopyToHostSync(void* target, const void* source, size_t size) {
...
@@ -42,7 +42,7 @@ void CopyToHostSync(void* target, const void* source, size_t size) {
* This kernel copies a tensor from host to CUDA space.
* This kernel copies a tensor from host to CUDA space.
*/
*/
class
IoCopyHostToCudaCompute
class
IoCopyHostToCudaCompute
:
public
OpKernel
<
TARGET
(
kCUDA
),
PRECISION
(
kAny
),
DATALAYOUT
(
kAny
)
>
{
:
public
KernelLite
<
TARGET
(
kCUDA
),
PRECISION
(
kAny
),
DATALAYOUT
(
kAny
)
>
{
public:
public:
void
Run
()
override
{
void
Run
()
override
{
auto
&
param
=
Param
<
operators
::
IoCopyParam
>
();
auto
&
param
=
Param
<
operators
::
IoCopyParam
>
();
...
@@ -77,7 +77,7 @@ class IoCopyHostToCudaCompute
...
@@ -77,7 +77,7 @@ class IoCopyHostToCudaCompute
* This kernel copies a tensor from CUDA to host space.
* This kernel copies a tensor from CUDA to host space.
*/
*/
class
IoCopyCudaToHostCompute
class
IoCopyCudaToHostCompute
:
public
OpKernel
<
TARGET
(
kCUDA
),
PRECISION
(
kAny
),
DATALAYOUT
(
kAny
)
>
{
:
public
KernelLite
<
TARGET
(
kCUDA
),
PRECISION
(
kAny
),
DATALAYOUT
(
kAny
)
>
{
public:
public:
void
Run
()
override
{
void
Run
()
override
{
auto
&
param
=
Param
<
operators
::
IoCopyParam
>
();
auto
&
param
=
Param
<
operators
::
IoCopyParam
>
();
...
...
paddle/fluid/lite/kernels/cuda/mul_compute.h
浏览文件 @
10e64565
...
@@ -30,7 +30,7 @@ void mul_compute(const lite::cuda::Blas<float>& blas, const T* x, int x_h,
...
@@ -30,7 +30,7 @@ void mul_compute(const lite::cuda::Blas<float>& blas, const T* x, int x_h,
nullptr
,
out
,
x_h
);
nullptr
,
out
,
x_h
);
}
}
class
MulCompute
:
public
OpKernel
<
TARGET
(
kCUDA
),
PRECISION
(
kFloat
)
>
{
class
MulCompute
:
public
KernelLite
<
TARGET
(
kCUDA
),
PRECISION
(
kFloat
)
>
{
public:
public:
using
param_t
=
operators
::
MulParam
;
using
param_t
=
operators
::
MulParam
;
...
...
paddle/fluid/lite/kernels/host/fc_compute.h
浏览文件 @
10e64565
...
@@ -23,7 +23,7 @@ namespace lite {
...
@@ -23,7 +23,7 @@ namespace lite {
namespace
kernels
{
namespace
kernels
{
namespace
host
{
namespace
host
{
class
FcCompute
:
public
OpKernel
<
TARGET
(
kHost
),
PRECISION
(
kFloat
)
>
{
class
FcCompute
:
public
KernelLite
<
TARGET
(
kHost
),
PRECISION
(
kFloat
)
>
{
public:
public:
using
param_t
=
operators
::
FcParam
;
using
param_t
=
operators
::
FcParam
;
...
...
paddle/fluid/lite/kernels/host/feed_compute.cc
浏览文件 @
10e64565
...
@@ -21,7 +21,7 @@ namespace kernels {
...
@@ -21,7 +21,7 @@ namespace kernels {
namespace
host
{
namespace
host
{
class
FeedCompute
class
FeedCompute
:
public
OpKernel
<
TARGET
(
kHost
),
PRECISION
(
kAny
),
DATALAYOUT
(
kAny
)
>
{
:
public
KernelLite
<
TARGET
(
kHost
),
PRECISION
(
kAny
),
DATALAYOUT
(
kAny
)
>
{
public:
public:
using
param_t
=
operators
::
FeedParam
;
using
param_t
=
operators
::
FeedParam
;
...
...
paddle/fluid/lite/kernels/host/fetch_compute.cc
浏览文件 @
10e64565
...
@@ -21,7 +21,7 @@ namespace kernels {
...
@@ -21,7 +21,7 @@ namespace kernels {
namespace
host
{
namespace
host
{
class
FetchCompute
class
FetchCompute
:
public
OpKernel
<
TARGET
(
kHost
),
PRECISION
(
kAny
),
DATALAYOUT
(
kAny
)
>
{
:
public
KernelLite
<
TARGET
(
kHost
),
PRECISION
(
kAny
),
DATALAYOUT
(
kAny
)
>
{
public:
public:
using
param_t
=
operators
::
FeedParam
;
using
param_t
=
operators
::
FeedParam
;
...
...
paddle/fluid/lite/kernels/host/mul_compute.cc
浏览文件 @
10e64565
...
@@ -35,7 +35,7 @@ void mul_compute_eigen(const T* x, int x_h, int x_w, const T* y, int y_h,
...
@@ -35,7 +35,7 @@ void mul_compute_eigen(const T* x, int x_h, int x_w, const T* y, int y_h,
Out
=
X
*
Y
;
Out
=
X
*
Y
;
}
}
class
MulCompute
:
public
OpKernel
<
TARGET
(
kHost
),
PRECISION
(
kFloat
)
>
{
class
MulCompute
:
public
KernelLite
<
TARGET
(
kHost
),
PRECISION
(
kFloat
)
>
{
public:
public:
using
param_t
=
operators
::
MulParam
;
using
param_t
=
operators
::
MulParam
;
...
...
paddle/fluid/lite/kernels/host/relu_compute.h
浏览文件 @
10e64565
...
@@ -21,7 +21,7 @@ namespace lite {
...
@@ -21,7 +21,7 @@ namespace lite {
namespace
kernels
{
namespace
kernels
{
namespace
host
{
namespace
host
{
class
ReluCompute
:
public
OpKernel
<
TARGET
(
kHost
),
PRECISION
(
kFloat
)
>
{
class
ReluCompute
:
public
KernelLite
<
TARGET
(
kHost
),
PRECISION
(
kFloat
)
>
{
public:
public:
void
Run
()
override
{
void
Run
()
override
{
auto
&
theparam
=
Param
<
operators
::
ReluParam
>
();
auto
&
theparam
=
Param
<
operators
::
ReluParam
>
();
...
...
paddle/fluid/lite/kernels/host/scale_compute.cc
浏览文件 @
10e64565
...
@@ -31,7 +31,7 @@ void scale_compute(const T* x, T* out, int size, float scale, float bias,
...
@@ -31,7 +31,7 @@ void scale_compute(const T* x, T* out, int size, float scale, float bias,
}
}
}
}
class
ScaleCompute
:
public
OpKernel
<
TARGET
(
kHost
),
PRECISION
(
kFloat
)
>
{
class
ScaleCompute
:
public
KernelLite
<
TARGET
(
kHost
),
PRECISION
(
kFloat
)
>
{
public:
public:
using
param_t
=
operators
::
MulParam
;
using
param_t
=
operators
::
MulParam
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录