diff --git a/mace/kernels/opencl/buffer_to_image.cc b/mace/kernels/opencl/buffer_to_image.cc index be76710a2cea374cd733df19bc24000625a8c4e0..511e4598309561a5a453113784db9de4d933399b 100644 --- a/mace/kernels/opencl/buffer_to_image.cc +++ b/mace/kernels/opencl/buffer_to_image.cc @@ -25,7 +25,7 @@ void BufferToImageFunctor::operator()(Tensor *buffer, std::set built_options; built_options.emplace("-DDATA_TYPE=" + DataTypeToCLType(image->dtype())); - built_options.emplace("-DCMD_DATA_TYPE=" + DataTypeToOpenclCMDDataType(image->dtype())); + built_options.emplace("-DCMD_DATA_TYPE=" + DataTypeToOPENCLCMDDataType(image->dtype())); auto runtime = OpenCLRuntime::Get(); string kernel_name; switch (type) { diff --git a/mace/kernels/opencl/conv_2d_opencl_3x3.cc b/mace/kernels/opencl/conv_2d_opencl_3x3.cc index 6b2d5f6e18617d1825fa210df4c295b490675236..b7e11e817922287a9b048ed9299c5d332f3ef0cf 100644 --- a/mace/kernels/opencl/conv_2d_opencl_3x3.cc +++ b/mace/kernels/opencl/conv_2d_opencl_3x3.cc @@ -26,7 +26,7 @@ static void Conv2d3x3S12(const Tensor *input, const Tensor *filter, std::set built_options; built_options.emplace("-DDATA_TYPE=" + DataTypeToCLType(input->dtype())); - built_options.emplace("-DCMD_DATA_TYPE=" + DataTypeToOpenclCMDDataType(input->dtype())); + built_options.emplace("-DCMD_DATA_TYPE=" + DataTypeToOPENCLCMDDataType(input->dtype())); built_options.emplace(bias != nullptr ? "-DBIAS" : ""); auto runtime = OpenCLRuntime::Get(); diff --git a/mace/kernels/opencl/helper.cc b/mace/kernels/opencl/helper.cc index b29c0105c3d06ec46b86cb530e02d75f33f93625..05221e55dedde3c7cc17d3f99d2818491d930b87 100644 --- a/mace/kernels/opencl/helper.cc +++ b/mace/kernels/opencl/helper.cc @@ -17,7 +17,7 @@ void CalInOutputImageShape(const std::vector &shape, /* NHWC */ image_shape[1] = shape[0] * shape[1]; } -// [H * W * 4, (Oc + 3) / 4] +// [H * W * RoundUp<4>(Ic), (Oc + 3) / 4] void CalFilterImageShape(const std::vector &shape, /* HWIO*/ std::vector &image_shape) { MACE_CHECK(shape.size() == 4); @@ -82,7 +82,7 @@ std::string DataTypeToCLType(const DataType dt) { } } -std::string DataTypeToOpenclCMDDataType(const DataType dt) { +std::string DataTypeToOPENCLCMDDataType(const DataType dt) { switch (dt) { case DT_FLOAT: return "f"; diff --git a/mace/kernels/opencl/helper.h b/mace/kernels/opencl/helper.h index 19400692f9ca8a1d1d6194faae091de9d91c2944..1ad94aa5d2545f059ec785c0b4ec36a87155fb49 100644 --- a/mace/kernels/opencl/helper.h +++ b/mace/kernels/opencl/helper.h @@ -19,7 +19,7 @@ void CalImage2DShape(const std::vector &shape, /* NHWC */ const BufferType type, std::vector &image_shape); -std::string DataTypeToOpenclCMDDataType(const DataType dt); +std::string DataTypeToOPENCLCMDDataType(const DataType dt); std::string DataTypeToCLType(const DataType dt); diff --git a/mace/ops/conv_2d_test.cc b/mace/ops/conv_2d_test.cc index 7ed100cc80fcef7ea65cfa598910932e5ed62e75..6120f403b31af34c5689fdd2664ede5924edd826 100644 --- a/mace/ops/conv_2d_test.cc +++ b/mace/ops/conv_2d_test.cc @@ -467,6 +467,7 @@ static void TestComplexConvNxNS12(const std::vector &shape) { OpDefBuilder("Conv2D", "Conv2dTest") .Input("Input") .Input("Filter") + .Input("Bias") .Output("Output") .AddIntsArg("strides", {stride_h, stride_w}) .AddIntArg("padding", type) @@ -493,6 +494,7 @@ static void TestComplexConvNxNS12(const std::vector &shape) { OpDefBuilder("Conv2D", "Conv2dTest") .Input("InputImage") .Input("FilterImage") + .Input("BiasImage") .Output("OutputImage") .AddIntsArg("strides", {stride_h, stride_w}) .AddIntArg("padding", type)