Skip to content

Commit 2dd456a

Browse files
committed
packed_tuple/crc32: test all implementations
1 parent 79ee3b6 commit 2dd456a

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

ydb/library/yql/minikql/comp_nodes/packed_tuple/packed_tuple_ut.cpp

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,10 @@ using namespace std::chrono_literals;
2626
static volatile bool IsVerbose = false;
2727
#define CTEST (IsVerbose ? Cerr : Cnull)
2828

29-
Y_UNIT_TEST_SUITE(TestHash) {
30-
31-
Y_UNIT_TEST(TestCalculateCRC32) {
32-
if (!NX86::HaveAVX2())
33-
return;
34-
35-
using TTraits = NSimd::TSimdAVX2Traits;
29+
namespace {
3630

31+
template <typename TTraits>
32+
void TestCalculateCRC32_Impl() {
3733
std::mt19937_64 rng; // fixed-seed (0) prng
3834
std::vector<ui64> v(1024);
3935
std::generate(v.begin(), v.end(), rng);
@@ -59,6 +55,28 @@ Y_UNIT_TEST(TestCalculateCRC32) {
5955
}
6056
}
6157

58+
Y_UNIT_TEST_SUITE(TestHash) {
59+
60+
Y_UNIT_TEST(TestCalculateCRC32Fallback) {
61+
TestCalculateCRC32_Impl<NSimd::TSimdFallbackTraits>();
62+
}
63+
64+
Y_UNIT_TEST(TestCalculateCRC32SSE42) {
65+
if (NX86::HaveSSE42())
66+
TestCalculateCRC32_Impl<NSimd::TSimdSSE42Traits>();
67+
else
68+
CTEST << "Skipped SSE42 test\n";
69+
}
70+
71+
Y_UNIT_TEST(TestCalculateCRC32AVX2) {
72+
if (NX86::HaveAVX2())
73+
TestCalculateCRC32_Impl<NSimd::TSimdAVX2Traits>();
74+
else
75+
CTEST << "Skipped AVX2 test\n";
76+
}
77+
78+
}
79+
6280
Y_UNIT_TEST_SUITE(TupleLayout) {
6381
Y_UNIT_TEST(CreateLayout) {
6482

0 commit comments

Comments
 (0)