SWDEV-387383 - Changed error message in hipDevice[Get/Set]GraphMemAttribute to match cuda

Change-Id: I34a9f3d8572e004ae3d25ef25a4d404bea6d9597
This commit is contained in:
Ioannis Assiouras authored and Rahul Garg committed 2023-03-09 11:53:15 -05:00
1 parent 1d6c40b569
commit 9e1e3035ec
1 file changed
+8 -2
+8 -2
View File
@@ -2224,9 +2224,12 @@ hipError_t hipGraphMemFreeNodeGetParams(hipGraphNode_t node, void* dev_ptr) {
// ================================================================================================
hipError_t hipDeviceGetGraphMemAttribute(int device, hipGraphMemAttributeType attr, void* value) {
HIP_INIT_API(hipDeviceGetGraphMemAttribute, device, attr, value);
if ((static_cast<size_t>(device) >= g_devices.size()) || device < 0 || value == nullptr) {
if ((static_cast<size_t>(device) >= g_devices.size()) || device < 0) {
HIP_RETURN(hipErrorInvalidDevice);
}
if (value == nullptr) {
HIP_RETURN(hipErrorInvalidValue);
}
hipError_t result = hipErrorInvalidValue;
switch (attr) {
case hipGraphMemAttrUsedMemCurrent:
@@ -2254,9 +2257,12 @@ hipError_t hipDeviceGetGraphMemAttribute(int device, hipGraphMemAttributeType at
// ================================================================================================
hipError_t hipDeviceSetGraphMemAttribute(int device, hipGraphMemAttributeType attr, void* value) {
HIP_INIT_API(hipDeviceSetGraphMemAttribute, device, attr, value);
if ((static_cast<size_t>(device) >= g_devices.size()) || device < 0 || value == nullptr) {
if ((static_cast<size_t>(device) >= g_devices.size()) || device < 0) {
HIP_RETURN(hipErrorInvalidDevice);
}
if (value == nullptr) {
HIP_RETURN(hipErrorInvalidValue);
}
hipError_t result = hipErrorInvalidValue;
switch (attr) {
case hipGraphMemAttrUsedMemHigh: