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
parent 9c07201c6b
commit 9edd31100d
12 changed files with 38 additions and 7 deletions
+5 -1
View File
@@ -136,8 +136,8 @@ inline int hip_skip_retcode() {
#define fileno(x) _fileno(x)
#define dup(x) _dup(x)
#define dup2(x,y) _dup2(x,y)
#define close(x) _close(x)
#define pipe(x,y,z) _pipe(x,y,z)
#define sleep(x) _sleep(x)
#else
#define aligned_free(x) free(x)
#endif
@@ -169,6 +169,10 @@ extern const char* NULL_DEVICE;
#define TYPENAME(T) "?"
#endif
#ifdef _WIN64
int rand_r(unsigned int* s);
#endif
// Get Optimal Thread count size
size_t getHostThreadCount(const size_t memPerThread = 200 /* MB */, const size_t maxThreads = 0);