SWDEV-467263 - Allow hipMalloc to use sys memory

PAL supports allocating from system memory once device memory is used up
or allocation is larger than the device memory.

Change-Id: Iccd3377e95a6cc6d23e45d4738a17af8b9ee32d7
이 커밋은 다음에 포함됨:
pghafari 작성하고 Payam Ghafari가 2024-10-03 11:14:08 -04:00를 커밋함
1 부모 07bcc283f9
커밋 b07178618c
1 파일이 변경됨
+5 -2
+5 -2
파일 보기
@@ -314,8 +314,11 @@ 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))) {
if (dev_info.maxPhysicalMemAllocSize_ < sizeBytes) {
return hipErrorOutOfMemory;
}
// PAL allocates from system memory if needed
if (IS_LINUX && !useHostDevice && (dev_info.maxMemAllocSize_ < sizeBytes)) {
return hipErrorOutOfMemory;
}