diff options
Diffstat (limited to 'clang/include/clang/Driver/Action.h')
-rw-r--r-- | clang/include/clang/Driver/Action.h | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/clang/include/clang/Driver/Action.h b/clang/include/clang/Driver/Action.h index 81d3f3331fd..c54a2a4195a 100644 --- a/clang/include/clang/Driver/Action.h +++ b/clang/include/clang/Driver/Action.h @@ -10,6 +10,7 @@ #ifndef LLVM_CLANG_DRIVER_ACTION_H #define LLVM_CLANG_DRIVER_ACTION_H +#include "clang/Basic/Cuda.h" #include "clang/Driver/Types.h" #include "clang/Driver/Util.h" #include "llvm/ADT/SmallVector.h" @@ -157,26 +158,22 @@ public: class CudaDeviceAction : public Action { virtual void anchor(); - /// GPU architecture to bind. Always of the form /sm_\d+/ or null (when the - /// action applies to multiple architectures). - const char *GpuArchName; + + const CudaArch GpuArch; + /// True when action results are not consumed by the host action (e.g when /// -fsyntax-only or --cuda-device-only options are used). bool AtTopLevel; public: - CudaDeviceAction(Action *Input, const char *ArchName, bool AtTopLevel); + CudaDeviceAction(Action *Input, CudaArch Arch, bool AtTopLevel); - const char *getGpuArchName() const { return GpuArchName; } - - /// Gets the compute_XX that corresponds to getGpuArchName(). Returns null - /// when getGpuArchName() is null. - const char *getComputeArchName() const; + /// Get the CUDA GPU architecture to which this Action corresponds. Returns + /// UNKNOWN if this Action corresponds to multiple architectures. + CudaArch getGpuArch() const { return GpuArch; } bool isAtTopLevel() const { return AtTopLevel; } - static bool IsValidGpuArchName(llvm::StringRef ArchName); - static bool classof(const Action *A) { return A->getKind() == CudaDeviceClass; } |