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

ARROW-17567: [C++] Avoid internal compiler error with gcc 7 and c++17 #14004

Merged
merged 4 commits into from
Aug 30, 2022

Conversation

js8544
Copy link
Collaborator

@js8544 js8544 commented Aug 30, 2022

The current compute kernel fails to compile with gcc6/7 and c++14/17, due to a known bug of gcc. It is triggered when a const integer is capture by reference in a lambda function, and is parenthesized in that lambda code. Capturing the const ints by value fixes this issue.

See also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83204 and kokkos/kokkos-kernels#349

@github-actions
Copy link

@pitrou
Copy link
Member

pitrou commented Aug 30, 2022

Thanks @js8544 . I was actually trying to deal with this in #13991 but I'm glad you found an adequate workaround (and a detailed explanation).

@pitrou pitrou changed the title ARROW-17567:[C++] Fix compute compilation with gcc7 and c++17 ARROW-17567: [C++] Avoid internal compiler error with gcc 7 and c++17 Aug 30, 2022
@pitrou
Copy link
Member

pitrou commented Aug 30, 2022

Capturing the const ints by value fixs this issue and is a performance improvement.

I don't really believe the performance improvement claim (do you have any benchmark numbers?), but it's fine as a workaround.

@js8544
Copy link
Collaborator Author

js8544 commented Aug 30, 2022

Capturing the const ints by value fixs this issue and is a performance improvement.

I don't really believe the performance improvement claim (do you have any benchmark numbers?), but it's fine as a workaround.

@pitrou You are right. I should have said "this workaround won't harm anything" rather than calling it an improvement.

Co-authored-by: Antoine Pitrou <pitrou@free.fr>
@pitrou pitrou merged commit e48afd6 into apache:master Aug 30, 2022
@ursabot
Copy link

ursabot commented Aug 30, 2022

Benchmark runs are scheduled for baseline = 93b63e8 and contender = e48afd6. e48afd6 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Finished ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Failed] test-mac-arm
[Failed ⬇️0.0% ⬆️0.0%] ursa-i9-9960x
[Finished ⬇️0.71% ⬆️0.07%] ursa-thinkcentre-m75q
Buildkite builds:
[Finished] e48afd67 ec2-t3-xlarge-us-east-2
[Failed] e48afd67 test-mac-arm
[Failed] e48afd67 ursa-i9-9960x
[Finished] e48afd67 ursa-thinkcentre-m75q
[Finished] 93b63e8f ec2-t3-xlarge-us-east-2
[Failed] 93b63e8f test-mac-arm
[Failed] 93b63e8f ursa-i9-9960x
[Finished] 93b63e8f ursa-thinkcentre-m75q
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

@ursabot
Copy link

ursabot commented Aug 30, 2022

['Python', 'R'] benchmarks have high level of regressions.
ursa-i9-9960x

anjakefala pushed a commit to anjakefala/arrow that referenced this pull request Aug 31, 2022
…apache#14004)

The current compute kernel fails to compile with gcc6/7 and c++14/17, due to a known bug of gcc. It is triggered when a const integer is capture by reference in a lambda function, and is parenthesized in that lambda code. Capturing the const ints by value fixes this issue.

See also:  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83204 and kokkos/kokkos-kernels#349

Lead-authored-by: Jin Shang <shangjin1997@gmail.com>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
Co-authored-by: jinshang <jinshang@tencent.com>
Signed-off-by: Antoine Pitrou <antoine@python.org>
zagto pushed a commit to zagto/arrow that referenced this pull request Oct 7, 2022
…apache#14004)

The current compute kernel fails to compile with gcc6/7 and c++14/17, due to a known bug of gcc. It is triggered when a const integer is capture by reference in a lambda function, and is parenthesized in that lambda code. Capturing the const ints by value fixes this issue.

See also:  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83204 and kokkos/kokkos-kernels#349

Lead-authored-by: Jin Shang <shangjin1997@gmail.com>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
Co-authored-by: jinshang <jinshang@tencent.com>
Signed-off-by: Antoine Pitrou <antoine@python.org>
@js8544 js8544 deleted the jinshang/fix_gcc7_c++17_compile branch October 11, 2022 08:42
fatemehp pushed a commit to fatemehp/arrow that referenced this pull request Oct 17, 2022
…apache#14004)

The current compute kernel fails to compile with gcc6/7 and c++14/17, due to a known bug of gcc. It is triggered when a const integer is capture by reference in a lambda function, and is parenthesized in that lambda code. Capturing the const ints by value fixes this issue.

See also:  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83204 and kokkos/kokkos-kernels#349

Lead-authored-by: Jin Shang <shangjin1997@gmail.com>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
Co-authored-by: jinshang <jinshang@tencent.com>
Signed-off-by: Antoine Pitrou <antoine@python.org>
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.

3 participants