SWDEV-243423 - Avoid repeated metadata processing if the unbundled binary_ptr is same.
Change-Id: I71e008021b728dec61187d9ff29483ad8c4cad5c
[ROCm/clr commit: e993bf9f47]
이 커밋은 다음에 포함됨:
1 부모
39ddb8d8d4
커밋
701914416e
4 파일이 변경됨
+23
-7
검색과 일치하는 파일 없음
@@ -86,7 +86,8 @@ const Symbol* Program::findSymbol(const char* kernelName) const {
|
||||
}
|
||||
|
||||
int32_t Program::addDeviceProgram(Device& device, const void* image, size_t length,
|
||||
bool make_copy, amd::option::Options* options) {
|
||||
bool make_copy, amd::option::Options* options,
|
||||
const amd::Program* same_prog) {
|
||||
if (image != NULL && !amd::isElfMagic((const char*)image)) {
|
||||
if (device.settings().useLightning_) {
|
||||
return CL_INVALID_BINARY;
|
||||
@@ -175,7 +176,14 @@ int32_t Program::addDeviceProgram(Device& device, const void* image, size_t leng
|
||||
binary_[&rootDev] = std::make_tuple(memory, length, make_copy);
|
||||
}
|
||||
|
||||
if (!program->setBinary(reinterpret_cast<const char*>(memory), length)) {
|
||||
const device::Program* same_dev_prog = nullptr;
|
||||
if ((amd::IS_HIP) && (same_prog != nullptr)) {
|
||||
auto same_dev_prog_map_ = same_prog->devicePrograms();
|
||||
guarantee(same_dev_prog_map_.size() == 1);
|
||||
same_dev_prog = same_dev_prog_map_.begin()->second;
|
||||
}
|
||||
|
||||
if (!program->setBinary(reinterpret_cast<const char*>(memory), length, same_dev_prog)) {
|
||||
delete program;
|
||||
return CL_INVALID_BINARY;
|
||||
}
|
||||
|
||||
새 이슈에서 참조
사용자 차단