Skip to content

Commit

Permalink
reduce omp args
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui committed Jul 17, 2023
1 parent 09b12b7 commit fe19e33
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions src/layer/x86/convolution_packed_int8.h
Original file line number Diff line number Diff line change
Expand Up @@ -926,15 +926,9 @@ static void convolution_packed_int8(const Mat& bottom_blob, Mat& top_blob, const
const int elempack = bottom_blob.elempack;
const int inch = bottom_blob.c * elempack;

const int N = bottom_blob.cstep * elempack;

const int outw = top_blob.w;
const int outh = top_blob.h;
const int out_elempack = top_blob.elempack;
const int outch = top_blob.c * out_elempack;

const int M = top_blob.cstep * out_elempack;

const int maxk = kernel_w * kernel_h;

// kernel offsets
Expand Down Expand Up @@ -967,6 +961,11 @@ static void convolution_packed_int8(const Mat& bottom_blob, Mat& top_blob, const
{
const int p = pp * 16;

const int outw = top_blob.w;
const int outh = top_blob.h;
const int N = bottom_blob.cstep * elempack;
const int M = top_blob.cstep * out_elempack;

int* outptr = top_blob.channel(p / out_elempack);

int ij = 0;
Expand Down Expand Up @@ -1541,6 +1540,11 @@ static void convolution_packed_int8(const Mat& bottom_blob, Mat& top_blob, const
{
const int p = remain_outch_start + pp * 8;

const int outw = top_blob.w;
const int outh = top_blob.h;
const int N = bottom_blob.cstep * elempack;
const int M = top_blob.cstep * out_elempack;

int* outptr = top_blob.channel(p / out_elempack);

int ij = 0;
Expand Down Expand Up @@ -2091,6 +2095,11 @@ static void convolution_packed_int8(const Mat& bottom_blob, Mat& top_blob, const
{
const int p = remain_outch_start + pp * 4;

const int outw = top_blob.w;
const int outh = top_blob.h;
const int N = bottom_blob.cstep * elempack;
const int M = top_blob.cstep * out_elempack;

int* outptr = top_blob.channel(p / out_elempack);

int ij = 0;
Expand Down Expand Up @@ -2692,6 +2701,10 @@ static void convolution_packed_int8(const Mat& bottom_blob, Mat& top_blob, const
{
const int p = remain_outch_start + pp * 2;

const int outw = top_blob.w;
const int outh = top_blob.h;
const int N = bottom_blob.cstep * elempack;

int* outptr0 = top_blob.channel(p);
int* outptr1 = top_blob.channel(p + 1);

Expand Down Expand Up @@ -3143,6 +3156,10 @@ static void convolution_packed_int8(const Mat& bottom_blob, Mat& top_blob, const
remain_outch_start += nn_outch * 2;
for (int p = remain_outch_start; p < outch; p++)
{
const int outw = top_blob.w;
const int outh = top_blob.h;
const int N = bottom_blob.cstep * elempack;

int* outptr = top_blob.channel(p);

int ij = 0;
Expand Down

0 comments on commit fe19e33

Please sign in to comment.