SWDEV-277566 - Separate code object loading from building

Change-Id: I87b8178f55e8ef23762dfe11fab71665ba680f00
This commit is contained in:
Jason Tang
2021-03-26 15:29:05 -04:00
zatwierdzone przez Jason Tang
rodzic 509f528980
commit 211ba25b4e
13 zmienionych plików z 283 dodań i 168 usunięć
+22
Wyświetl plik
@@ -622,6 +622,28 @@ int32_t Program::build(const std::vector<Device*>& devices, const char* options,
}
bool Program::load(const std::vector<Device*>& devices) {
ScopedLock sl(buildLock_);
for (const auto& it : devicePrograms_) {
const Device& device = *(it.first);
// If devices is specified, only load code object for those devices
if (std::find(devices.begin(), devices.end(), &device) != devices.end()) {
continue;
}
device::Program& devProgram = *(it.second);
// Only load the code object once
if (devProgram.isCodeObjectLoaded()) {
continue;
}
if (!devProgram.load()) {
return false;
}
}
return true;
}