ARROW-8440: [C++] Refine SIMD header files#6954
ARROW-8440: [C++] Refine SIMD header files#6954cyb70289 wants to merge 4 commits intoapache:masterfrom cyb70289:simd
Conversation
|
cc @jianxind |
frankdjx
left a comment
There was a problem hiding this comment.
I like the ideal to has one unified SIMD head file for all ARCH. Cool.
There was a problem hiding this comment.
I personally prefer to keep the NONE(zero) level here though it may duplicate to ARROW_USE_SIMD. Level usually start from zero.
There was a problem hiding this comment.
Thanks for review. NONE restored.
|
I thought we had discussed removing the |
@wesm remove |
|
Maybe it was just a thought I had in my head but never expressed. Opened https://issues.apache.org/jira/browse/ARROW-8531 |
Updated this patch to remove ARROW_USE_SIMD |
There was a problem hiding this comment.
I guess it should be SSE4_2 as it's the default option. ARROW_USE_SIMD is on as default also. Or just rm the cmake-extras?
There was a problem hiding this comment.
The context is to show how to pass extra cmake flags. Default value looks not very useful. Maybe change to AVX2?
There was a problem hiding this comment.
Get it, then ARROW_SIMD_LEVEL=NONE is fine:)
cpp/src/arrow/util/hash_util.h
Outdated
There was a problem hiding this comment.
How about moving this part into simd.h? We can reduce the number of places that depends on the target hardware.
There was a problem hiding this comment.
Also, regardless of whether we move them or not, you should put them in the arrow::internal namespace.
There was a problem hiding this comment.
I'd be concerned about putting too much in SIMD directly. If we expect these to be used in other places that don't depend on this header we should create a specific header targetted at hardware. digests/hashing. I think the way bit_util.h wraps special instructions is a reasonable path to follow.
|
Is the function |
pitrou
left a comment
There was a problem hiding this comment.
Thank you for doing this. This looks like a good idea.
cpp/src/arrow/util/hash_util.h
Outdated
There was a problem hiding this comment.
Also, regardless of whether we move them or not, you should put them in the arrow::internal namespace.
|
cc @emkornfield |
It's not used. Actually the whole file hash_util.h is not used per this comment. From git I'm glad to remove this file if community think it's ok. |
cpp/src/arrow/util/hash_util.h
Outdated
There was a problem hiding this comment.
style nits: If possible les spell out the type instead of using auto (its not all clear what the types are without looking up these exact functions.
Since these are functions, it would be nice to use standard function casing for them. e.g. Crc32U16, even better might be to define something like:
HardwareCrc(uint16) ..
HardwareCrc(uint16) ..
cpp/src/arrow/util/simd.h
Outdated
There was a problem hiding this comment.
Just an FYI in #6985 relies on BMI2 do you think adding that here would be appropriate?
Sorry I missed this, I think we can probably remove these for now (we can always reinstate from git history if needed). Parquet CRC uses standard CRC32 and at least for intel, the intrinsic does CRC32C. This might be useful for digests for Arrow File/Stream but that hasn't been approved by the community yet. |
- Include all necessary SIMD header files in a single header "simd.h". - Simplify architecture dependent CRC code in hash_util.h. - Remove SSEUtil namespace which contains some SSE constants. These codes are not used and I can't find proper place to hold them. - Remove sse_util.h and neon_util.h. - Remove ARROW_SIMD_LEVEL=NONE which duplicates ARROW_USE_SIMD=OFF.
@kiszk @emkornfield @pitrou , removed hash_util.h, easiest path for me :) , we can pick it back and refine per actual use case if it will be used in future. |
pitrou
left a comment
There was a problem hiding this comment.
+1, LGTM. @emkornfield, do you have further comments on this PR? Otherwise I think we can merge.
|
Nothing more from me |
These codes are not used and I can't find proper place to hold them.