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() {}
34
34
35
35
NVPTXSubtarget &NVPTXSubtarget::initializeSubtargetDependencies (StringRef CPU,
36
36
StringRef FS) {
37
- // Provide the default CPU if we don't have one.
38
- TargetName = std::string (CPU);
37
+ TargetName = std::string (CPU);
39
38
40
- ParseSubtargetFeatures (CPU.empty () ? " sm_30" : CPU,
41
- /* TuneCPU=*/ CPU.empty () ? " sm_30" : CPU, FS);
39
+ ParseSubtargetFeatures (getTargetName (), /* TuneCPU=*/ getTargetName (), FS);
42
40
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 ();
47
45
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 ;
51
49
}
52
50
53
51
return *this ;
Original file line number Diff line number Diff line change @@ -111,6 +111,8 @@ class NVPTXSubtarget : public NVPTXGenSubtargetInfo {
111
111
// - 0 represents base GPU model,
112
112
// - non-zero value identifies particular architecture-accelerated variant.
113
113
bool hasAAFeatures () const { return getFullSmVersion () % 10 ; }
114
+
115
+ // If the user did not provide a target we default to the `sm_30` target.
114
116
std::string getTargetName () const {
115
117
return TargetName.empty () ? " sm_30" : TargetName;
116
118
}
You can’t perform that action at this time.
0 commit comments