2
0
Ficheiros
rocm-systems/test/TestChecks.hpp
T
Stanley Tsang 0b2bfdd6d8 Multiprocess unit test various fixes (#367)
* Re-enabling mp unit tests

* Fixing shared memory leak and other bugs related to shared mem for MP unit tests

* Revert 43bfbfc97bf9edbae1f386d461439091618ff8ed

* Further tightening up unlinks

* Moving test check macros to separate header file

* Tightening up shared memory unlinking for clique kernels, add munmap for host barrier for MP unit tests

* Updating new MP unit test

* Fixing mqueue bug

* Fixing memory leak in MP unit tests
2021-05-14 09:38:49 -06:00

64 linhas
1.6 KiB
C++

#ifndef TESTCHECKS_HPP
#define TESTCHECKS_HPP
#define HIP_CALL(x) ASSERT_EQ(x, hipSuccess)
#define NCCL_CALL(x) ASSERT_EQ(x, ncclSuccess)
#define SYSCHECK_TEST(call, name) do { \
int retval; \
SYSCHECKVAL_TEST(call, name, retval); \
} while (false)
#define SYSCHECKVAL_TEST(call, name, retval) do { \
SYSCHECKSYNC_TEST(call, name, retval); \
if (retval == -1) { \
printf("Call to %s failed : %s\n", name, strerror(errno)); \
fflush(stdout); \
return ncclSystemError; \
} \
} while (false)
#define SYSCHECK_GOTO_TEST(call, name, label) do { \
int retval; \
SYSCHECKVAL_GOTO_TEST(call, name, retval, label); \
} while (false)
#define SYSCHECKVAL_GOTO_TEST(call, name, retval, label) do { \
SYSCHECKSYNC_TEST(call, name, retval); \
if (retval == -1) { \
printf("Call to %s failed : %s\n", name, strerror(errno)); \
fflush(stdout); \
goto label; \
} \
} while (false)
#define SYSCHECKSYNC_TEST(call, name, retval) do { \
retval = call; \
if (retval == -1 && (errno == EINTR || errno == EWOULDBLOCK || errno == EAGAIN)) { \
} else { \
break; \
} \
} while(true)
#define NCCLCHECK_BARRIER_TEST(call, name, rank) do { \
ncclResult_t retval; \
retval = call; \
if (retval != ncclSuccess) { \
printf("Rank %d call to %s failed : %s\n", rank, name, strerror(errno)); \
fflush(stdout); \
return; \
} \
} while (false)
#define NCCLCHECK_TEST(call, name) do { \
ncclResult_t retval; \
retval = call; \
if (retval != ncclSuccess) { \
printf("Call to %s failed : %s\n", name, strerror(errno)); \
fflush(stdout); \
return retval; \
} \
} while (false)
#endif