From 632f35d495a42514eaf26468beceae923e813997 Mon Sep 17 00:00:00 2001 From: Tim Renouf Date: Wed, 24 Oct 2018 21:19:02 +0000 Subject: [PATCH] Add gfx909 to GPU Arch Subscribers: jholewinski, cfe-commits Differential Revision: https://reviews.llvm.org/D53558 llvm-svn: 345198 --- clang/include/clang/Basic/Cuda.h | 1 + clang/lib/Basic/Cuda.cpp | 5 +++++ clang/lib/Basic/Targets/NVPTX.cpp | 1 + 3 files changed, 7 insertions(+) diff --git a/clang/include/clang/Basic/Cuda.h b/clang/include/clang/Basic/Cuda.h index b11967f..0575e70 100644 --- a/clang/include/clang/Basic/Cuda.h +++ b/clang/include/clang/Basic/Cuda.h @@ -64,6 +64,7 @@ enum class CudaArch { GFX902, GFX904, GFX906, + GFX909, LAST, }; const char *CudaArchToString(CudaArch A); diff --git a/clang/lib/Basic/Cuda.cpp b/clang/lib/Basic/Cuda.cpp index 718e136..6c34856 100644 --- a/clang/lib/Basic/Cuda.cpp +++ b/clang/lib/Basic/Cuda.cpp @@ -94,6 +94,8 @@ const char *CudaArchToString(CudaArch A) { return "gfx904"; case CudaArch::GFX906: // TBA return "gfx906"; + case CudaArch::GFX909: // TBA + return "gfx909"; } llvm_unreachable("invalid enum"); } @@ -130,6 +132,7 @@ CudaArch StringToCudaArch(llvm::StringRef S) { .Case("gfx902", CudaArch::GFX902) .Case("gfx904", CudaArch::GFX904) .Case("gfx906", CudaArch::GFX906) + .Case("gfx909", CudaArch::GFX909) .Default(CudaArch::UNKNOWN); } @@ -241,6 +244,7 @@ CudaVirtualArch VirtualArchForCudaArch(CudaArch A) { case CudaArch::GFX902: case CudaArch::GFX904: case CudaArch::GFX906: + case CudaArch::GFX909: return CudaVirtualArch::COMPUTE_AMDGCN; } llvm_unreachable("invalid enum"); @@ -287,6 +291,7 @@ CudaVersion MinVersionForCudaArch(CudaArch A) { case CudaArch::GFX902: case CudaArch::GFX904: case CudaArch::GFX906: + case CudaArch::GFX909: return CudaVersion::CUDA_70; } llvm_unreachable("invalid enum"); diff --git a/clang/lib/Basic/Targets/NVPTX.cpp b/clang/lib/Basic/Targets/NVPTX.cpp index 7dd344b..ca41c4d 100644 --- a/clang/lib/Basic/Targets/NVPTX.cpp +++ b/clang/lib/Basic/Targets/NVPTX.cpp @@ -190,6 +190,7 @@ void NVPTXTargetInfo::getTargetDefines(const LangOptions &Opts, case CudaArch::GFX902: case CudaArch::GFX904: case CudaArch::GFX906: + case CudaArch::GFX909: case CudaArch::LAST: break; case CudaArch::UNKNOWN: -- 2.7.4