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 <[email protected]>
Gerrit-Reviewer: Alex Behm <[email protected]>
Gerrit-Reviewer: Jim Apple <[email protected]>
Gerrit-Reviewer: Marcel Kornacker <[email protected]>
Gerrit-Reviewer: Mostafa Mokhtar <[email protected]>
Gerrit-Reviewer: Tim Armstrong <[email protected]>
Gerrit-Reviewer: Youwei Wang <[email protected]>
Gerrit-HasComments: Yes

Reply via email to