Skip to content

Commit

Permalink
index: Revert to !strncmp
Browse files Browse the repository at this point in the history
This fix is a bit of a guess. aarch64, MacOS, and Win CI tests all fail
after I changed the comparison from `!` to `!= 0`.

Signed-off-by: Johannes Demel <[email protected]>
  • Loading branch information
jdemel committed Oct 2, 2021
1 parent 0b40c5f commit 82dfe81
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/volk_rank_archs.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ int volk_search_index(const char* impl_names[],
{
unsigned int i;
for (i = 0; i < n_impls; i++) {
if (strncmp(impl_names[i], impl_name, 42) != 0) {
if (!strncmp(impl_names[i], impl_name, 42)) {
return i;
}
}
Expand All @@ -60,10 +60,10 @@ int volk_get_index(const char* impl_names[], // list of implementations by name
idx = volk_search_index(impl_names, n_impls, "generic");
if (idx >= 0) {
fprintf(stderr, "Volk warning: no arch found, returning generic impl\n");
return idx;
} else {
fprintf(stderr, "Volk ERROR: no arch found. generic impl missing!\n");
}
fprintf(stderr, "Volk warning: no arch found, returning -1 aka not found!\n");
return -1;
return idx;
}

int volk_rank_archs(const char* kern_name, // name of the kernel to rank
Expand Down

0 comments on commit 82dfe81

Please sign in to comment.