fix benchmark?

This commit is contained in:
Mylloon 2024-04-18 17:20:50 +02:00
parent 3b8d9e03cd
commit 75fdb1260b
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -99,21 +99,22 @@ int benchmark(int argc, char **argv) {
break; break;
case 'n': case 'n':
n = atoi(optarg); n = atoi(optarg);
if (n <= 0) {
goto usage;
}
break; break;
case 't': case 't':
nthreads = atoi(optarg); nthreads = atoi(optarg);
if (nthreads <= 0) {
goto usage;
}
break; break;
default: default:
goto usage; goto usage;
} }
} }
if (n <= 0) {
goto usage;
}
if (nthreads < 0 && !serial) {
goto usage;
}
a = malloc(n * sizeof(int)); a = malloc(n * sizeof(int));
unsigned long long s = 0; unsigned long long s = 0;