-
-
Notifications
You must be signed in to change notification settings - Fork 55.7k
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
GAPI Fluid: SIMD for DivRC kernel. #21530
Conversation
d7e2890
to
d51236a
Compare
9e87de6
to
50443db
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anna-khakimova
I checked out 4 files from 6 and have understood that it takes too much time then i supposed.
If this is urgent then I suggest you to find another reviewer: I'm very sorry but I have much load on this week. Furthermore we need to finish another one PR for DX11/OpenCL which had started before DivRC and got several unresolved questions.
Sorry, i cannot proceed with this PR on this week
@@ -936,8 +936,8 @@ CV_ALWAYS_INLINE void run_arithm_s(Buffer &dst, const View &src, const float sca | |||
} | |||
|
|||
template<typename DST, typename SRC> | |||
static void run_arithm_rs(Buffer &dst, const View &src, const float scalar[4], Arithm arithm, | |||
float scale=1) | |||
CV_ALWAYS_INLINE void run_arithm_rs(Buffer &dst, const View &src, const float scalar[], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is scalar size changed from 4?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The scalar
array is a pointer to scratch buffer that was filled in a special way.
GMatDesc bufdesc = { CV_32F, 1, bufsize }; | ||
Buffer buffer(bufdesc); | ||
scratch = std::move(buffer); | ||
scratch = std::move(Buffer(GMatDesc(CV_32F, 1, cv::Size(buflen, 1)))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggest to remove std::mode or swap it if available
template<typename scalar_t> | ||
using univ_zero_vec_type_of_t = typename univ_zero_vec_type_of<scalar_t>::type; | ||
|
||
template<> struct univ_zero_vec_type_of<uchar> { using type = v_uint8; }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does it mean - univ?
template<typename scalar_t> | ||
using zero_vec_type_of_t = typename zero_vec_type_of<scalar_t>::type; | ||
|
||
template<> struct zero_vec_type_of<uchar> { using type = v_int16; }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int16 for uchar? is it not mistake?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not mistake it's implementation specifics.
} \ | ||
} \ | ||
default: \ | ||
GAPI_Assert(chan <= 4); \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think there may be warning for walking through switch-cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no warnings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
50443db
to
6d830cc
Compare
6d830cc
to
f6bf71e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
@@ -528,6 +528,10 @@ PERF_TEST_P_(DivRCPerfTest, TestPerformance) | |||
|
|||
// FIXIT Unstable input data for divide | |||
initMatsRandU(type, sz, dtype, false); | |||
//This condition need as workaround the bug in the OpenCV. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, It makes sense to add reference to the mentioned bug. #21044
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alalek I propose to apply this comment in the next PR in order not to restart the CI checks once again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved but please address Alexander's comment
* GAPI Fluid: SIMD for DivRC kernel. * Fluid: Div kernel's SIMD refactoring * SIMD for DivRC 3 channel case * Applied comments
Add SIMD for GAPI Fluid DivRC kernel.
Performance report:
FluidDivRCSIMD.xlsx