Support hsa_amd_agents_allow_access on page fragments.

Since access may only be manipulated on whole pages, suballocator fragments must cooperate to set the page's access.
Since the KFD does not migrate memory on access changes this implementation makes agent access sticky across the requests in a fragmented page.

Change-Id: I88479ed45fb40e9782b704526a7b8ffb22e7bd76
This commit is contained in:
Sean Keely
2017-09-27 18:44:54 -05:00
parent 0e88414f5c
commit e9a6f2c3e6
4 ha cambiato i file con 52 aggiunte e 16 eliminazioni
@@ -339,7 +339,10 @@ hsa_status_t Runtime::FreeMemory(void* ptr) {
size = it->second.size;
// Imported fragments can't be released with FreeMemory.
if (region == nullptr) return HSA_STATUS_ERROR_INVALID_ARGUMENT;
if (region == nullptr) {
assert(false && "Can't release imported memory with free.");
return HSA_STATUS_ERROR_INVALID_ARGUMENT;
}
allocation_map_.erase(it);