libhsakmt: allocate va in host path
Change-Id: I40a4395aca99ea8dfd8ff0ecde64eb2c3840d867
Signed-off-by: Longlong Yao <Longlong.Yao@amd.com>
[ROCm/ROCR-Runtime commit: 26f001d3cb]
This commit is contained in:
committed by
Yat Sin, David
parent
fcd8d9795b
commit
082c6b7830
@@ -1830,6 +1830,10 @@ static void *fmm_allocate_host_gpu(uint32_t gpu_id, uint32_t node_id, void *addr
|
||||
if (mflags.ui32.AQLQueueMemory)
|
||||
size = MemorySizeInBytes * 2;
|
||||
|
||||
/* special case for va allocation without real memory alloc */
|
||||
if (mflags.ui32.OnlyAddress)
|
||||
return fmm_allocate_va(gpu_id, address, size, aperture, alignment, mflags);
|
||||
|
||||
/* Paged memory is allocated as a userptr mapping, non-paged
|
||||
* memory is allocated from KFD
|
||||
*/
|
||||
|
||||
@@ -176,7 +176,8 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtAllocMemoryAlign(HSAuint32 PreferredNode,
|
||||
}
|
||||
|
||||
/* GPU allocated system memory */
|
||||
if (!gpu_id || !MemFlags.ui32.NonPaged || hsakmt_zfb_support || MemFlags.ui32.GTTAccess) {
|
||||
if (!gpu_id || !MemFlags.ui32.NonPaged || hsakmt_zfb_support || MemFlags.ui32.GTTAccess
|
||||
|| MemFlags.ui32.OnlyAddress) {
|
||||
/* Backwards compatibility hack: Allocate system memory if app
|
||||
* asks for paged memory from a GPU node.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user