impala-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Youwei Wang (Code Review)" <ger...@cloudera.org>
Subject [Impala-CR](cdh5-trunk) IMPALA-2809: Improve ByteSwap with builtin function or SSSE3 or AVX2.
Date Mon, 11 Jul 2016 07:51:50 GMT
Youwei Wang has posted comments on this change.

Change subject: IMPALA-2809: Improve ByteSwap with builtin function or SSSE3 or AVX2.
......................................................................


Patch Set 30:

(5 comments)

http://gerrit.cloudera.org:8080/#/c/3081/28/be/src/util/bit-util-test.cc
File be/src/util/bit-util-test.cc:

Line 169:   EXPECT_EQ(BitUtil::ByteSwap(static_cast<uint32_t>(0)), 0);
> This doesn't look done to me. In the AVX case, it looks like only  SSSE3 co
Done


http://gerrit.cloudera.org:8080/#/c/3081/29/be/src/util/bit-util-test.cc
File be/src/util/bit-util-test.cc:

Line 99: //   CpuInfo::AVX2 for ByteSwapAVX2_Unit;
> In our codebase, function parameters are explained before the function name
Done


PS29, Line 106: 
BTW, Code: ASSERT_EQ(CpuFlag, CpuInfo::AVX2);
will not compile and generate following error:
/root/Impala/be/src/util/bit-util-test.cc:109: undefined reference to `impala::CpuInfo::AVX2'.


However, Code:
static const int64_t AVX2_MASK = CpuInfo::AVX2;
ASSERT_EQ(CpuFlag, AVX2_MASK);
will compile flawlessly.


Line 106:   } else {
> ASSERT_EQ, not 'else if', since there is no other choice.
Hi Jim. 
The parameter "CpuFlag" for this function has only two options: CpuInfo::SSSE3 or CpuInfo::AVX2.
However, "CpuFlag" for the function TestByteswapSimd has three options: CpuInfo::SSSE3 or
CpuInfo::AVX2 or 0. It is reasonable to use ASSERT_EQ to verify the value of "CpuFlag" in
the else branch here. But it is not this case for TestByteswapSimd.
As for TestByteswapSimd, if "CpuFlag" is not CpuInfo::SSSE3 or CpuInfo::AVX2, the variable
start_size will keep 0, which means we want a black box test there, as described like this:
// CpuFlag == 0: test the internal logic of BitUtil::ByteSwap
Thank you.


http://gerrit.cloudera.org:8080/#/c/3081/29/be/src/util/bit-util.inline.h
File be/src/util/bit-util.inline.h:

Line 166
> Please don't pollute the impala namespace with a typedef with a name this g
Done


-- 
To view, visit http://gerrit.cloudera.org:8080/3081
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I392ed5a8d5683f30f161282c228c1aedd7b648c1
Gerrit-PatchSet: 30
Gerrit-Project: Impala
Gerrit-Branch: cdh5-trunk
Gerrit-Owner: Youwei Wang <youwei.a.wang@intel.com>
Gerrit-Reviewer: Alex Behm <alex.behm@cloudera.com>
Gerrit-Reviewer: Jim Apple <jbapple@cloudera.com>
Gerrit-Reviewer: Marcel Kornacker <marcel@cloudera.com>
Gerrit-Reviewer: Mostafa Mokhtar <mmokhtar@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <tarmstrong@cloudera.com>
Gerrit-Reviewer: Youwei Wang <youwei.a.wang@intel.com>
Gerrit-HasComments: Yes

Mime
View raw message