adding support for scratch memory
Signed-off-by: Moses Reuben <moses.reuben@amd.com>
This commit is contained in:
+9
-1
@@ -124,7 +124,7 @@ hsaKmtAllocMemory(
|
||||
if ((SizeInBytes & (page_size-1)) && !MemFlags.ui32.GDSMemory)
|
||||
return HSAKMT_STATUS_INVALID_PARAMETER;
|
||||
|
||||
if (MemFlags.ui32.HostAccess && !MemFlags.ui32.NonPaged) {
|
||||
if (MemFlags.ui32.HostAccess && !MemFlags.ui32.NonPaged && !MemFlags.ui32.Scratch) {
|
||||
err = posix_memalign(MemoryAddress, page_size, SizeInBytes);
|
||||
if (err != 0)
|
||||
return HSAKMT_STATUS_NO_MEMORY;
|
||||
@@ -149,6 +149,14 @@ hsaKmtAllocMemory(
|
||||
|
||||
return HSAKMT_STATUS_SUCCESS;
|
||||
}
|
||||
if (MemFlags.ui32.HostAccess && MemFlags.ui32.Scratch ) {
|
||||
*MemoryAddress = fmm_allocate_scratch(gpu_id, SizeInBytes);
|
||||
|
||||
if (*MemoryAddress == NULL)
|
||||
return HSAKMT_STATUS_NO_MEMORY;
|
||||
|
||||
return HSAKMT_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
return HSAKMT_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user