HappenLee commented on a change in pull request #6089:
URL: https://github.com/apache/incubator-doris/pull/6089#discussion_r657664504
##########
File path: be/src/util/bit_util.h
##########
@@ -300,6 +300,11 @@ class BitUtil {
return (value + (factor - 1)) & ~(factor - 1);
}
+ // speed up function compute for SIMD
+ static inline size_t RoundUpToPowerOf2Int32(size_t value, size_t factor) {
+ return (value + (factor - 1)) & ~(factor - 1);
Review comment:
1. keypoint is `inline`.
GCC can do auto SIMD in this `for loop`:
` auto mem_size = 0;
for (int i = 0; i < max_fetch; ++i) {
mem_len[i] = (value + (8 - 1)) & ~(8 - 1);
mem_size += mem_len[i];
}
`
2. I will Add DCHECK here
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]