Don't duplicate embedded code objects (#1991)

If the code object is embedded in an already mapped file, and the
lifetime of the mapped file exceeds the lifetime of the executable,
we do not need to make a copy of the binary.

This allows the ROCR to present the code object URI as
file:///path/to/file#offset=X&size=Y.

[ROCm/clr commit: 67830996a9]
이 커밋은 다음에 포함됨:
lmoriche
2020-04-06 03:07:35 -07:00
커밋한 사람 GitHub
부모 f2ea243fa5
커밋 318fbce04d
4개의 변경된 파일30개의 추가작업 그리고 9개의 파일을 삭제
+3 -3
파일 보기
@@ -89,9 +89,9 @@ __hipRegisterFatBinary(const void* data)
reinterpret_cast<uintptr_t>(header) + desc->offset), desc->size};
if (HIP_DUMP_CODE_OBJECT)
__hipDumpCodeObject(image);
module->executable = hip_impl::get_program_state().load_executable(image.data(), image.size(),
module->executable,
agent);
module->executable = hip_impl::get_program_state().load_executable_no_copy(
reinterpret_cast<const char*>(header) + desc->offset, desc->size,
module->executable, agent);
if (module->executable.handle) {
modules->at(deviceId) = module;