SWDEV-408586 - set device active when malloc is called

Signed-off-by: sdashmiz <shadi.dashmiz@amd.com>
Change-Id: Ib930d997b7d544d8b6fb42d2fea01fa8a4418e98
This commit is contained in:
sdashmiz authored and Shadi Dashmiz committed 2023-07-13 11:39:58 -04:00
1 parent 8c7f59663f
commit 173de06658
2 files changed
+8 -2

No files matched your search

+1
View File
@@ -290,6 +290,7 @@ hipError_t ihipMalloc(void** ptr, size_t sizeBytes, unsigned int flags)
}
const auto& dev_info = amdContext->devices()[0]->info();
hip::getCurrentDevice()->SetActiveStatus();
if ((!useHostDevice && (dev_info.maxMemAllocSize_ < sizeBytes)) ||
(useHostDevice && (dev_info.maxPhysicalMemAllocSize_ < sizeBytes))) {