SWDEV-311270 - Clean-up IPC path in ROCclr
- Make IPC interfaces generic between devices and rely on the IPC buffer
for attach/detach logic
Change-Id: Id3c18d122030329b7ee532bbb6317de9dd6a0bbe
[ROCm/clr commit: 9aa6f25f1c]
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* Copyright (c) 2015 - 2021 Advanced Micro Devices, Inc.
|
||||
/* Copyright (c) 2015 - 2023 Advanced Micro Devices, Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -1032,7 +1032,8 @@ bool Resource::CreateIpc(CreateParams* params) {
|
||||
Pal::ExternalGpuMemoryOpenInfo gpuMemOpenInfo = {};
|
||||
Pal::ExternalResourceOpenInfo& openInfo = gpuMemOpenInfo.resourceInfo;
|
||||
|
||||
openInfo.hExternalResource = reinterpret_cast<amd::IpcBuffer*>(params->owner_)->Handle();
|
||||
openInfo.hExternalResource = *reinterpret_cast<const Pal::OsExternalHandle*>(
|
||||
reinterpret_cast<amd::IpcBuffer*>(params->owner_)->Handle());
|
||||
openInfo.flags.ntHandle = false;
|
||||
|
||||
memRef_ = GpuMemoryReference::Create(dev(), gpuMemOpenInfo);
|
||||
@@ -1336,14 +1337,6 @@ bool Resource::create(MemoryType memType, CreateParams* params, bool forceLinear
|
||||
return true;
|
||||
}
|
||||
|
||||
// ================================================================================================
|
||||
void* Resource::ExportHandle() const {
|
||||
Pal::GpuMemoryExportInfo exportInfo = {};
|
||||
// Set default flags in case they are not provided by application
|
||||
exportInfo.accessFlags = GENERIC_READ | GENERIC_WRITE;
|
||||
Pal::OsExternalHandle handle = iMem()->ExportExternalHandle(exportInfo);
|
||||
return reinterpret_cast<void*>(handle);
|
||||
}
|
||||
// ================================================================================================
|
||||
void Resource::free() {
|
||||
if (memRef_ == nullptr) {
|
||||
|
||||
Reference in New Issue
Block a user