mirror of
https://github.com/NVIDIA/nccl-tests.git
synced 2026-04-25 08:58:18 +08:00
Future-proof ncclstringtotype
Ensure that ncclstringtotype iterates only over data types known to nccl-tests (as indicated by test_typenum), not over a potentially larger set of all NCCL types.
This commit is contained in:
parent
9d26b8422b
commit
34d6d53910
@ -254,7 +254,7 @@ extern ncclRedOp_t test_ops[];
|
||||
extern const char *test_opnames[];
|
||||
|
||||
static int ncclstringtotype(char *str) {
|
||||
for (int t=0; t<ncclNumTypes; t++) {
|
||||
for (int t=0; t<test_typenum; t++) {
|
||||
if (strcmp(str, test_typenames[t]) == 0) {
|
||||
return t;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user