mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2025-01-12 05:17:21 +01:00
Update get version (#6025)
This commit is contained in:
parent
99b71c068f
commit
b3d978600f
@ -202,24 +202,29 @@ namespace dpct
|
|||||||
// Version string has the following format:
|
// Version string has the following format:
|
||||||
// a. OpenCL<space><major.minor><space><vendor-specific-information>
|
// a. OpenCL<space><major.minor><space><vendor-specific-information>
|
||||||
// b. <major.minor>
|
// b. <major.minor>
|
||||||
|
// c. <AmdGcnArchName> e.g gfx1030
|
||||||
std::string ver;
|
std::string ver;
|
||||||
ver = dev.get_info<sycl::info::device::version>();
|
ver = dev.get_info<sycl::info::device::version>();
|
||||||
std::string::size_type i = 0;
|
std::string::size_type i = 0;
|
||||||
while (i < ver.size())
|
while (i < ver.size()) {
|
||||||
{
|
if (isdigit(ver[i]))
|
||||||
if (isdigit(ver[i]))
|
break;
|
||||||
break;
|
i++;
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
major = std::stoi(&(ver[i]));
|
major = std::stoi(&(ver[i]));
|
||||||
while (i < ver.size())
|
while (i < ver.size()) {
|
||||||
{
|
if (ver[i] == '.')
|
||||||
if (ver[i] == '.')
|
break;
|
||||||
break;
|
i++;
|
||||||
i++;
|
}
|
||||||
|
if (i < ver.size()) {
|
||||||
|
// a. and b.
|
||||||
|
i++;
|
||||||
|
minor = std::stoi(&(ver[i]));
|
||||||
|
} else {
|
||||||
|
// c.
|
||||||
|
minor = 0;
|
||||||
}
|
}
|
||||||
i++;
|
|
||||||
minor = std::stoi(&(ver[i]));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename tag, typename T>
|
template <typename tag, typename T>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user