Skip to content

core:test Expand hal_intrin tests to support SIMD256 - #12056

Merged
opencv-pushbot merged 1 commit into
opencv:3.4from
seiko2plus:coreExpandTests
Jul 30, 2018
Merged

opencv-pushbot merged 1 commit into
opencv:3.4from
seiko2plus:coreExpandTests

Conversation

@seiko2plus

@seiko2plus seiko2plus commented Jul 24, 2018 •

Copy link
Copy Markdown
Contributor

Expand hal_intrin tests to support SIMD256

force_builders=Custom,armv7,armv8
docker_image:Custom=powerpc64le
pw_compilers=gcc-4.9, gcc-5, gcc-6

@seiko2plus
seiko2plus force-pushed the coreExpandTests branch 5 times, most recently from 3f3c3ff to b5008af Compare July 25, 2018 11:52

@alalek alalek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job!

case 16: return v_uint8x32(swap);
}
if (imm == 0) return a;
if (imm == 32) return b;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two "if" lines can be moved before "swap" variable declaration.

Similar note for code below (move 1-2 lines).

CV_INTRIN_DEFINE_WIDE_INTRIN_ALL_TYPES(v256)
CV_INTRIN_DEFINE_WIDE_INTRIN(double, v_float64, f64, v256, load)
inline void vx_cleanup() { v256_cleanup(); }
#elif CV_SIMD128

@alalek alalek Jul 26, 2018 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-#elif CV_SIMD128
+#elif CV_SIMD128 || CV_SIMD128_CPP

Right (similar to line 261).

We need this.
Not all covered by tests, so we should have ability to disable using of H/W intrinsics and check our "vectorized" code via RAW C++ implementation (slow, but we checking correctness in this mode)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, we only need to fallback into dummy types and dummy intrinsics just for template programming and also dispatching simd128 intrin tests.
However we need this for now to avoid compiling errors for non-simd optimizations.

Comment thread modules/core/test/test_intrin.avx2.cpp Outdated
namespace opencv_test { namespace hal {
using namespace CV_CPU_OPTIMIZATION_NAMESPACE;

TEST(hal_intrin256, uint8x32)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is "dead" test for non-AVX2 machines - any code from this file should not be called there.

Test declaration (via TEST()) and dispatching should be done outside of this function. See "FP16" test:

    CV_CPU_CALL_FP16_(test_hal_intrin_float16, ());
    throw SkipTestException("Unsupported hardware: FP16 is not available");

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accidentally rebase removed the last changes, I think its fine now .. thank you once again

@seiko2plus
seiko2plus force-pushed the coreExpandTests branch 2 times, most recently from be2d725 to 850df55 Compare July 29, 2018 15:34
@seiko2plus
seiko2plus force-pushed the coreExpandTests branch 3 times, most recently from 9788b77 to 4825ef1 Compare July 29, 2018 19:53

@alalek alalek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Thank you 👍

@opencv-pushbot
opencv-pushbot merged commit 6499263 into opencv:3.4 Jul 30, 2018
@alalek alalek mentioned this pull request Jul 31, 2018
SavyaSanchi-Sharma pushed a commit to SavyaSanchi-Sharma/opencv that referenced this pull request Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants