Skip to content

Commit b6f1e63

Browse files
nihuigithub-actions[bot]
authored andcommitted
apply code-format changes
1 parent b954a9d commit b6f1e63

File tree

2 files changed

+28
-18
lines changed

2 files changed

+28
-18
lines changed

src/layer/x86/convolution_3x3_winograd_bf16s.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,6 @@ static inline void conv3x3s1_winograd23_transform_output_tile_bf16s(const Mat& t
10901090
tmp10 = activation_ss(tmp10, activation_type, activation_params);
10911091
tmp11 = activation_ss(tmp11, activation_type, activation_params);
10921092

1093-
10941093
// if (out_elempack == 1)
10951094
{
10961095
unsigned short* outptr1 = outptr0 + N;
@@ -1153,7 +1152,6 @@ static inline void conv3x3s1_winograd23_transform_output_tile_bf16s(const Mat& t
11531152
tmp0 = activation_ss(tmp0, activation_type, activation_params);
11541153
tmp1 = activation_ss(tmp1, activation_type, activation_params);
11551154

1156-
11571155
// if (out_elempack == 1)
11581156
{
11591157
outptr0[0] = float32_to_bfloat16(tmp0);
@@ -2866,7 +2864,6 @@ static inline void conv3x3s1_winograd43_transform_output_tile_bf16s(const Mat& t
28662864
tmp30 = activation_ss(tmp30, activation_type, activation_params);
28672865
tmp31 = activation_ss(tmp31, activation_type, activation_params);
28682866

2869-
28702867
// if (out_elempack == 1)
28712868
{
28722869
unsigned short* outptr1 = outptr0 + N;
@@ -2961,7 +2958,6 @@ static inline void conv3x3s1_winograd43_transform_output_tile_bf16s(const Mat& t
29612958
tmp2 = activation_ss(tmp2, activation_type, activation_params);
29622959
tmp3 = activation_ss(tmp3, activation_type, activation_params);
29632960

2964-
29652961
// if (out_elempack == 1)
29662962
{
29672963
outptr0[0] = float32_to_bfloat16(tmp0);
@@ -4132,7 +4128,6 @@ static inline void conv3x3s1_winograd63_transform_input_tile_bf16s(const Mat& bo
41324128
}
41334129
}
41344130

4135-
41364131
#if NCNN_RUNTIME_CPU && NCNN_AVX512BF16 && __AVX512F__ && !__AVX512BF16__
41374132
void conv3x3s1_winograd63_transform_output_tile_bf16s_avx512bf16(const Mat& top_tile, Mat& top_blob, const Mat& bias, int i, int max_ii, int j, int max_jj, int activation_type, const Mat& activation_params);
41384133
#endif
@@ -5102,7 +5097,6 @@ static inline void conv3x3s1_winograd63_transform_output_tile_bf16s(const Mat& t
51025097
tmp50 = activation_ss(tmp50, activation_type, activation_params);
51035098
tmp51 = activation_ss(tmp51, activation_type, activation_params);
51045099

5105-
51065100
// if (out_elempack == 1)
51075101
{
51085102
unsigned short* outptr1 = outptr0 + N;
@@ -5223,7 +5217,6 @@ static inline void conv3x3s1_winograd63_transform_output_tile_bf16s(const Mat& t
52235217
tmp4 = activation_ss(tmp4, activation_type, activation_params);
52245218
tmp5 = activation_ss(tmp5, activation_type, activation_params);
52255219

5226-
52275220
// if (out_elempack == 1)
52285221
{
52295222
outptr0[0] = float32_to_bfloat16(tmp0);
@@ -5240,7 +5233,6 @@ static inline void conv3x3s1_winograd63_transform_output_tile_bf16s(const Mat& t
52405233
}
52415234
}
52425235

5243-
52445236
#if NCNN_RUNTIME_CPU && NCNN_AVX512BF16 && __AVX512F__ && !__AVX512BF16__
52455237
int conv3x3s1_winograd63_bf16s_avx512bf16(const Mat& bottom_blob, Mat& top_blob, const Mat& AT, const Mat& bias, int nT, int activation_type, const Mat& activation_params, const Option& opt);
52465238
#endif
@@ -5373,4 +5365,3 @@ static int conv3x3s1_winograd63_bf16s(const Mat& bottom_blob, Mat& top_blob, con
53735365

53745366
return 0;
53755367
}
5376-

src/layer/x86/convolution_x86.cpp

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,13 +1317,23 @@ int Convolution_x86::create_pipeline_bf16s(const Option& opt)
13171317
bool prefer_winograd23 = test_prefer_winograd23(num_input, num_output, w, h);
13181318
bool prefer_winograd43 = !prefer_winograd63 && !prefer_winograd23;
13191319

1320-
if (prefer_winograd23 && !opt.use_winograd23_convolution) { prefer_winograd23 = false; prefer_winograd43 = true; }
1321-
if (prefer_winograd63 && !opt.use_winograd63_convolution) { prefer_winograd63 = false; prefer_winograd43 = true; }
1320+
if (prefer_winograd23 && !opt.use_winograd23_convolution)
1321+
{
1322+
prefer_winograd23 = false;
1323+
prefer_winograd43 = true;
1324+
}
1325+
if (prefer_winograd63 && !opt.use_winograd63_convolution)
1326+
{
1327+
prefer_winograd63 = false;
1328+
prefer_winograd43 = true;
1329+
}
13221330
if (prefer_winograd43 && !opt.use_winograd43_convolution)
13231331
{
13241332
prefer_winograd43 = false;
1325-
if (opt.use_winograd63_convolution) prefer_winograd63 = true;
1326-
else prefer_winograd23 = true;
1333+
if (opt.use_winograd63_convolution)
1334+
prefer_winograd63 = true;
1335+
else
1336+
prefer_winograd23 = true;
13271337
}
13281338

13291339
if (prefer_winograd23)
@@ -1445,7 +1455,6 @@ int Convolution_x86::forward_bf16s(const Mat& bottom_blob, Mat& top_blob, const
14451455
if (top_blob.empty())
14461456
return -100;
14471457

1448-
14491458
const int num_input = channels * elempack;
14501459

14511460
bool prefer_winograd = (opt.use_winograd23_convolution || opt.use_winograd43_convolution || opt.use_winograd63_convolution) && (num_input > 8 || num_output > 8);
@@ -1456,13 +1465,23 @@ int Convolution_x86::forward_bf16s(const Mat& bottom_blob, Mat& top_blob, const
14561465
bool prefer_winograd23 = test_prefer_winograd23(num_input, num_output, w, h);
14571466
bool prefer_winograd43 = !prefer_winograd63 && !prefer_winograd23;
14581467

1459-
if (prefer_winograd23 && (!opt.use_winograd23_convolution || weight_winograd23_data.empty())) { prefer_winograd23 = false; prefer_winograd43 = true; }
1460-
if (prefer_winograd63 && (!opt.use_winograd63_convolution || weight_winograd63_data.empty())) { prefer_winograd63 = false; prefer_winograd43 = true; }
1468+
if (prefer_winograd23 && (!opt.use_winograd23_convolution || weight_winograd23_data.empty()))
1469+
{
1470+
prefer_winograd23 = false;
1471+
prefer_winograd43 = true;
1472+
}
1473+
if (prefer_winograd63 && (!opt.use_winograd63_convolution || weight_winograd63_data.empty()))
1474+
{
1475+
prefer_winograd63 = false;
1476+
prefer_winograd43 = true;
1477+
}
14611478
if (prefer_winograd43 && (!opt.use_winograd43_convolution || weight_winograd43_data.empty()))
14621479
{
14631480
prefer_winograd43 = false;
1464-
if (opt.use_winograd63_convolution && !weight_winograd63_data.empty()) prefer_winograd63 = true;
1465-
else prefer_winograd23 = true;
1481+
if (opt.use_winograd63_convolution && !weight_winograd63_data.empty())
1482+
prefer_winograd63 = true;
1483+
else
1484+
prefer_winograd23 = true;
14661485
}
14671486

14681487
int _nT = nT ? nT : opt.num_threads;

0 commit comments

Comments
 (0)