From 047d7f42f1ba2a8688ce492e24d5ed902f21ac71 Mon Sep 17 00:00:00 2001 From: liuqi Date: Mon, 27 Nov 2017 17:18:38 +0800 Subject: [PATCH] Fix some typo and remove unsed code. --- mace/kernels/opencl/buffer_to_image.cc | 2 +- mace/kernels/opencl/conv_2d_opencl_3x3.cc | 2 +- mace/kernels/opencl/helper.cc | 4 ++-- mace/kernels/opencl/helper.h | 2 +- mace/ops/conv_2d_test.cc | 2 ++ 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/mace/kernels/opencl/buffer_to_image.cc b/mace/kernels/opencl/buffer_to_image.cc index be76710a..511e4598 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 6b2d5f6e..b7e11e81 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 b29c0105..05221e55 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 19400692..1ad94aa5 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 7ed100cc..6120f403 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) -- GitLab