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
2023-07-12 13:20:02 -04:00
committed by Shadi Dashmiz
parent 8c7f59663f
commit 173de06658
2 changed files with 8 additions and 2 deletions
+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))) {