Page MenuHomePhabricator

[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

Unit TestsFailed

TimeTest
290 msx64 windows > LLVM.DebugInfo/X86::basic-block-sections-debug-loc-const-value-1.ll
Script: -- : 'RUN: at line 1'; c:\ws\w4\llvm-project\premerge-checks\build\bin\llc.exe C:\ws\w4\llvm-project\premerge-checks\llvm\test\DebugInfo\X86\basic-block-sections-debug-loc-const-value-1.ll --dwarf-version=4 --basic-block-sections=none -filetype=obj -o C:\ws\w4\llvm-project\premerge-checks\build\test\DebugInfo\X86\Output\basic-block-sections-debug-loc-const-value-1.ll.tmp
240 msx64 windows > LLVM.DebugInfo/X86::basic-block-sections-debug-loc-const-value-2.ll
Script: -- : 'RUN: at line 1'; c:\ws\w4\llvm-project\premerge-checks\build\bin\llc.exe C:\ws\w4\llvm-project\premerge-checks\llvm\test\DebugInfo\X86\basic-block-sections-debug-loc-const-value-2.ll --dwarf-version=4 --basic-block-sections=none -filetype=obj -o C:\ws\w4\llvm-project\premerge-checks\build\test\DebugInfo\X86\Output\basic-block-sections-debug-loc-const-value-2.ll.tmp
250 msx64 windows > LLVM.DebugInfo/X86::basic-block-sections-debug-loc-split-range.ll
Script: -- : 'RUN: at line 1'; c:\ws\w4\llvm-project\premerge-checks\build\bin\llc.exe C:\ws\w4\llvm-project\premerge-checks\llvm\test\DebugInfo\X86\basic-block-sections-debug-loc-split-range.ll --dwarf-version=4 --basic-block-sections=none -filetype=obj -o C:\ws\w4\llvm-project\premerge-checks\build\test\DebugInfo\X86\Output\basic-block-sections-debug-loc-split-range.ll.tmp
270 msx64 windows > LLVM.DebugInfo/X86::basic-block-sections-debug-loc.ll
Script: -- : 'RUN: at line 5'; c:\ws\w4\llvm-project\premerge-checks\build\bin\llc.exe C:\ws\w4\llvm-project\premerge-checks\llvm\test\DebugInfo\X86\basic-block-sections-debug-loc.ll --dwarf-version=4 --basic-block-sections=none -filetype=obj -o C:\ws\w4\llvm-project\premerge-checks\build\test\DebugInfo\X86\Output\basic-block-sections-debug-loc.ll.tmp
280 msx64 windows > LLVM.DebugInfo/X86::basic-block-sections-debug-loclist-1.ll
Script: -- : 'RUN: at line 1'; c:\ws\w4\llvm-project\premerge-checks\build\bin\llc.exe C:\ws\w4\llvm-project\premerge-checks\llvm\test\DebugInfo\X86\basic-block-sections-debug-loclist-1.ll --dwarf-version=4 --basic-block-sections=none -filetype=obj -o C:\ws\w4\llvm-project\premerge-checks\build\test\DebugInfo\X86\Output\basic-block-sections-debug-loclist-1.ll.tmp
View Full Test Results (9 Failed)

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