20260115 applyWithType SVE implement#134
20260115 applyWithType SVE implement#134sugar-little-bit wants to merge 4 commits intobytedance:mainfrom
Conversation
| #include <type/Type.h> | ||
| #include <vector/ComplexVector.h> | ||
| #include <cstdint> | ||
| #include <arm_sve.h> |
There was a problem hiding this comment.
Is this file exist on x86 machines?
There was a problem hiding this comment.
No, the arm_sve.h header file does not exist on standard x86 machines, as it is specific to the ARM architecture. I will modify the code to be compatible with both arm64 and x86 architectures.
If the current architecture is x86, then follow the original logic.
| bits::forEachSetBit(rows.getBitData(), begin, end, func); | ||
| } | ||
| #else | ||
| rows.applyToSelected([&](int row) { result.set(row, hashSeed); }); |
There was a problem hiding this comment.
Under the x86 architecture, does this line of code become vectorized execution code?
There was a problem hiding this comment.
Sorry, it only work on ARM architecture.
There was a problem hiding this comment.
Sorry, it only works on ARM architecture.
emm, I can express it more clearly in another way. The code you added is about SIMD optimization for the ARM architecture. Did you notice that rows.applyToSelected([&](int row) { result.set(row, hashSeed); }); gets compiled into SIMD instructions on the X86 architecture but does not become SIMD instructions on the ARM architecture, so you made this optimization?
48f5dcf to
4feec6c
Compare
There was a problem hiding this comment.
It seems that a function with similar functionality already exists in bolt/vector/SelectivityVector.h:
const uint64_t* allBits() const {
return bits_.data();
}
There was a problem hiding this comment.
Ok, I have removed it.
What problem does this PR solve?
Issue Number: close #127
Type of Change
Description
Added SVE vectorized implement for bytedance::bolt::functions::sparksql::hash::applyWithType
Performance Impact
No Impact: This change does not affect the critical path (e.g., build system, doc, error handling).
Positive Impact: I have run benchmarks.
Click to view Benchmark Results
Negative Impact: Explained below (e.g., trade-off for correctness).
Release Note
Please describe the changes in this PR
Release Note:
Checklist (For Author)
Breaking Changes
No
Yes (Description: ...)
Click to view Breaking Changes