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
このコミットが含まれているのは:
Jason Tang authored and Jason Tang committed 2021-09-01 09:25:40 -04:00
1 親 7f83bcdb45
コミット 1d0364e590
2ファイル変更
+17 -12

検索条件に一致するファイルはありません

+16 -12
ファイルの表示
@@ -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);