SWDEV-356554 - updated hipDeviceGetDefaultMemPool

updated the error check/messages

Change-Id: I518d497a82a14862d5168cc423aeaa20075336b8


[ROCm/clr commit: 42b5a6d5af]
Этот коммит содержится в:
pghafari
2022-09-19 07:36:40 -04:00
коммит произвёл Payam Ghafari
родитель 2363e4dd78
Коммит c328f3b15f
+4 -1
Просмотреть файл
@@ -28,9 +28,12 @@ extern hipError_t ihipFree(void* ptr);
// ================================================================================================
hipError_t hipDeviceGetDefaultMemPool(hipMemPool_t* mem_pool, int device) {
HIP_INIT_API(hipDeviceGetDefaultMemPool, mem_pool, device);
if ((mem_pool == nullptr) || (device >= g_devices.size())) {
if (mem_pool == nullptr) {
HIP_RETURN(hipErrorInvalidValue);
}
if (device < 0 || device >= g_devices.size()) {
HIP_RETURN(hipErrorInvalidDevice);
}
*mem_pool = reinterpret_cast<hipMemPool_t>(g_devices[device]->GetDefaultMemoryPool());
HIP_RETURN(hipSuccess);
}