-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-8440: [C++] Refine SIMD header files #6954
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
cc @jianxind |
frankdjx
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the ideal to has one unified SIMD head file for all ARCH. Cool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get it, then ARROW_SIMD_LEVEL=NONE is fine:)
cpp/src/arrow/util/hash_util.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just an FYI in #6985 relies on BMI2 do you think adding that here would be appropriate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I think so
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+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.