10000 GAPI FLUID: Enable dynamic dispatching for Split4 by alexgiving · Pull Request #21520 · opencv/opencv · GitHub
[go: up one dir, main page]

Skip to content

GAPI FLUID: Enable dynamic dispatching for Split4 #21520

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 31, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add tail proc for split3 and split4
  • Loading branch information
Aleksei Trutnev committed Jan 31, 2022
commit 667fc9bebf7594dd82ae93b91b758bea18735c2c
50 changes: 37 additions & 13 deletions modules/gapi/src/backends/fluid/gfluidcore_func.simd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1584,14 +1584,26 @@ int split3_simd(const uchar in[], uchar out1[], uchar out2[],
uchar out3[], const int width)
{
constexpr int nlanes = v_uint8::nlanes;
if (width < nlanes)
return 0;

int x = 0;
for (; x <= width - nlanes; x += nlanes)
for (;;)
{
v_uint8 a, b, c;
v_load_deinterleave(&in[3 * x], a, b, c);
vx_store(&out1[x], a);
vx_store(&out2[x], b);
vx_store(&out3[x], c);
for (; x <= width - nlanes; x += nlanes)
{
v_uint8 a, b, c;
v_load_deinterleave(&in[3 * x], a, b, c);
vx_store(&out1[x], a);
vx_store(&out2[x], b);
vx_store(&out3[x], c);
}
if (x < width)
{
x = width - nlanes;
continue;
}
break;
}
return x;
}
Expand All @@ -1606,15 +1618,27 @@ int split4_simd(const uchar in[], uchar out1[], uchar out2[],
uchar out3[], uchar out4[], const int width)
{
constexpr int nlanes = v_uint8::nlanes;
if (width < nlanes)
return 0;

int x = 0;
for (; x <= width - nlanes; x += nlanes)
for (;;)
{
v_uint8 a, b, c, d;
v_load_deinterleave(&in[4 * x], a, b, c, d);
vx_store(&out1[x], a);
vx_store(&out2[x], b);
vx_store(&out3[x], c);
vx_store(&out4[x], d);
for (; x <= width - nlanes; x += nlanes)
{
v_uint8 a, b, c, d;
v_load_deinterleave(&in[4 * x], a, b, c, d);
vx_store(&out1[x], a);
vx_store(&out2[x], b);
vx_store(&out3[x], c);
vx_store(&out4[x], d);
}
if (x < width)
{
x = width - nlanes;
continue;
}
break;
}
return x;
}
Expand Down
0