SWDEV-294768 - Fix PCMark10 performance drop
PCMark10 counts the time spent in clCreateKernel as part of execution time, so as workaround for the PAL path, move code object loading back to clBuildProgram. Change-Id: I3b9cf1879ece08ab59f447ec165b0525bc8593a4
This commit is contained in:
@@ -36,6 +36,7 @@ bool Comgr::LoadLib() {
|
||||
WINDOWS_SWITCH("amd_comgr.dll", "libamd_comgr.so.2"));
|
||||
cep_.handle = Os::loadLibrary(ComgrLibName);
|
||||
if (nullptr == cep_.handle) {
|
||||
ClPrint(amd::LOG_ERROR, amd::LOG_CODE, "Failed to load COMGR library.");
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -744,6 +744,12 @@ bool LightningProgram::createBinary(amd::option::Options* options) {
|
||||
bool LightningProgram::createKernels(void* binary, size_t binSize, bool useUniformWorkGroupSize,
|
||||
bool internalKernel) {
|
||||
#if defined(USE_COMGR_LIBRARY)
|
||||
// Stop compilation if it is an offline device - PAL runtime does not
|
||||
// support ISA compiled offline
|
||||
if (!device().isOnline()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Find the size of global variables from the binary
|
||||
if (!FindGlobalVarSize(binary, binSize)) {
|
||||
buildLog_ += "Error: Cannot Find Global Var Sizes\n";
|
||||
@@ -764,18 +770,6 @@ bool LightningProgram::createKernels(void* binary, size_t binSize, bool useUnifo
|
||||
|
||||
kernel->setUniformWorkGroupSize(useUniformWorkGroupSize);
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LightningProgram::setKernels(void* binary, size_t binSize,
|
||||
amd::Os::FileDesc fdesc, size_t foffset, std::string uri) {
|
||||
#if defined(USE_COMGR_LIBRARY)
|
||||
// Stop compilation if it is an offline device - PAL runtime does not
|
||||
// support ISA compiled offline
|
||||
if (!device().isOnline()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
executable_ = loader_->CreateExecutable(HSA_PROFILE_FULL, nullptr);
|
||||
if (executable_ == nullptr) {
|
||||
@@ -799,6 +793,16 @@ bool LightningProgram::setKernels(void* binary, size_t binSize,
|
||||
LogError("Error: Freezing the executable failed.");
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LightningProgram::setKernels(void* binary, size_t binSize,
|
||||
amd::Os::FileDesc fdesc, size_t foffset, std::string uri) {
|
||||
#if defined(USE_COMGR_LIBRARY)
|
||||
if (!device().isOnline()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (auto& kit : kernels()) {
|
||||
LightningKernel* kernel = static_cast<LightningKernel*>(kit.second);
|
||||
|
||||
Reference in New Issue
Block a user