SWDEV-464828 - Initial implementation of VMM IPC on PAL/Windows.

Change-Id: I3d5e148fad9105704db6724b00df06bef4fc9d2f
This commit is contained in:
kjayapra-amd
2024-05-29 19:09:32 -04:00
committed by Karthik Jayaprakash
parent 191869b252
commit e7a7feb273
7 changed files with 79 additions and 23 deletions
+2 -9
View File
@@ -156,7 +156,7 @@ hipError_t hipMemExportToShareableHandle(void* shareableHandle,
}
if (!ga->asAmdMemory().getContext().devices()[0]->ExportShareableVMMHandle(
ga->asAmdMemory().getUserData().hsa_handle, flags, shareableHandle)) {
ga->asAmdMemory(), flags, shareableHandle)) {
LogPrintfError("Exporting Handle failed with flags: %d", flags);
HIP_RETURN(hipErrorInvalidValue);
}
@@ -224,20 +224,13 @@ hipError_t hipMemImportFromShareableHandle(hipMemGenericAllocationHandle_t* hand
}
amd::Device* device = hip::getCurrentDevice()->devices()[0];
amd::Memory* phys_mem_obj = new (device->context()) amd::Buffer(device->context(),
ROCCLR_MEM_PHYMEM | ROCCLR_MEM_INTERPROCESS, 0, osHandle);
amd::Memory* phys_mem_obj = device->ImportShareableVMMHandle(osHandle);
if (phys_mem_obj == nullptr) {
LogError("failed to new a va range curr_mem_obj object!");
HIP_RETURN(hipErrorInvalidValue);
}
if (!phys_mem_obj->create(nullptr, false)) {
LogError("failed to create a va range mem object");
phys_mem_obj->release();
HIP_RETURN(hipErrorInvalidValue);
}
hipMemAllocationProp prop {};
prop.type = hipMemAllocationTypePinned;
prop.location.type = hipMemLocationTypeDevice;