From fa1b7925cf8daf296831993e79f6bd86231ce169 Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Mon, 7 Nov 2022 16:47:59 +0000 Subject: [PATCH] SWDEV-365908 - Do not align mem size for IPC Remove alignment to granularity for IPC handles as ROCr has a patch that will internally validate pointer sizes against requested size during allocation instead of size aligned to page size. This patch is needed together with this patch from ROCr: f8a42a3a:Use user requested size for memory fragments Change-Id: I28b25558ea03c836b44fafdb34b7330cf6887424 --- rocclr/device/rocm/rocdevice.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rocclr/device/rocm/rocdevice.cpp b/rocclr/device/rocm/rocdevice.cpp index 9ecaf22ef8..f2ebe0f086 100644 --- a/rocclr/device/rocm/rocdevice.cpp +++ b/rocclr/device/rocm/rocdevice.cpp @@ -2209,8 +2209,7 @@ bool Device::IpcCreate(void* dev_ptr, size_t* mem_size, void* handle, size_t* me return false; } - // Pass the pointer and memory size to retrieve the handle - hsa_status = hsa_amd_ipc_memory_create(orig_dev_ptr, amd::alignUp(*mem_size, alloc_granularity()), + hsa_status = hsa_amd_ipc_memory_create(orig_dev_ptr, *mem_size, reinterpret_cast(handle)); if (hsa_status != HSA_STATUS_SUCCESS) {