SWDEV-353281 - VM support in mempool for graphs

The change enables VM support in graphs on Windows. That allows
to avoid caching of all allocations at the cost of map/unmap
overhead during memory create/destroy.

Change-Id: I792be00fba099e5e5d3cd44a963e1dfd6976a86d


[ROCm/clr commit: 04b696abee]
This commit is contained in:
German
2023-05-04 14:54:19 -04:00
committed by German Andryeyev
parent 23584feba4
commit 8d97827417
14 changed files with 341 additions and 49 deletions
+6 -4
View File
@@ -53,10 +53,12 @@ bool Device::Create() {
return false;
}
uint64_t max_size = std::numeric_limits<uint64_t>::max();
// Use maximum value to hold memory, because current implementation doesn't support VM
// Note: the call for the threshold is always successful
auto error = graph_mem_pool_->SetAttribute(hipMemPoolAttrReleaseThreshold, &max_size);
if (!HIP_MEM_POOL_USE_VM) {
uint64_t max_size = std::numeric_limits<uint64_t>::max();
// Use maximum value to hold memory, because current implementation doesn't support VM
// Note: the call for the threshold is always successful
auto error = graph_mem_pool_->SetAttribute(hipMemPoolAttrReleaseThreshold, &max_size);
}
// Current is default pool after device creation
current_mem_pool_ = default_mem_pool_;