refactor(ocl tests): program get build info tests

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
This commit is contained in:
Krystian Chmielewski
2022-11-08 16:24:26 +00:00
committed by Compute-Runtime-Automation
parent 3169b4afd6
commit f0f545eee7
2 changed files with 136 additions and 265 deletions

View File

@@ -280,23 +280,16 @@ cl_int Program::getSource(std::string &binary) const {
void Program::updateBuildLog(uint32_t rootDeviceIndex, const char *pErrorString,
size_t errorStringSize) {
if ((pErrorString == nullptr) || (errorStringSize == 0) || (pErrorString[0] == '\0')) {
ConstStringRef errorString(pErrorString, errorStringSize);
if (errorString.empty()) {
return;
}
if (pErrorString[errorStringSize - 1] == '\0') {
--errorStringSize;
auto &buildLog = buildInfos[rootDeviceIndex].buildLog;
if (false == buildLog.empty()) {
buildLog.append("\n");
}
auto &currentLog = buildInfos[rootDeviceIndex].buildLog;
if (currentLog.empty()) {
currentLog.assign(pErrorString, pErrorString + errorStringSize);
return;
}
currentLog.append("\n");
currentLog.append(pErrorString, pErrorString + errorStringSize);
buildLog.append(errorString.begin(), errorString.end());
}
const char *Program::getBuildLog(uint32_t rootDeviceIndex) const {