SWDEV-413997 - Initial VMM changes for ROCm path.

Change-Id: I4405fd7b53182eb4c4622835c811c0dc08461537
This commit is contained in:
kjayapra-amd
2023-07-21 18:46:33 -04:00
committed by Karthik Jayaprakash
parent 8fe1d9dda1
commit 3ef829939a
13 changed files with 366 additions and 84 deletions
+10
View File
@@ -748,9 +748,19 @@ bool Buffer::create(bool alloc_local) {
owner()->setSvmPtr(orig_dev_ptr);
}
// Allocate backing storage in device local memory unless UHP or AHP are set
cl_mem_flags memFlags = owner()->getMemFlags();
if (memFlags & ROCCLR_MEM_PHYMEM) {
// If this is physical memory request, then get an handle and store it in user data
owner()->getUserData().hsa_handle = dev().deviceVmemAlloc(owner()->getSize(), 0);
if (owner()->getUserData().hsa_handle == 0) {
LogError("HSA Opaque Handle returned was null");
}
}
if ((owner()->parent() == nullptr) &&
(owner()->getSvmPtr() != nullptr)) {
if (dev().forceFineGrain(owner()) || dev().isFineGrainedSystem(true)) {