File tree Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -34,20 +34,18 @@ void NVPTXSubtarget::anchor() {}
3434
3535NVPTXSubtarget &NVPTXSubtarget::initializeSubtargetDependencies (StringRef CPU,
3636 StringRef FS) {
37- // Provide the default CPU if we don't have one.
38- TargetName = std::string (CPU);
37+ TargetName = std::string (CPU);
3938
40- ParseSubtargetFeatures (CPU.empty () ? " sm_30" : CPU,
41- /* TuneCPU=*/ CPU.empty () ? " sm_30" : CPU, FS);
39+ ParseSubtargetFeatures (getTargetName (), /* TuneCPU=*/ getTargetName (), FS);
4240
43- // Re-map SM version numbers, SmVersion carries the regular SMs which do
44- // have relative order, while FullSmVersion allows distinguishing sm_90 from
45- // sm_90a, which would *not* be a subset of sm_91.
46- SmVersion = getSmVersion ();
41+ // Re-map SM version numbers, SmVersion carries the regular SMs which do
42+ // have relative order, while FullSmVersion allows distinguishing sm_90 from
43+ // sm_90a, which would *not* be a subset of sm_91.
44+ SmVersion = getSmVersion ();
4745
48- // Set default to PTX 6.0 (CUDA 9.0)
49- if (PTXVersion == 0 ) {
50- PTXVersion = 60 ;
46+ // Set default to PTX 6.0 (CUDA 9.0)
47+ if (PTXVersion == 0 ) {
48+ PTXVersion = 60 ;
5149 }
5250
5351 return *this ;
Original file line number Diff line number Diff line change @@ -111,6 +111,8 @@ class NVPTXSubtarget : public NVPTXGenSubtargetInfo {
111111 // - 0 represents base GPU model,
112112 // - non-zero value identifies particular architecture-accelerated variant.
113113 bool hasAAFeatures () const { return getFullSmVersion () % 10 ; }
114+
115+ // If the user did not provide a target we default to the `sm_30` target.
114116 std::string getTargetName () const {
115117 return TargetName.empty () ? " sm_30" : TargetName;
116118 }
You can’t perform that action at this time.
0 commit comments