[clang] 1fcf924 - [Cuda] Internalize a struct and a global variable
Fangrui Song via cfe-commits
cfe-commits at lists.llvm.org
Sat May 1 16:24:45 PDT 2021
Author: Fangrui Song
Date: 2021-05-01T16:24:39-07:00
New Revision: 1fcf9247de05bfd960a35c691b9cc47b6a94cd2b
URL: https://github.com/llvm/llvm-project/commit/1fcf9247de05bfd960a35c691b9cc47b6a94cd2b
DIFF: https://github.com/llvm/llvm-project/commit/1fcf9247de05bfd960a35c691b9cc47b6a94cd2b.diff
LOG: [Cuda] Internalize a struct and a global variable
Added:
Modified:
clang/lib/Basic/Cuda.cpp
Removed:
################################################################################
diff --git a/clang/lib/Basic/Cuda.cpp b/clang/lib/Basic/Cuda.cpp
index 29c09915f631a..da3bbe110d107 100644
--- a/clang/lib/Basic/Cuda.cpp
+++ b/clang/lib/Basic/Cuda.cpp
@@ -57,18 +57,20 @@ CudaVersion CudaStringToVersion(const llvm::Twine &S) {
.Default(CudaVersion::UNKNOWN);
}
+namespace {
struct CudaArchToStringMap {
CudaArch arch;
const char *arch_name;
const char *virtual_arch_name;
};
+} // namespace
#define SM2(sm, ca) \
{ CudaArch::SM_##sm, "sm_" #sm, ca }
#define SM(sm) SM2(sm, "compute_" #sm)
#define GFX(gpu) \
{ CudaArch::GFX##gpu, "gfx" #gpu, "compute_amdgcn" }
-CudaArchToStringMap arch_names[] = {
+static const CudaArchToStringMap arch_names[] = {
// clang-format off
{CudaArch::UNUSED, "", ""},
SM2(20, "compute_20"), SM2(21, "compute_20"), // Fermi
More information about the cfe-commits
mailing list