Skip to content
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

GH-44249: [C++] Unify simd header includings #44250

Merged
merged 3 commits into from
Oct 2, 2024

Conversation

zanmato1984
Copy link
Collaborator

@zanmato1984 zanmato1984 commented Sep 29, 2024

Rationale for this change

#44249

What changes are included in this PR?

Change all the system header inclusions to simd.h.

Also removed some duplicated defines.

Are these changes tested?

Existing tests should be good.

Are there any user-facing changes?

None.

Copy link

⚠️ GitHub issue #44249 has been automatically assigned in GitHub to PR creator.

@zanmato1984
Copy link
Collaborator Author

Hi @pitrou , what do you think if we do this? And if you agree with this change, shall we move forward to add some lint rules to forbid system simd header including?

Thanks.

@zanmato1984
Copy link
Collaborator Author

@github-actions crossbow submit -g cpp

Copy link

Revision: d202127

Submitted crossbow builds: ursacomputing/crossbow @ actions-1cab231bec

Task Status
example-cpp-minimal-build-static GitHub Actions
example-cpp-minimal-build-static-system-dependency GitHub Actions
example-cpp-tutorial GitHub Actions
test-alpine-linux-cpp GitHub Actions
test-build-cpp-fuzz GitHub Actions
test-conda-cpp GitHub Actions
test-conda-cpp-valgrind GitHub Actions
test-cuda-cpp-ubuntu-20.04-cuda-11.2.2 GitHub Actions
test-cuda-cpp-ubuntu-22.04-cuda-11.7.1 GitHub Actions
test-debian-12-cpp-amd64 GitHub Actions
test-debian-12-cpp-i386 GitHub Actions
test-fedora-39-cpp GitHub Actions
test-ubuntu-20.04-cpp GitHub Actions
test-ubuntu-20.04-cpp-bundled GitHub Actions
test-ubuntu-20.04-cpp-minimal-with-formats GitHub Actions
test-ubuntu-22.04-cpp GitHub Actions
test-ubuntu-22.04-cpp-20 GitHub Actions
test-ubuntu-22.04-cpp-emscripten GitHub Actions
test-ubuntu-22.04-cpp-no-threading GitHub Actions
test-ubuntu-24.04-cpp GitHub Actions
test-ubuntu-24.04-cpp-gcc-13-bundled GitHub Actions
test-ubuntu-24.04-cpp-gcc-14 GitHub Actions
test-ubuntu-24.04-cpp-thread-sanitizer GitHub Actions

Comment on lines +702 to +706
'immintrin.h',
'intrin.h',
'nmmintrin.h',
'x86intrin.h',
'xmmintrin.h',
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically not related to the purpose of this change. Just saw it and fixed.

@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Sep 29, 2024
cpp/src/arrow/compute/key_hash_internal.h Show resolved Hide resolved
cpp/src/arrow/util/macros.h Outdated Show resolved Hide resolved
@zanmato1984
Copy link
Collaborator Author

And if you agree with this change, shall we move forward to add some lint rules to forbid system simd header including?

Thanks for looking at this @pitrou , much appreciated! And what do you think about this? The lint rule seems not trivial so I want to check with you first.

@pitrou
Copy link
Member

pitrou commented Oct 1, 2024

And if you agree with this change, shall we move forward to add some lint rules to forbid system simd header including?

Thanks for looking at this @pitrou , much appreciated! And what do you think about this? The lint rule seems not trivial so I want to check with you first.

We could, yes, though I'm not sure how useful that would be. What would be the rationale?

@zanmato1984
Copy link
Collaborator Author

And if you agree with this change, shall we move forward to add some lint rules to forbid system simd header including?

Thanks for looking at this @pitrou , much appreciated! And what do you think about this? The lint rule seems not trivial so I want to check with you first.

We could, yes, though I'm not sure how useful that would be. What would be the rationale?

Right. After a second thought, I think the rational is not strong enough. One reason is that it doesn't really hurt anything if one uses system headers directly (except that one will have to write own platform-specific checking code) so maybe we shouldn't mandate that. The other is that intrinsics are not all simd related so requiring including simd.h (as opposed to including system intrinsic headers) for cases otherwise (like what we did for querying hardware flags) doesn't make much sense.

Let's just forget it for now. Thanks for reminding.

@pitrou
Copy link
Member

pitrou commented Oct 2, 2024

The remaining CI failure is unrelated, thanks a lot @zanmato1984 !

@pitrou pitrou merged commit 60f29e9 into apache:main Oct 2, 2024
45 of 46 checks passed
@pitrou pitrou removed the awaiting committer review Awaiting committer review label Oct 2, 2024
Copy link

After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 60f29e9.

There was 1 benchmark result indicating a performance regression:

The full Conbench report has more details. It also includes information about 6 possible false positives for unstable benchmarks that are known to sometimes produce them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants