提交 4cce2480 编写于 作者: M Megvii Engine Team

fix(dnn/opencl): fix some bug for dnn opencl conv bias and relayout format

GitOrigin-RevId: b5bb07d90d316f2162c2441a017c8a01675921f5
上级 ca0e616f
......@@ -474,6 +474,8 @@ void RelayoutFormatImpl::exec(
src.layout.dtype.enumv() == DTypeEnum::Int32 ||
(src.layout.dtype.enumv() == DTypeEnum::Uint8 &&
dst.layout.dtype.enumv() == DTypeEnum::QuantizedS8) ||
(src.layout.dtype.enumv() == DTypeEnum::Uint8 &&
dst.layout.dtype.enumv() == DTypeEnum::Uint8) ||
src.layout.dtype.category() == DTypeCategory::QUANTIZED);
check_exec(src.layout, dst.layout, workspace.size);
HandleImpl* m_handle = static_cast<HandleImpl*>(handle());
......@@ -516,6 +518,7 @@ void RelayoutFormatImpl::exec(
DNN_INC_FLOAT16(cb(Float16, dt_float16));
cb(Quantized8Asymm, dt_uint8);
cb(QuantizedS8, dt_int8);
cb(Uint8, dt_uint8);
#undef cb
default:
megdnn_assert(0);
......
......@@ -19940,3 +19940,46 @@ static const std::vector<uint8_t> TestLayoutTransform_OPENCL_Resnet18_F32 = {
52, 44, 87, 44, 67, 37, 52, 125, 59, 123, 78, 44, 67, 44, 72, 44,
87, 125, 59, 49, 59, 70, 108, 111, 97, 116, 51, 50, 59, 70, 108, 111,
97, 116, 51, 50, 4, 0, 0, 0, 205, 204, 76, 65};
static const std::vector<uint8_t> TestLayoutTransform_ConvBiasNobias = {
1, 0, 0, 0, 36, 0, 0, 0, 108, 97, 121, 111, 117, 116, 95, 116,
114, 97, 110, 115, 102, 111, 114, 109, 95, 112, 114, 111, 102, 105, 108, 101,
58, 112, 108, 97, 116, 61, 111, 112, 101, 110, 99, 108, 6, 0, 0, 0,
66, 0, 0, 0, 49, 54, 44, 51, 44, 55, 51, 54, 44, 49, 50, 56,
48, 59, 70, 108, 111, 97, 116, 51, 50, 124, 123, 78, 44, 72, 44, 67,
47, 47, 52, 44, 87, 44, 67, 37, 52, 125, 59, 123, 78, 44, 67, 44,
72, 44, 87, 125, 59, 49, 59, 70, 108, 111, 97, 116, 51, 50, 59, 70,
108, 111, 97, 116, 51, 50, 4, 0, 0, 0, 0, 0, 0, 0, 130, 0,
0, 0, 10, 151, 159, 190, 73, 14, 145, 194, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0,
0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0,
0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 255, 255,
255, 255, 255, 255, 255, 255, 49, 54, 44, 51, 44, 55, 51, 54, 44, 49,
50, 56, 48, 59, 70, 108, 111, 97, 116, 51, 50, 124, 50, 44, 51, 44,
51, 44, 51, 59, 70, 108, 111, 97, 116, 51, 50, 124, 49, 54, 44, 50,
44, 55, 51, 54, 44, 49, 50, 56, 48, 59, 70, 108, 111, 97, 116, 51,
50, 124, 50, 49, 4, 0, 0, 0, 0, 0, 0, 0, 66, 0, 0, 0,
49, 54, 44, 50, 44, 55, 51, 54, 44, 49, 50, 56, 48, 59, 70, 108,
111, 97, 116, 51, 50, 124, 123, 78, 44, 72, 44, 67, 47, 47, 52, 44,
87, 44, 67, 37, 52, 125, 59, 123, 78, 44, 67, 44, 72, 44, 87, 125,
59, 49, 59, 70, 108, 111, 97, 116, 51, 50, 59, 70, 108, 111, 97, 116,
51, 50, 4, 0, 0, 0, 0, 0, 0, 0, 130, 0, 0, 0, 10, 151,
159, 190, 73, 14, 145, 194, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0,
0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255,
255, 255, 49, 54, 44, 51, 44, 55, 51, 54, 44, 49, 50, 56, 48, 59,
70, 108, 111, 97, 116, 51, 50, 124, 50, 44, 51, 44, 51, 44, 51, 59,
70, 108, 111, 97, 116, 51, 50, 124, 49, 54, 44, 50, 44, 55, 51, 54,
44, 49, 50, 56, 48, 59, 70, 108, 111, 97, 116, 51, 50, 124, 48, 49,
4, 0, 0, 0, 0, 0, 0, 0, 66, 0, 0, 0, 49, 54, 44, 51,
44, 55, 51, 54, 44, 49, 50, 56, 48, 59, 70, 108, 111, 97, 116, 51,
50, 124, 123, 78, 44, 67, 44, 72, 44, 87, 125, 59, 123, 78, 44, 72,
44, 67, 47, 47, 52, 44, 87, 44, 67, 37, 52, 125, 59, 49, 59, 70,
108, 111, 97, 116, 51, 50, 59, 70, 108, 111, 97, 116, 51, 50, 4, 0,
0, 0, 0, 0, 0, 0, 66, 0, 0, 0, 49, 54, 44, 50, 44, 55,
51, 54, 44, 49, 50, 56, 48, 59, 70, 108, 111, 97, 116, 51, 50, 124,
123, 78, 44, 67, 44, 72, 44, 87, 125, 59, 123, 78, 44, 72, 44, 67,
47, 47, 52, 44, 87, 44, 67, 37, 52, 125, 59, 49, 59, 70, 108, 111,
97, 116, 51, 50, 59, 70, 108, 111, 97, 116, 51, 50, 4, 0, 0, 0,
0, 0, 0, 0};
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册