Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Oneflow-Inc
oneflow
提交
3f5ae250
O
oneflow
项目概览
Oneflow-Inc
/
oneflow
上一次同步 接近 3 年
通知
13
Star
2733
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oneflow
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3f5ae250
编写于
6月 11, 2017
作者:
W
willzhang4a58
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
template typename float_point_type
上级
7dfabfd9
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
22 addition
and
20 deletion
+22
-20
oneflow/core/kernel/convolution_kernel.cpp
oneflow/core/kernel/convolution_kernel.cpp
+2
-2
oneflow/core/kernel/convolution_kernel.cu
oneflow/core/kernel/convolution_kernel.cu
+2
-2
oneflow/core/kernel/convolution_kernel.h
oneflow/core/kernel/convolution_kernel.h
+3
-3
oneflow/core/kernel/kernel.cpp
oneflow/core/kernel/kernel.cpp
+6
-0
oneflow/core/kernel/kernel.h
oneflow/core/kernel/kernel.h
+5
-9
oneflow/core/kernel/kernel_manager.h
oneflow/core/kernel/kernel_manager.h
+4
-4
未找到文件。
oneflow/core/kernel/convolution_kernel.cpp
浏览文件 @
3f5ae250
...
...
@@ -3,14 +3,14 @@
namespace
oneflow
{
template
<
FloatingPointTyp
e
floating_point_type
>
template
<
typenam
e
floating_point_type
>
void
ConvolutionKernel
<
DeviceType
::
kCPU
,
floating_point_type
>::
Forward
(
const
KernelContext
&
,
std
::
function
<
Blob
*
(
const
std
::
string
&
)
>
bn_in_op2blob_ptr
)
const
{
TODO
();
}
template
<
FloatingPointTyp
e
floating_point_type
>
template
<
typenam
e
floating_point_type
>
void
ConvolutionKernel
<
DeviceType
::
kCPU
,
floating_point_type
>::
Backward
(
const
KernelContext
&
,
std
::
function
<
Blob
*
(
const
std
::
string
&
)
>
bn_in_op2blob_ptr
)
const
{
...
...
oneflow/core/kernel/convolution_kernel.cu
浏览文件 @
3f5ae250
...
...
@@ -3,14 +3,14 @@
namespace
oneflow
{
template
<
FloatingPointTyp
e
floating_point_type
>
template
<
typenam
e
floating_point_type
>
void
ConvolutionKernel
<
DeviceType
::
kGPU
,
floating_point_type
>::
Forward
(
const
KernelContext
&
,
std
::
function
<
Blob
*
(
const
std
::
string
&
)
>
bn_in_op2blob_ptr
)
const
{
TODO
();
}
template
<
FloatingPointTyp
e
floating_point_type
>
template
<
typenam
e
floating_point_type
>
void
ConvolutionKernel
<
DeviceType
::
kGPU
,
floating_point_type
>::
Backward
(
const
KernelContext
&
,
std
::
function
<
Blob
*
(
const
std
::
string
&
)
>
bn_in_op2blob_ptr
)
const
{
...
...
oneflow/core/kernel/convolution_kernel.h
浏览文件 @
3f5ae250
...
...
@@ -8,11 +8,11 @@
namespace
oneflow
{
template
<
DeviceType
device_type
,
FloatingPointTyp
e
floating_point_type
>
template
<
DeviceType
device_type
,
typenam
e
floating_point_type
>
class
ConvolutionKernel
final
{
};
template
<
FloatingPointTyp
e
floating_point_type
>
template
<
typenam
e
floating_point_type
>
class
ConvolutionKernel
<
DeviceType
::
kCPU
,
floating_point_type
>
final
:
public
Kernel
{
public:
OF_DISALLOW_COPY_AND_MOVE
(
ConvolutionKernel
);
...
...
@@ -23,7 +23,7 @@ class ConvolutionKernel<DeviceType::kCPU, floating_point_type> final : public Ke
void
Backward
(
const
KernelContext
&
,
std
::
function
<
Blob
*
(
const
std
::
string
&
)
>
)
const
override
;
};
template
<
FloatingPointTyp
e
floating_point_type
>
template
<
typenam
e
floating_point_type
>
class
ConvolutionKernel
<
DeviceType
::
kGPU
,
floating_point_type
>
final
:
public
Kernel
{
public:
OF_DISALLOW_COPY_AND_MOVE
(
ConvolutionKernel
);
...
...
oneflow/core/kernel/kernel.cpp
浏览文件 @
3f5ae250
...
...
@@ -2,6 +2,12 @@
namespace
oneflow
{
void
Kernel
::
InitFromOpProto
(
const
OperatorProto
&
op_proto
)
{
Operator
*
op
=
CreateOp
(
op_proto
.
op_conf
().
op_type_case
());
op
->
InitFromProto
(
op_proto
);
op_
.
reset
(
op
);
}
void
Kernel
::
InitModelAndModelTmpBlobs
(
const
KernelContext
&
ctx
,
std
::
function
<
Blob
*
(
const
std
::
string
&
)
>
Blob4BnInOp
)
const
{
...
...
oneflow/core/kernel/kernel.h
浏览文件 @
3f5ae250
...
...
@@ -21,11 +21,7 @@ class Kernel {
OF_DISALLOW_COPY_AND_MOVE
(
Kernel
);
virtual
~
Kernel
()
=
default
;
void
InitFromOpProto
(
const
OperatorProto
&
op_proto
)
{
Operator
*
op
=
CreateOp
(
op_proto
.
op_conf
().
op_type_case
());
op
->
InitFromProto
(
op_proto
);
op_
.
reset
(
op
);
}
void
InitFromOpProto
(
const
OperatorProto
&
op_proto
);
void
InitModelAndModelTmpBlobs
(
const
KernelContext
&
ctx
,
...
...
@@ -57,12 +53,12 @@ using KernelWardFunc = void (Kernel::*)(
#define INSTANTIATE_CPU_KERNEL_CLASS(classname) \
char gInstantiationGuardCPU##classname; \
template class classname<DeviceType::kCPU,
FloatingPointType::kF
loat>; \
template class classname<DeviceType::kCPU,
FloatingPointType::kD
ouble>;
template class classname<DeviceType::kCPU,
f
loat>; \
template class classname<DeviceType::kCPU,
d
ouble>;
#define INSTANTIATE_GPU_KERNEL_CLASS(classname) \
char gInstantiationGuardGPU##classname; \
template class classname<DeviceType::kGPU,
FloatingPointType::kF
loat>; \
template class classname<DeviceType::kGPU,
FloatingPointType::kD
ouble>;
template class classname<DeviceType::kGPU,
f
loat>; \
template class classname<DeviceType::kGPU,
d
ouble>;
}
// namespace oneflow
...
...
oneflow/core/kernel/kernel_manager.h
浏览文件 @
3f5ae250
...
...
@@ -68,10 +68,10 @@ struct GpuDoubleKernelRegister {
};
#define REGISTER_KERNEL(OpTypeCase, KernelType) \
static CpuFloatKernelRegister<OpTypeCase, KernelType<DeviceType::kCPU,
FloatingPointType::kF
loat>> g_##KernelType##_cpu_float_regst_var; \
static CpuDoubleKernelRegister<OpTypeCase, KernelType<DeviceType::kCPU,
FloatingPointType::kD
ouble>> g_##KernelType##_cpu_double_regst_var; \
static GpuFloatKernelRegister<OpTypeCase, KernelType<DeviceType::kGPU,
FloatingPointType::kF
loat>> g_##KernelType##_gpu_float_regst_var; \
static GpuDoubleKernelRegister<OpTypeCase, KernelType<DeviceType::kGPU,
FloatingPointType::kD
ouble>> g_##KernelType##_gpu_double_regst_var;
static CpuFloatKernelRegister<OpTypeCase, KernelType<DeviceType::kCPU,
f
loat>> g_##KernelType##_cpu_float_regst_var; \
static CpuDoubleKernelRegister<OpTypeCase, KernelType<DeviceType::kCPU,
d
ouble>> g_##KernelType##_cpu_double_regst_var; \
static GpuFloatKernelRegister<OpTypeCase, KernelType<DeviceType::kGPU,
f
loat>> g_##KernelType##_gpu_float_regst_var; \
static GpuDoubleKernelRegister<OpTypeCase, KernelType<DeviceType::kGPU,
d
ouble>> g_##KernelType##_gpu_double_regst_var;
}
// namespace oneflow
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录