SWDEV-431399 - fix first set of memory leaks in clr, found in rtc tests

change constexpr variable names to match the C++ style we follow.

Change-Id: Ibc59a65d8ff2ca765da7bf5e653c0650fb3714c4
This commit is contained in:
Jatin Chaudhary authored and Jatin Jaikishan Chaudhary committed 2023-11-14 20:39:45 -05:00
1 parent f6e0f2613c
commit ce27581465
4 files changed
+31 -26

No files matched your search

+10
View File
@@ -88,6 +88,10 @@ inline bool getIsaMeta(std::string isaName, amd_comgr_metadata_node_t& isaMeta)
return (status == AMD_COMGR_STATUS_SUCCESS) ? true : false;
}
inline bool releaseIsaMeta(amd_comgr_metadata_node_t& isaMeta) {
return AMD_COMGR_STATUS_SUCCESS == amd::Comgr::destroy_metadata(isaMeta);
}
bool getValueFromIsaMeta(amd_comgr_metadata_node_t& isaMeta, const char* key,
std::string& retValue) {
amd_comgr_status_t status;
@@ -102,6 +106,9 @@ bool getValueFromIsaMeta(amd_comgr_metadata_node_t& isaMeta, const char* key,
retValue.resize(size - 1);
status = amd::Comgr::get_metadata_string(valMeta, &size, &(retValue[0]));
}
if (status == AMD_COMGR_STATUS_SUCCESS) {
status = amd::Comgr::destroy_metadata(valMeta);
}
return (status == AMD_COMGR_STATUS_SUCCESS) ? true : false;
}
@@ -1726,6 +1733,9 @@ bool Device::populateOCLDeviceConstants() {
info_.availableSGPRs_ = (getValueFromIsaMeta(isaMeta, "AddressableNumSGPRs", sgprValue))
? (atoi(sgprValue.c_str()))
: 0;
if (!releaseIsaMeta(isaMeta)) {
LogInfo("Can not release the isa meta node");
}
}
// Generic support for HMM interfaces