allow using different memory types for input and output buffers

[ROCm/rccl-tests commit: 3f89175af5]
Этот коммит содержится в:
Wenkai Du
2019-05-01 12:58:04 -07:00
родитель 852651be37
Коммит b0e3a2ac64
2 изменённых файлов: 47 добавлений и 5 удалений
+15
Просмотреть файл
@@ -203,6 +203,11 @@ extern ncclDataType_t test_types[ncclNumTypes];
extern const char *test_typenames[ncclNumTypes];
extern ncclRedOp_t test_ops[ncclNumOps];
extern const char *test_opnames[ncclNumOps];
typedef enum { ncclCoarse = 0,
ncclFine = 1,
ncclHost = 2,
nccl_NUM_MTYPES = 3 } ncclMemoryType_t;
extern const char *test_memorytypes[nccl_NUM_MTYPES];
static int ncclstringtotype(char *str) {
for (int t=0; t<ncclNumTypes; t++) {
@@ -230,6 +235,16 @@ static int ncclstringtoop (char *str) {
return ncclSum;
}
static int ncclstringtomtype (char *str) {
for (int o=0; o<nccl_NUM_MTYPES; o++) {
if (strcmp(str, test_memorytypes[o]) == 0) {
return o;
}
}
printf("invalid memorytype %s, defaulting to %s .. \n", str, test_memorytypes[ncclCoarse]);
return ncclCoarse;
}
extern thread_local int is_main_thread;
#define PRINT if (is_main_thread) printf