Skip to content

Commit 0494e2b

Browse files
committed
bump default SM for CUDA to 75
1 parent 0ff23e8 commit 0494e2b

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

clang/include/clang/Basic/OffloadArch.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ enum class OffloadArch {
167167
LNL_M,
168168
LAST,
169169

170-
CudaDefault = OffloadArch::SM_52,
170+
CudaDefault = OffloadArch::SM_75,
171171
HIPDefault = OffloadArch::GFX906,
172172
};
173173

clang/lib/Driver/Driver.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5927,11 +5927,11 @@ class OffloadingActionBuilder final {
59275927

59285928
// Handle defaults architectures
59295929
for (auto &Triple : SYCLTripleList) {
5930-
// For NVIDIA use SM_50 as a default
5930+
// For NVIDIA use SM_75 as a default
59315931
if (Triple.isNVPTX() && llvm::none_of(GpuArchList, [&](auto &P) {
59325932
return P.first.isNVPTX();
59335933
})) {
5934-
const char *DefaultArch = OffloadArchToString(OffloadArch::SM_50);
5934+
const char *DefaultArch = OffloadArchToString(OffloadArch::SM_75);
59355935
GpuArchList.emplace_back(Triple, DefaultArch);
59365936
}
59375937

@@ -7650,7 +7650,7 @@ Driver::getOffloadArchs(Compilation &C, const llvm::opt::DerivedArgList &Args,
76507650
// The default arch is set for NVPTX if not provided. For AMDGPU, emit
76517651
// an error as the user is responsible to set the arch.
76527652
if (TC.getTriple().isNVPTX())
7653-
Archs.insert(OffloadArchToString(OffloadArch::SM_50));
7653+
Archs.insert(OffloadArchToString(OffloadArch::SM_75));
76547654
else if (TC.getTriple().isAMDGPU())
76557655
C.getDriver().Diag(clang::diag::err_drv_sycl_missing_amdgpu_arch)
76567656
<< 1 << TC.getTriple().str();

libdevice/cmake/modules/SYCLLibdevice.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ set(imf_build_archs)
9797
if ("NVPTX" IN_LIST LLVM_TARGETS_TO_BUILD)
9898
list(APPEND full_build_archs nvptx64-nvidia-cuda)
9999
set(compile_opts_nvptx64-nvidia-cuda "-fsycl-targets=nvptx64-nvidia-cuda"
100-
"-Xsycl-target-backend" "--cuda-gpu-arch=sm_50" "-nocudalib" "-fno-sycl-libspirv" "-Wno-unsafe-libspirv-not-linked")
100+
"-Xsycl-target-backend" "--cuda-gpu-arch=sm_75" "-fno-sycl-libspirv" "-Wno-unsafe-libspirv-not-linked")
101101
set(opt_flags_nvptx64-nvidia-cuda "-O3" "--nvvm-reflect-enable=false")
102102
endif()
103103
if("AMDGPU" IN_LIST LLVM_TARGETS_TO_BUILD)

sycl-jit/jit-compiler/lib/translation/Translation.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,13 +197,14 @@ std::pair<std::string, std::string> Translator::getTargetCPUAndFeatureAttrs(
197197
if (CPU.empty()) {
198198
// Set to the lowest tested target according to the GetStartedGuide, section
199199
// "Build DPC++ toolchain with support for HIP AMD"
200-
CPU = Format == BinaryFormat::AMDGCN ? "gfx90a" : "sm_50";
200+
CPU = Format == BinaryFormat::AMDGCN ? "gfx90a" : "sm_75";
201201
if (KernelFunc && KernelFunc->hasFnAttribute(TARGET_CPU_ATTRIBUTE)) {
202202
CPU = KernelFunc->getFnAttribute(TARGET_CPU_ATTRIBUTE).getValueAsString();
203203
}
204204
}
205205
if (Features.empty()) {
206-
Features = Format == BinaryFormat::PTX ? "+sm_50,+ptx76" : "";
206+
// Turing architecture + PTX 6.3
207+
Features = Format == BinaryFormat::PTX ? "+sm_75,+ptx63" : "";
207208
if (KernelFunc && KernelFunc->hasFnAttribute(TARGET_FEATURE_ATTRIBUTE)) {
208209
Features = KernelFunc->getFnAttribute(TARGET_FEATURE_ATTRIBUTE)
209210
.getValueAsString();

sycl/doc/GetStartedGuide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ extensions that require sm_80 and later architectures also require at least CUDA
198198
11.0.
199199

200200
The CUDA backend should work on Windows or Linux operating systems with any GPU
201-
with compute capability (SM version) sm_50 or above. The default SM version for
202-
the NVIDIA CUDA backend is sm_50. Users of sm_3X devices can attempt to specify
201+
with compute capability (SM version) sm_75 or above. The default SM version for
202+
the NVIDIA CUDA backend is sm_75. Users of sm_3X devices can attempt to specify
203203
the target architecture [ahead of time](#aot-target-architectures), provided
204204
that they use a 11.X or earlier CUDA toolkit version, but some features may not be
205205
supported. The CUDA backend has been tested with different Ubuntu Linux

0 commit comments

Comments
 (0)