SWDEV-240165 - Move all amd::MemObjMap_ reference to ROCclr and only allow base ptr to get ipc handle.
Change-Id: I9de10a0c4ba4dee3b3c8b972966840ab807001d8
This commit is contained in:
1 parent
1b69c85913
commit
16e6b65b5c
6 file changed
+72
-64
No files matched your search
@@ -193,34 +193,6 @@ void* Memory::cpuMap(device::VirtualDevice& vDev, uint flags, uint startLayer, u
|
||||
return mapTarget;
|
||||
}
|
||||
|
||||
bool Memory::IpcCreate(size_t offset, size_t* mem_size, void* handle) const {
|
||||
|
||||
void* dev_ptr = nullptr;
|
||||
hsa_status_t hsa_status = HSA_STATUS_SUCCESS;
|
||||
|
||||
/* Get the memory size from starting pointer */
|
||||
*mem_size = owner()->getSize() - offset;
|
||||
/* Get the starting pointer from the amd::Memory object */
|
||||
if (owner()->getSvmPtr() != nullptr) {
|
||||
dev_ptr = reinterpret_cast<address>(owner()->getSvmPtr()) + offset;
|
||||
} else if (owner()->getHostMem() != nullptr) {
|
||||
dev_ptr = reinterpret_cast<address>(owner()->getHostMem()) + offset;
|
||||
} else {
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
|
||||
/* Pass the pointer and memory size to retrieve the handle */
|
||||
hsa_status = hsa_amd_ipc_memory_create(dev_ptr, amd::alignUp(*mem_size, dev().alloc_granularity()),
|
||||
reinterpret_cast<hsa_amd_ipc_memory_t*>(handle));
|
||||
|
||||
if (hsa_status != HSA_STATUS_SUCCESS) {
|
||||
LogPrintfError("Failed to create memory for IPC, failed with hsa_status: %d \n", hsa_status);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Memory::cpuUnmap(device::VirtualDevice& vDev) {
|
||||
if (!isHostMemDirectAccess() && !IsPersistentDirectMap()) {
|
||||
if (!vDev.blitMgr().writeBuffer(mapMemory_->getHostMem(), *this, amd::Coord3D(0),
|
||||
|
||||
Reference in new issue
Block a user