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.
This commit is contained in:
lmoriche
2020-04-06 03:07:35 -07:00
zatwierdzone przez GitHub
rodzic eab81ca91b
commit 67830996a9
4 zmienionych plików z 30 dodań i 9 usunięć
+8 -1
Wyświetl plik
@@ -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,