mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2025-01-11 21:10:24 +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:
|
||||
// a. OpenCL<space><major.minor><space><vendor-specific-information>
|
||||
// b. <major.minor>
|
||||
// c. <AmdGcnArchName> e.g gfx1030
|
||||
std::string ver;
|
||||
ver = dev.get_info<sycl::info::device::version>();
|
||||
std::string::size_type i = 0;
|
||||
while (i < ver.size())
|
||||
{
|
||||
if (isdigit(ver[i]))
|
||||
break;
|
||||
i++;
|
||||
while (i < ver.size()) {
|
||||
if (isdigit(ver[i]))
|
||||
break;
|
||||
i++;
|
||||
}
|
||||
major = std::stoi(&(ver[i]));
|
||||
while (i < ver.size())
|
||||
{
|
||||
if (ver[i] == '.')
|
||||
break;
|
||||
i++;
|
||||
while (i < ver.size()) {
|
||||
if (ver[i] == '.')
|
||||
break;
|
||||
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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user