Merge pull request #1734 from vsytch/win10-hipMemcpy-fixes

Fix OOM issues with hipMemcpy test on Windows

[ROCm/hip commit: 9c91632194]
이 커밋은 다음에 포함됨:
Evgeny Mankov 작성하고 GitHub가 2019-12-21 22:02:34 +03:00를 커밋함
커밋 bf2f77846e
1 파일이 변경됨
+6 -2
+6 -2
파일 보기
@@ -292,8 +292,12 @@ void memcpytest2_get_host_memory(size_t& free, size_t& total) {
MEMORYSTATUSEX status;
status.dwLength = sizeof(status);
GlobalMemoryStatusEx(&status);
free = status.ullAvailPhys;
total = status.ullTotalPhys;
// Windows doesn't allow allocating more than half of system memory to the gpu.
// Since the runtime also needs space for its internal allocations,
// we should not try to allocate more than 40% of reported system memory,
// otherwise we can run into OOM issues.
free = static_cast<size_t>(0.4 * status.ullAvailPhys);
total = static_cast<size_t>(0.4 * status.ullTotalPhys);
}
#else
struct sysinfo memInfo;