File tree 1 file changed +17
-12
lines changed
1 file changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -202,24 +202,29 @@ namespace dpct
202
202
// Version string has the following format:
203
203
// a. OpenCL<space><major.minor><space><vendor-specific-information>
204
204
// b. <major.minor>
205
+ // c. <AmdGcnArchName> e.g gfx1030
205
206
std::string ver;
206
207
ver = dev.get_info<sycl::info::device::version>();
207
208
std::string::size_type i = 0;
208
- while (i < ver.size())
209
- {
210
- if (isdigit(ver[i]))
211
- break;
212
- i++;
209
+ while (i < ver.size()) {
210
+ if (isdigit(ver[i]))
211
+ break;
212
+ i++;
213
213
}
214
214
major = std::stoi(&(ver[i]));
215
- while (i < ver.size())
216
- {
217
- if (ver[i] == '.')
218
- break;
219
- i++;
215
+ while (i < ver.size()) {
216
+ if (ver[i] == '.')
217
+ break;
218
+ i++;
219
+ }
220
+ if (i < ver.size()) {
221
+ // a. and b.
222
+ i++;
223
+ minor = std::stoi(&(ver[i]));
224
+ } else {
225
+ // c.
226
+ minor = 0;
220
227
}
221
- i++;
222
- minor = std::stoi(&(ver[i]));
223
228
}
224
229
225
230
template <typename tag, typename T>
You can’t perform that action at this time.
0 commit comments