Added return error code hipErrorInvalidValue in hipMemGetInfo

Change-Id: If01b012136b655ff8eb4878eb703dfe3e6a36530
This commit is contained in:
Rahul Garg
2016-09-17 23:54:20 +05:30
parent d69e56fdc9
commit ffd49cfa37
2 changed files with 7 additions and 1 deletions
+6
View File
@@ -864,6 +864,9 @@ hipError_t hipMemGetInfo (size_t *free, size_t *total)
if (total) {
*total = device->_props.totalGlobalMem;
}
else {
e = hipErrorInvalidValue;
}
if (free) {
// TODO - replace with kernel-level for reporting free memory:
@@ -872,6 +875,9 @@ hipError_t hipMemGetInfo (size_t *free, size_t *total)
*free = device->_props.totalGlobalMem - deviceMemSize;
}
else {
e = hipErrorInvalidValue;
}
} else {
e = hipErrorInvalidDevice;