Fix IPC create memory failure

ROCr expects granular size in hsa_amd_ipc_memory_create

Change-Id: I7c266aa2eef8304f105298a7a668f4c4b3fb5f5a
This commit is contained in:
Rahul Garg
2020-06-10 07:23:02 +00:00
parent 2b771d2f5f
commit 617538074c
+1 -2
View File
@@ -200,7 +200,6 @@ bool Memory::IpcCreate(size_t offset, size_t* mem_size, void* handle) const {
/* 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;
@@ -211,7 +210,7 @@ bool Memory::IpcCreate(size_t offset, size_t* mem_size, void* handle) const {
}
/* Pass the pointer and memory size to retrieve the handle */
hsa_status = hsa_amd_ipc_memory_create(dev_ptr, *mem_size,
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) {