mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-20 08:53:55 +08:00
Create structure for per root device build info in program
define build log per root device Related-To: NEO-5001 Change-Id: Id507485e7f2bdd4e0d96948450da49a9f67dd2a8 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
ba353334d1
commit
9394f5755e
@@ -58,6 +58,12 @@ Program::Program(ExecutionEnvironment &executionEnvironment, Context *context, b
|
||||
numDevices = 1;
|
||||
bool force32BitAddressess = false;
|
||||
|
||||
uint32_t maxRootDeviceIndex = 0u;
|
||||
if (device) {
|
||||
maxRootDeviceIndex = device->getRootDeviceIndex();
|
||||
}
|
||||
buildInfos.resize(maxRootDeviceIndex + 1);
|
||||
|
||||
if (pClDevice) {
|
||||
auto enabledClVersion = pClDevice->getEnabledClVersion();
|
||||
if (enabledClVersion == 30) {
|
||||
@@ -280,7 +286,7 @@ cl_int Program::getSource(std::string &binary) const {
|
||||
return retVal;
|
||||
}
|
||||
|
||||
void Program::updateBuildLog(const Device *pDevice, const char *pErrorString,
|
||||
void Program::updateBuildLog(uint32_t rootDeviceIndex, const char *pErrorString,
|
||||
size_t errorStringSize) {
|
||||
if ((pErrorString == nullptr) || (errorStringSize == 0) || (pErrorString[0] == '\0')) {
|
||||
return;
|
||||
@@ -290,27 +296,20 @@ void Program::updateBuildLog(const Device *pDevice, const char *pErrorString,
|
||||
--errorStringSize;
|
||||
}
|
||||
|
||||
auto it = buildLog.find(pDevice);
|
||||
auto ¤tLog = buildInfos[rootDeviceIndex].buildLog;
|
||||
|
||||
if (it == buildLog.end()) {
|
||||
buildLog[pDevice].assign(pErrorString, pErrorString + errorStringSize);
|
||||
if (currentLog.empty()) {
|
||||
currentLog.assign(pErrorString, pErrorString + errorStringSize);
|
||||
return;
|
||||
}
|
||||
|
||||
buildLog[pDevice].append("\n");
|
||||
buildLog[pDevice].append(pErrorString, pErrorString + errorStringSize);
|
||||
currentLog.append("\n");
|
||||
currentLog.append(pErrorString, pErrorString + errorStringSize);
|
||||
}
|
||||
|
||||
const char *Program::getBuildLog(const Device *pDevice) const {
|
||||
const char *entry = nullptr;
|
||||
|
||||
auto it = buildLog.find(pDevice);
|
||||
|
||||
if (it != buildLog.end()) {
|
||||
entry = it->second.c_str();
|
||||
}
|
||||
|
||||
return entry;
|
||||
const char *Program::getBuildLog(uint32_t rootDeviceIndex) const {
|
||||
auto ¤tLog = buildInfos[rootDeviceIndex].buildLog;
|
||||
return currentLog.c_str();
|
||||
}
|
||||
|
||||
void Program::separateBlockKernels() {
|
||||
|
||||
Reference in New Issue
Block a user