提交 7e75d3c5 编写于 作者: N NazgulLee 提交者: Jiaying Zhao

[mobile][opencl] add universal conv_transpose. test=develop (#2710)

上级 a48c8b23
...@@ -43,7 +43,10 @@ bool ConvTransposeKernel<GPU_CL, float>::Init( ...@@ -43,7 +43,10 @@ bool ConvTransposeKernel<GPU_CL, float>::Init(
this->cl_helper_.AddKernel("conv_transpose3x3s2", this->cl_helper_.AddKernel("conv_transpose3x3s2",
"conv_transpose_kernel.cl"); "conv_transpose_kernel.cl");
} else { } else {
PADDLE_MOBILE_THROW_EXCEPTION(" not support "); param->ExecMode() = ConvTransposeParam<GPU_CL>::EXEC_CONVTRANS_FLOAT;
param->Filter()->InitConv2dTransposeFilterCLImage(
cl_helper_.CLContext(), cl_helper_.CLCommandQueue());
this->cl_helper_.AddKernel("conv_transpose", "conv_transpose_kernel.cl");
} }
return true; return true;
} }
...@@ -58,6 +61,9 @@ void ConvTransposeKernel<GPU_CL, float>::Compute( ...@@ -58,6 +61,9 @@ void ConvTransposeKernel<GPU_CL, float>::Compute(
case ConvTransposeParam<GPU_CL>::EXEC_CONVTRANS3x3s2_FLOAT: case ConvTransposeParam<GPU_CL>::EXEC_CONVTRANS3x3s2_FLOAT:
ConvTranspose3x3s2AddBnRelu(&this->cl_helper_, param); ConvTranspose3x3s2AddBnRelu(&this->cl_helper_, param);
break; break;
case ConvTransposeParam<GPU_CL>::EXEC_CONVTRANS_FLOAT:
ConvTransposeAddBnRelu(&this->cl_helper_, param);
break;
default: default:
PADDLE_MOBILE_THROW_EXCEPTION( PADDLE_MOBILE_THROW_EXCEPTION(
"Invalid convolution transpose execute mode %d", param.ExecMode()); "Invalid convolution transpose execute mode %d", param.ExecMode());
......
...@@ -2632,6 +2632,7 @@ class ConvTransposeParam : public OpParam { ...@@ -2632,6 +2632,7 @@ class ConvTransposeParam : public OpParam {
EXEC_DECONV4X4_FLOAT, EXEC_DECONV4X4_FLOAT,
EXEC_DEPTHWISETRANS_FLOAT, EXEC_DEPTHWISETRANS_FLOAT,
EXEC_CONVTRANS3x3s2_FLOAT, EXEC_CONVTRANS3x3s2_FLOAT,
EXEC_CONVTRANS_FLOAT,
}; };
ExecMode &ExecMode() const { return exec_mode_; } ExecMode &ExecMode() const { return exec_mode_; }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册