Add support of HIP_HIDDEN_FREE_MEM, to deduct the returned available

memory from hipMemGetInfo API, measured in MB.

Change-Id: I7a8260c12e032e04e26611db4c38c893a29f2653


[ROCm/hip commit: 1df08626c8]
This commit is contained in:
Sun, Peng
2017-06-26 15:29:38 -05:00
parent c96e9341f7
commit 84fbc3dfaa
3 changed files with 8 additions and 3 deletions
+4
View File
@@ -1130,6 +1130,10 @@ hipError_t hipMemGetInfo (size_t *free, size_t *total)
hc::am_memtracker_sizeinfo(device->_acc, &deviceMemSize, &hostMemSize, &userMemSize);
*free = device->_props.totalGlobalMem - deviceMemSize;
// Deduct the amount of memory from the free memory reported from the system
if(HIP_HIDDEN_FREE_MEM)
*free -= (size_t)HIP_HIDDEN_FREE_MEM*1024*1024;
}
else {
e = hipErrorInvalidValue;