File tree Expand file tree Collapse file tree 1 file changed +17
-12
lines changed Expand file tree Collapse file tree 1 file changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -202,24 +202,29 @@ namespace dpct
202202 // Version string has the following format:
203203 // a. OpenCL<space><major.minor><space><vendor-specific-information>
204204 // b. <major.minor>
205+ // c. <AmdGcnArchName> e.g gfx1030
205206 std::string ver;
206207 ver = dev.get_info<sycl::info::device::version>();
207208 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++;
213213 }
214214 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;
220227 }
221- i++;
222- minor = std::stoi(&(ver[i]));
223228 }
224229
225230 template <typename tag, typename T>
You can’t perform that action at this time.
0 commit comments