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 authored and GitHub committed 2020-04-06 15:37:35 +05:30
1 родитель f2ea243fa5
Коммит 318fbce04d
4 files changed
+30 -9

No files matched your search

+8 -1
Просмотреть файл
@@ -68,7 +68,14 @@ namespace hip_impl {
const size_t data_size,
hsa_executable_t executable,
hsa_agent_t agent) {
return impl->load_executable(data, data_size, executable, agent);
return impl->load_executable(data, data_size, true, executable, agent);
}
hsa_executable_t program_state::load_executable_no_copy(const char* data,
const size_t data_size,
hsa_executable_t executable,
hsa_agent_t agent) {
return impl->load_executable(data, data_size, false, executable, agent);
}
hipFunction_t program_state::kernel_descriptor(std::uintptr_t function_address,