SWDEV-283930 - Fix bugs in HIP Tests on Windows

Windows doesn't have headers unistd.h, sys/wait.h, so
remove them for _WIN64. Also, Windows doesn't have rand_r
so define it. Fixes builds for HIP tests:
d2dMemCpyWithPinnedHostMemory, hipMemset3DFunctional,
hipModuleLoadMultProcessOnMultGPU,
hipModuleLoadUnloadStress, hipModuleNegative,
hipStreamACb_ThrdBehaviour, hipMemcpyNegativeMThrdMSize,
hipStreamACb_MStrm_Mgpu, StreamAddCallback,
hipStreamACb_StrmSyncTiming, hipStreamACb_MultiCalls,
hipMallocConcurrency, hipMemset3DRegressMultiThread,
and hipSetGetDevice.

Change-Id: Id2f98d664716026c590d879e464ba467d4c071be
This commit is contained in:
Aaron En Ye Shi
2021-04-30 21:38:45 +00:00
vanhempi 9c07201c6b
commit 9edd31100d
12 muutettua tiedostoa jossa 38 lisäystä ja 7 poistoa
+8
Näytä tiedosto
@@ -53,6 +53,14 @@ const char* PATH_SEPERATOR_STR = "/";
const char* NULL_DEVICE = "/dev/null";
#endif
#ifdef _WIN64
// Windows does not have rand_r, use srand and rand instead.
int rand_r(unsigned int* s) {
srand(*s);
return rand();
}
#endif
// Get Free Memory from the system
static size_t getMemoryAmount() {
#if __linux__