-
Notifications
You must be signed in to change notification settings - Fork 3.7k
GH-46172: [C++] Add SIMD support in Meson configuration #46173
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
base: main
Are you sure you want to change the base?
Conversation
|
Note that there are also SIMD modules to be used in the compute and acero directories, but those are not in main yet I noticed that the CSV module also uses some macros around SSE4 and Neon detection, but does not use the separate module approach that is used here (see arrow/csv/lexing_internal.h). I have not looked into that too deeply; it may require a refactor to work nicely with Meson's SIMD assumptions |
@github-actions crossbow submit *meson |
Revision: 607154b Submitted crossbow builds: ursacomputing/crossbow @ actions-830ec7104c
|
cpp/src/arrow/meson.build
Outdated
@@ -227,6 +230,26 @@ arrow_testing_srcs = [ | |||
'testing/util.cc', | |||
] | |||
|
|||
simd = import('unstable-simd') | |||
rval = simd.check( |
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.
Can we use better variable name than rval
?
arrow_simd_defines = [] | ||
|
||
if simd_configuration.has('HAVE_AVX2') | ||
arrow_simd_defines += ['-DARROW_HAVE_RUNTIME_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.
Do we need to define ARROW_HAVE_AVX2
,ARROW_HAVE_SSE4_2
and so on?
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.
Ah my mistake - I didn't realize we had both ARROW_HAVE_AVX2
and ARROW_HAVE_RUNTIME_AVX2
; I am pretty new to SIMD so that distinction isn't yet clear to me, but yes we can go ahead and add.
It's also worth noting that the Meson SIMD check adds defines like HAVE_AVX2
through this object when that instruction set is supported. Not something we would change the mainline code for today, but in the long run that might help us simplify the macro usage
607154b
to
32159dd
Compare
Rationale for this change
This gets the Meson configuration closer to feature parity with CMake
What changes are included in this PR?
Adds SIMD support to the top level arrow library
Are these changes tested?
Yes
Are there any user-facing changes?
No