Skip to content

Commit ab202aa

Browse files
committed
[Clang] Increase default architecture from sm_35 to sm_52
We previously defaulted to `sm_35` for the purpose of unspecified architecture. This was removed in new CUDA versions so we should bump this up. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D156936
1 parent 54bda79 commit ab202aa

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

clang/include/clang/Basic/Cuda.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ enum class CudaArch {
117117
// public one.
118118
LAST,
119119

120-
CudaDefault = CudaArch::SM_35,
120+
CudaDefault = CudaArch::SM_52,
121121
HIPDefault = CudaArch::GFX803,
122122
};
123123

clang/test/Driver/cuda-cross-compiling.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@
6565
// RUN: %clang --target=nvptx64-nvidia-cuda -### --cuda-path=%S/Inputs/CUDA/usr/local/cuda %s 2>&1 \
6666
// RUN: | FileCheck -check-prefix=DEFAULT %s
6767

68-
// DEFAULT: -cc1" "-triple" "nvptx64-nvidia-cuda" "-S" {{.*}} "-target-cpu" "sm_35" "-target-feature" "+ptx{{[0-9]+}}" {{.*}} "-o" "[[PTX:.+]].s"
69-
// DEFAULT-NEXT: ptxas{{.*}}"-m64" "-O0" "--gpu-name" "sm_35" "--output-file" "[[CUBIN:.+]].cubin" "[[PTX]].s" "-c"
70-
// DEFAULT-NEXT: nvlink{{.*}}"-o" "a.out" "-arch" "sm_35" {{.*}} "[[CUBIN]].cubin"
68+
// DEFAULT: -cc1" "-triple" "nvptx64-nvidia-cuda" "-S" {{.*}} "-target-cpu" "sm_52" "-target-feature" "+ptx{{[0-9]+}}" {{.*}} "-o" "[[PTX:.+]].s"
69+
// DEFAULT-NEXT: ptxas{{.*}}"-m64" "-O0" "--gpu-name" "sm_52" "--output-file" "[[CUBIN:.+]].cubin" "[[PTX]].s" "-c"
70+
// DEFAULT-NEXT: nvlink{{.*}}"-o" "a.out" "-arch" "sm_52" {{.*}} "[[CUBIN]].cubin"
7171

7272
//
7373
// Test to ensure that we enable handling global constructors in a freestanding

0 commit comments

Comments
 (0)