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.
Этот коммит содержится в:
lmoriche
2020-04-06 03:07:35 -07:00
коммит произвёл GitHub
родитель 6358e40a76
Коммит 9de5e90ab5
4 изменённых файлов: 30 добавлений и 9 удалений
+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,