Add support for testing memory allocated with hipMallocManaged
[ROCm/rccl-tests commit: 3117033150]
Este commit está contenido en:
@@ -32,7 +32,7 @@ const char *test_typenames[ncclNumTypes] = {"char", "int", "half", "float", "dou
|
||||
#endif
|
||||
ncclRedOp_t test_ops[ncclNumOps] = {ncclSum, ncclProd, ncclMax, ncclMin};
|
||||
const char *test_opnames[ncclNumOps] = {"sum", "prod", "max", "min"};
|
||||
const char *test_memorytypes[nccl_NUM_MTYPES] = {"coarse", "fine", "host"};
|
||||
const char *test_memorytypes[nccl_NUM_MTYPES] = {"coarse", "fine", "host", "managed"};
|
||||
|
||||
thread_local int is_main_thread = 0;
|
||||
|
||||
@@ -655,6 +655,11 @@ testResult_t AllocateBuffs(void **sendbuff, size_t sendBytes, void **recvbuff, s
|
||||
HIPCHECK(hipHostMalloc(recvbuff, nbytes));
|
||||
HIPCHECK(hipHostMalloc(expected, recvBytes));
|
||||
}
|
||||
else if (memorytype == ncclManaged) {
|
||||
HIPCHECK(hipMallocManaged(sendbuff, nbytes));
|
||||
HIPCHECK(hipMallocManaged(recvbuff, nbytes));
|
||||
HIPCHECK(hipMallocManaged(expected, recvBytes));
|
||||
}
|
||||
else {
|
||||
HIPCHECK(hipMalloc(sendbuff, nbytes));
|
||||
HIPCHECK(hipMalloc(recvbuff, nbytes));
|
||||
@@ -813,7 +818,7 @@ int main(int argc, char* argv[]) {
|
||||
"[-d,--datatype <nccltype/all>] \n\t"
|
||||
"[-r,--root <root>] \n\t"
|
||||
"[-z,--blocking <0/1>] \n\t"
|
||||
"[-y,--memory_type <coarse/fine/host>] \n\t"
|
||||
"[-y,--memory_type <coarse/fine/host/managed>] \n\t"
|
||||
"[-s,--stress_cycles <number of cycles>] \n\t"
|
||||
"[-u,--cumask <d0,d1,d2,d3>] \n\t"
|
||||
"[-h,--help]\n",
|
||||
|
||||
@@ -212,7 +212,8 @@ extern const char *test_opnames[ncclNumOps];
|
||||
typedef enum { ncclCoarse = 0,
|
||||
ncclFine = 1,
|
||||
ncclHost = 2,
|
||||
nccl_NUM_MTYPES = 3 } ncclMemoryType_t;
|
||||
ncclManaged = 3,
|
||||
nccl_NUM_MTYPES = 4 } ncclMemoryType_t;
|
||||
extern const char *test_memorytypes[nccl_NUM_MTYPES];
|
||||
|
||||
static int ncclstringtotype(char *str) {
|
||||
|
||||
Referencia en una nueva incidencia
Block a user