[PATCH] D43045: Add NVPTX Support to ValidCPUList (enabling march notes)
Erich Keane via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 8 15:17:57 PST 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL324675: Add NVPTX Support to ValidCPUList (enabling march notes) (authored by erichkeane, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D43045?vs=133458&id=133508#toc
Repository:
rL LLVM
https://reviews.llvm.org/D43045
Files:
cfe/trunk/include/clang/Basic/Cuda.h
cfe/trunk/lib/Basic/Cuda.cpp
cfe/trunk/lib/Basic/Targets/NVPTX.cpp
cfe/trunk/lib/Basic/Targets/NVPTX.h
Index: cfe/trunk/lib/Basic/Cuda.cpp
===================================================================
--- cfe/trunk/lib/Basic/Cuda.cpp
+++ cfe/trunk/lib/Basic/Cuda.cpp
@@ -26,6 +26,8 @@
const char *CudaArchToString(CudaArch A) {
switch (A) {
+ case CudaArch::LAST:
+ break;
case CudaArch::UNKNOWN:
return "unknown";
case CudaArch::SM_20:
@@ -133,6 +135,8 @@
CudaVirtualArch VirtualArchForCudaArch(CudaArch A) {
switch (A) {
+ case CudaArch::LAST:
+ break;
case CudaArch::UNKNOWN:
return CudaVirtualArch::UNKNOWN;
case CudaArch::SM_20:
@@ -168,6 +172,8 @@
CudaVersion MinVersionForCudaArch(CudaArch A) {
switch (A) {
+ case CudaArch::LAST:
+ break;
case CudaArch::UNKNOWN:
return CudaVersion::UNKNOWN;
case CudaArch::SM_20:
Index: cfe/trunk/lib/Basic/Targets/NVPTX.cpp
===================================================================
--- cfe/trunk/lib/Basic/Targets/NVPTX.cpp
+++ cfe/trunk/lib/Basic/Targets/NVPTX.cpp
@@ -157,6 +157,8 @@
// Set __CUDA_ARCH__ for the GPU specified.
std::string CUDAArchCode = [this] {
switch (GPU) {
+ case CudaArch::LAST:
+ break;
case CudaArch::UNKNOWN:
assert(false && "No GPU arch when compiling CUDA device code.");
return "";
Index: cfe/trunk/lib/Basic/Targets/NVPTX.h
===================================================================
--- cfe/trunk/lib/Basic/Targets/NVPTX.h
+++ cfe/trunk/lib/Basic/Targets/NVPTX.h
@@ -98,6 +98,12 @@
return StringToCudaArch(Name) != CudaArch::UNKNOWN;
}
+ void fillValidCPUList(SmallVectorImpl<StringRef> &Values) const override {
+ for (int i = static_cast<int>(CudaArch::SM_20);
+ i < static_cast<int>(CudaArch::LAST); ++i)
+ Values.emplace_back(CudaArchToString(static_cast<CudaArch>(i)));
+ }
+
bool setCPU(const std::string &Name) override {
GPU = StringToCudaArch(Name);
return GPU != CudaArch::UNKNOWN;
Index: cfe/trunk/include/clang/Basic/Cuda.h
===================================================================
--- cfe/trunk/include/clang/Basic/Cuda.h
+++ cfe/trunk/include/clang/Basic/Cuda.h
@@ -46,6 +46,7 @@
SM_62,
SM_70,
SM_72,
+ LAST,
};
const char *CudaArchToString(CudaArch A);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43045.133508.patch
Type: text/x-patch
Size: 2247 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180208/abac0052/attachment.bin>
More information about the cfe-commits
mailing list