SWDEV-306940 - Fix hipamd errors/warnings found by CppCheck

Change-Id: Ia93d4f5262ea4269d8031edbfd27033b887e5300


[ROCm/clr commit: 6e562f4d83]
This commit is contained in:
Satyanvesh Dittakavi
2021-11-29 17:53:36 +00:00
parent 61905bdb9f
commit 51f8fc06e1
21 changed files with 41 additions and 56 deletions
+3 -5
View File
@@ -292,12 +292,9 @@ hipError_t ihipCreateGlobalVarObj(const char* name, hipModule_t hmod, amd::Memor
{
HIP_INIT();
amd::Program* program = nullptr;
device::Program* dev_program = nullptr;
/* Get Device Program pointer*/
program = as_amd(reinterpret_cast<cl_program>(hmod));
dev_program = program->getDeviceProgram(*hip::getCurrentDevice()->devices()[0]);
amd::Program* program = as_amd(reinterpret_cast<cl_program>(hmod));
device::Program* dev_program = program->getDeviceProgram(*hip::getCurrentDevice()->devices()[0]);
if (dev_program == nullptr) {
LogPrintfError("Cannot get Device Function for module: 0x%x \n", hmod);
@@ -761,6 +758,7 @@ hipError_t PlatformState::loadModule(hipModule_t *module, const char* fname, con
assert(*module != nullptr);
if (dynCO_map_.find(*module) != dynCO_map_.end()) {
delete dynCo;
return hipErrorAlreadyMapped;
}
dynCO_map_.insert(std::make_pair(*module, dynCo));