提交 2667a153 编写于 作者: S StarryRain 提交者: Jiaying Zhao

fix “CL_INVALID_KERNEL_ARGS ” error, test=develop (#2213)

上级 7c722a37
...@@ -399,20 +399,24 @@ void ConvAddBnRelu(framework::CLHelper *cl_helper, ...@@ -399,20 +399,24 @@ void ConvAddBnRelu(framework::CLHelper *cl_helper,
status = clSetKernelArg(kernel, index++, sizeof(int), &output_height); status = clSetKernelArg(kernel, index++, sizeof(int), &output_height);
CL_CHECK_ERRORS(status); CL_CHECK_ERRORS(status);
if (param.Filter()->dims()[2] == 3 && param.Filter()->dims()[3] == 3) {
// normal conv
if (param.Filter()->dims()[0] == param.Output()->dims()[1] &&
param.Filter()->dims()[1] == param.Input()->dims()[1]) {
status = clSetKernelArg(kernel, index++, sizeof(int), &output_c); status = clSetKernelArg(kernel, index++, sizeof(int), &output_c);
CL_CHECK_ERRORS(status); CL_CHECK_ERRORS(status);
if (param.Filter()->dims()[2] == 3 && param.Filter()->dims()[3] == 3) {
if (filter_channel != input_channel) {
status = clSetKernelArg(kernel, index++, sizeof(int), &filter_channel); status = clSetKernelArg(kernel, index++, sizeof(int), &filter_channel);
CL_CHECK_ERRORS(status); CL_CHECK_ERRORS(status);
int group = input_channel / filter_channel; int group = 1;
status = clSetKernelArg(kernel, index++, sizeof(int), &group); status = clSetKernelArg(kernel, index++, sizeof(int), &group);
CL_CHECK_ERRORS(status); CL_CHECK_ERRORS(status);
} else { } else if (!(param.Filter()->dims()[0] == param.Input()->dims()[1] &&
param.Filter()->dims()[1] == 1)) { // not depwise
status = clSetKernelArg(kernel, index++, sizeof(int), &output_c);
CL_CHECK_ERRORS(status);
status = clSetKernelArg(kernel, index++, sizeof(int), &filter_channel); status = clSetKernelArg(kernel, index++, sizeof(int), &filter_channel);
CL_CHECK_ERRORS(status); CL_CHECK_ERRORS(status);
int group = 1; int group = input_channel / filter_channel;
status = clSetKernelArg(kernel, index++, sizeof(int), &group); status = clSetKernelArg(kernel, index++, sizeof(int), &group);
CL_CHECK_ERRORS(status); CL_CHECK_ERRORS(status);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册