diff options
| author | tylov <[email protected]> | 2023-08-19 21:46:52 +0200 |
|---|---|---|
| committer | tylov <[email protected]> | 2023-08-19 21:46:52 +0200 |
| commit | 7ae6e4d155e9c4835d2dbf80f6e27873b7c7439a (patch) | |
| tree | 2a8659151be779dfee268b3b99b12f23f4e647b2 /misc | |
| parent | ac7afe963527eb66a12962c638242f0426b39575 (diff) | |
| download | STC-modified-7ae6e4d155e9c4835d2dbf80f6e27873b7c7439a.tar.gz STC-modified-7ae6e4d155e9c4835d2dbf80f6e27873b7c7439a.zip | |
Optimized cspan_next(): awesome speedup on gcc.
Diffstat (limited to 'misc')
| -rw-r--r-- | misc/benchmarks/various/cspan_bench.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/misc/benchmarks/various/cspan_bench.c b/misc/benchmarks/various/cspan_bench.c index f4b067f8..b5caca83 100644 --- a/misc/benchmarks/various/cspan_bench.c +++ b/misc/benchmarks/various/cspan_bench.c @@ -49,9 +49,8 @@ static void TraditionalForLoop(intptr_t n) for (int x = lx; x < hx; ++x) { for (int y = ly; y < hy; ++y) { for (int z = lz; z < hz; ++z) { - int i = nz*(ny*x + y) + z; - double d = Vin[i]; - Vout[i] += d; + double d = Vin[nz*(ny*x + y) + z]; + Vout[nz*(ny*x + y) + z] += d; sum += d; } } |
