SWDEV-356554 - updated hipDeviceGetDefaultMemPool

updated the error check/messages

Change-Id: I518d497a82a14862d5168cc423aeaa20075336b8


[ROCm/clr commit: 42b5a6d5af]
这个提交包含在:
pghafari 编写, Payam Ghafari 于 2022-09-20 16:42:48 -04:00 提交
1 父节点 2363e4dd78
当前提交 c328f3b15f
1 个文件已更改
+4 -1
+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);
}