SWDEV-240804 - Add coarse grain memory support

Add an extension to memory advise to disable cache coherency for
better performance

Change-Id: I283703d81d9c36ddfa2c8fffa15eef60e2195056


[ROCm/clr commit: a9a1e21445]
This commit is contained in:
German Andryeyev
2021-05-31 12:32:29 -04:00
committed by Maneesh Gupta
parent 1f214f9e32
commit c4ee688d6e
2 changed files with 11 additions and 4 deletions
@@ -2270,6 +2270,12 @@ bool Device::SetSvmAttributesInt(const void* dev_ptr, size_t count,
// @note: 0 may cause a failure on old runtimes
attr.push_back({HSA_AMD_SVM_ATTRIB_AGENT_ACCESSIBLE_IN_PLACE, 0});
break;
case amd::MemoryAdvice::SetCoarseGrain:
attr.push_back({HSA_AMD_SVM_ATTRIB_GLOBAL_FLAG, HSA_AMD_SVM_GLOBAL_FLAG_COARSE_GRAINED});
break;
case amd::MemoryAdvice::UnsetCoarseGrain:
attr.push_back({HSA_AMD_SVM_ATTRIB_GLOBAL_FLAG, HSA_AMD_SVM_GLOBAL_FLAG_FINE_GRAINED});
break;
default:
return false;
break;