P4 to Git Change 1539828 by wchau@wchau_OCL_PAL_LC on 2018/04/11 12:14:48

SWDEV-134107 - Add support for respecting target's xnack setting - handle the new format of target name

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.cpp#61 edit
Этот коммит содержится в:
foreman
2018-04-11 12:43:38 -04:00
родитель c04dd9c43b
Коммит e5a159065b
+17 -10
Просмотреть файл
@@ -868,16 +868,23 @@ hsa_isa_t PALHSALoaderContext::IsaFromName(const char* name) {
hsa_isa_t isa = {0};
uint32_t gfxip = 0;
std::string gfx_target(name);
uint32_t shift = 1;
size_t last = gfx_target.length();
std::string ver;
do {
size_t first = gfx_target.find_last_of(':', last);
ver = gfx_target.substr(first + 1, last - first);
last = first - 1;
gfxip += static_cast<uint32_t>(atoi(ver.c_str())) * shift;
shift *= 10;
} while (shift <= 100);
if (gfx_target.find("amdgcn-") == 0) {
std::string gfxip_version_str = gfx_target.substr(gfx_target.find("gfx") + 3);
gfxip = std::atoi(gfxip_version_str.c_str());
}
else {
// FIXME: Old way. To be remove.
uint32_t shift = 1;
size_t last = gfx_target.length();
std::string ver;
do {
size_t first = gfx_target.find_last_of(':', last);
ver = gfx_target.substr(first + 1, last - first);
last = first - 1;
gfxip += static_cast<uint32_t>(atoi(ver.c_str())) * shift;
shift *= 10;
} while (shift <= 100);
}
isa.handle = gfxip;
return isa;
}