This is an archive of the discontinued LLVM Phabricator instance.

[CUDA][HIP] Change default lang std to c++14
ClosedPublic

Authored by yaxunl on May 26 2021, 8:18 PM.

Details

Summary

Currently clang and nvcc use c++14 as default std for C++.
gcc 11 even uses c++17 as default std for C++. However,
clang uses c++98 as default std for CUDA/HIP.

As c++14 has been well adopted and became default for
clang, it seems reasonable to use c++14 as default std
for CUDA/HIP.

Diff Detail

Event Timeline

yaxunl created this revision.May 26 2021, 8:18 PM
yaxunl requested review of this revision.May 26 2021, 8:18 PM
tra accepted this revision.May 27 2021, 10:31 AM
This revision is now accepted and ready to land.May 27 2021, 10:31 AM
tra added inline comments.Jun 1 2021, 8:55 AM
clang/include/clang/Basic/LangStandards.def
196–197

It would make sense to bump C++ version for CUDA as well.

yaxunl updated this revision to Diff 349052.Jun 1 2021, 12:15 PM
yaxunl retitled this revision from [HIP] Change default lang std to c++14 to [CUDA][HIP] Change default lang std to c++14.
yaxunl edited the summary of this revision. (Show Details)

revised by Artem's comments, and fix tests

yaxunl marked an inline comment as done.Jun 1 2021, 12:17 PM
yaxunl added inline comments.
clang/include/clang/Basic/LangStandards.def
196–197

done

tra added inline comments.Jun 1 2021, 12:51 PM
clang/test/SemaCUDA/asm_delayed_diags.cu
31 ↗(On Diff #349052)

Perhaps we should just remove the register.
TBH, I'm not quite sure what this test is supposed to do for NVPTX -- t is not a register class in NVPTX nor does it seem to be a generic constraint.

I guess the idea was that we should ignore asm errors in the host code, while we're compiling for device. In that case, we certainly do not need register

yaxunl updated this revision to Diff 349080.Jun 1 2021, 1:12 PM
yaxunl marked an inline comment as done.

fix test

yaxunl marked an inline comment as done.Jun 1 2021, 1:12 PM
yaxunl added inline comments.
clang/test/SemaCUDA/asm_delayed_diags.cu
31 ↗(On Diff #349052)

removed register.

I think this test is for deferred diags.

tra accepted this revision.Jun 1 2021, 2:26 PM
This revision was landed with ongoing or failed builds.Jun 1 2021, 6:09 PM
This revision was automatically updated to reflect the committed changes.
yaxunl marked an inline comment as done.
Herald added a project: Restricted Project. · View Herald TranscriptJun 1 2021, 6:09 PM