SWDEV-243423 - Avoid repeated metadata processing if the unbundled binary_ptr is same.

Change-Id: I71e008021b728dec61187d9ff29483ad8c4cad5c
This commit is contained in:
kjayapra-amd
2020-07-06 19:26:40 -04:00
committad av Karthik Jayaprakash
förälder 9ed1767c02
incheckning e993bf9f47
4 ändrade filer med 23 tillägg och 7 borttagningar
+8 -3
Visa fil
@@ -1978,7 +1978,7 @@ bool Program::initClBinary(const char* binaryIn, size_t size) {
}
// ================================================================================================
bool Program::setBinary(const char* binaryIn, size_t size) {
bool Program::setBinary(const char* binaryIn, size_t size, const device::Program* same_dev_prog) {
if (!initClBinary(binaryIn, size)) {
DevLogError("Init CL Binary failed \n");
return false;
@@ -2025,8 +2025,13 @@ bool Program::setBinary(const char* binaryIn, size_t size) {
return false;
}
clBinary()->loadCompileOptions(compileOptions_);
clBinary()->loadLinkOptions(linkOptions_);
if (same_dev_prog != nullptr) {
compileOptions_ = same_dev_prog->compileOptions();
linkOptions_ = same_dev_prog->linkOptions();
} else {
clBinary()->loadCompileOptions(compileOptions_);
clBinary()->loadLinkOptions(linkOptions_);
}
clBinary()->resetElfIn();
return true;
Regular → Executable
+3 -1
Visa fil
@@ -166,6 +166,8 @@ class Program : public amd::HeapObject {
//! Return the compiler options used to build the program.
const std::string& compileOptions() const { return compileOptions_; }
const std::string& linkOptions() const { return linkOptions_; }
//! Return the option arg passed in to clCompileProgram(), clLinkProgram(),
//! or clBuildProgram(), whichever is called last
const std::string lastBuildOptionsArg() const { return lastBuildOptionsArg_; }
@@ -191,7 +193,7 @@ class Program : public amd::HeapObject {
ClBinary* clBinary() { return clBinary_; }
const ClBinary* clBinary() const { return clBinary_; }
bool setBinary(const char* binaryIn, size_t size);
bool setBinary(const char* binaryIn, size_t size, const device::Program* same_dev_prog = nullptr);
type_t type() const { return type_; }