Fix associate code object symbols with host allocation bug (#1799)

The current implementation skips this procedure for a given device
object when a global symbol is found in the cache.  This is incorrect:

 - There could be other undefined globals that have not been previously
encountered further down the list
 - If a symbol is found in the cache, it doesn't need to be pinned again
but it still need to be defined for the current executable

Added special case for the printf buffer symbol (already pinned by HCC)

The bug was exposed by running printf on different GPUs.

[ROCm/hip commit: 6613a37b3b]
This commit is contained in:
Siu Chi Chan
2020-01-24 05:52:49 -05:00
committed by Maneesh Gupta
parent 6a272676d3
commit af3e8f633a
3 changed files with 50 additions and 21 deletions
+1 -1
View File
@@ -61,7 +61,7 @@ namespace hip_impl {
if (it == impl->get_globals().end())
return nullptr;
else
return it->second;
return it->second.first;
}
hsa_executable_t program_state::load_executable(const char* data,