SWDEV-518317 - Remove Redundant Error Message in removeFatBinary (#164)

Šī revīzija ir iekļauta:
Xie, Pengda
2025-04-15 09:00:39 -07:00
revīziju iesūtīja GitHub
vecāks f6c804edc0
revīzija e92ea151b2
+27 -41
Parādīt failu
@@ -1336,50 +1336,40 @@ FatBinaryInfo** StatCO::addFatBinary(const void* data, bool initialized, bool& s
hipError_t StatCO::removeFatBinary(FatBinaryInfo** module) {
amd::ScopedLock lock(sclock_);
if (!module_to_hostVars_.empty()) {
auto hostVarsIter = module_to_hostVars_.find(module);
if (hostVarsIter != module_to_hostVars_.end()) {
for (auto& hostVar : hostVarsIter->second) {
auto varIter = vars_.find(hostVar);
if (varIter == vars_.end()) {
LogPrintfError(
"removeFatBinary: Unable to find module 0x%x hostVar 0x%x",
module, hostVar);
} else {
delete varIter->second;
vars_.erase(varIter);
}
auto hostVarsIter = module_to_hostVars_.find(module);
if (hostVarsIter != module_to_hostVars_.end()) {
for (auto& hostVar : hostVarsIter->second) {
auto varIter = vars_.find(hostVar);
if (varIter == vars_.end()) {
LogPrintfError(
"removeFatBinary: Unable to find module 0x%x hostVar 0x%x",
module, hostVar);
} else {
delete varIter->second;
vars_.erase(varIter);
}
module_to_hostVars_.erase(hostVarsIter);
} else {
LogPrintfError(
"removeFatBinary: Unable to find module 0x%x hostVars", module);
}
module_to_hostVars_.erase(hostVarsIter);
}
if (!managedVars_.empty()) {
auto managedVarsIter = managedVars_.find(module);
if (managedVarsIter != managedVars_.end()) {
for (auto& managedVar : managedVarsIter->second) {
hipError_t err;
for (auto dev : g_devices) {
DeviceVar* dvar = nullptr;
IHIP_RETURN_ONFAIL(managedVar->getDeviceVarPtr(&dvar, dev->deviceId()));
if (dvar != nullptr) {
// free also deletes the device ptr
err = ihipFree(dvar->device_ptr());
assert(err == hipSuccess);
}
auto managedVarsIter = managedVars_.find(module);
if (managedVarsIter != managedVars_.end()) {
for (auto& managedVar : managedVarsIter->second) {
hipError_t err;
for (auto dev : g_devices) {
DeviceVar* dvar = nullptr;
IHIP_RETURN_ONFAIL(managedVar->getDeviceVarPtr(&dvar, dev->deviceId()));
if (dvar != nullptr) {
// free also deletes the device ptr
err = ihipFree(dvar->device_ptr());
assert(err == hipSuccess);
}
err = ihipFree(*(static_cast<void**>(managedVar->getManagedVarPtr())));
assert(err == hipSuccess);
delete managedVar;
}
managedVars_.erase(managedVarsIter);
} else {
LogPrintfError("removeFatBinary: Unable to find module 0x%x managedVars",
module);
err = ihipFree(*(static_cast<void**>(managedVar->getManagedVarPtr())));
assert(err == hipSuccess);
delete managedVar;
}
managedVars_.erase(managedVarsIter);
}
auto hostFuncsIter = module_to_hostFunctions_.find(module);
@@ -1395,8 +1385,6 @@ hipError_t StatCO::removeFatBinary(FatBinaryInfo** module) {
}
}
module_to_hostFunctions_.erase(hostFuncsIter);
} else {
LogPrintfError("removeFatBinary: Unable to find module 0x%x hostFuncs", module);
}
auto hostModuleIter = module_to_hostModule_.find(module);
@@ -1411,8 +1399,6 @@ hipError_t StatCO::removeFatBinary(FatBinaryInfo** module) {
module, hostModule);
}
module_to_hostModule_.erase(hostModuleIter);
} else {
LogPrintfError("removeFatBinary: Unable to find module 0x%x hostModule", module);
}
return hipSuccess;