SWDEV-539145 - Support extended fine grained system memory pool (#195)

* Add hipHostMalloc() new flag hipHostMallocUncached which will force to allocate pinned
host memory on extended fine grained system memory pool.
* Add hipHostAlloc() new flag hipHostAllocUncached which will force to allocate pinned
host memory on extended fine grained system memory pool.
* Add hipHostRegister() new flag hipHostRegisterUncached which will force to map
host memory onto extended fine grained system momory pool.
This commit is contained in:
Sang, Tao
2025-07-01 00:39:47 -04:00
committed by GitHub
parent c8571baa23
commit f310c7f642
+18 -1
View File
@@ -767,6 +767,15 @@ enum hipLimit_t {
* @note This flag is the same definition as #hipHostAllocWriteCombined which is equivalent to
* cudaHostAllocWriteCombined.*/
#define hipHostMallocWriteCombined 0x4
/**
* Host memory will be forcedly allocated on extended fine grained system memory
* pool which is with MTYPE_UC.
* @note This allocation flag is applicable on AMD devices in Linux only.
*/
#define hipHostMallocUncached 0x10000000
#define hipHostAllocUncached hipHostMallocUncached
/**
* Host memory allocation will follow numa policy set by user.
* @note This numa allocation flag is applicable on Linux, under development on Windows.
@@ -822,6 +831,11 @@ enum hipLimit_t {
/** Coarse Grained host memory lock.*/
#define hipExtHostRegisterCoarseGrained 0x8
/** Map host memory onto extended fine grained access host memory pool when enabled.
* It is applicable on AMD devices in Linux only
*/
#define hipExtHostRegisterUncached 0x80000000
/** Automatically select between Spin and Yield.*/
#define hipDeviceScheduleAuto 0x0
@@ -4207,6 +4221,8 @@ hipError_t hipMemPoolImportPointer(
* - #hipHostAllocPortable Memory is considered allocated by all contexts.
* - #hipHostAllocMapped Map the allocation into the address space for the current device.
* - #hipHostAllocWriteCombined Allocates the memory as write-combined.
* - #hipHostAllocUncached Allocate the host memory on extended fine grained access system
* memory pool
*
* @return #hipSuccess, #hipErrorOutOfMemory, #hipErrorInvalidValue
*/
@@ -4246,7 +4262,8 @@ hipError_t hipHostGetFlags(unsigned int* flagsPtr, void* hostPtr);
* one context so this is always assumed true.
* - #hipHostRegisterMapped Map the allocation into the address space for the current device.
* The device pointer can be obtained with #hipHostGetDevicePointer.
*
* - #hipExtHostRegisterUncached Map the host memory onto extended fine grained access system
* memory pool.
*
* After registering the memory, use #hipHostGetDevicePointer to obtain the mapped device pointer.
* On many systems, the mapped device pointer will have a different value than the mapped host