Commit 7813f26c authored by Luca Tornatore's avatar Luca Tornatore
Browse files

housekeeping

parent 93292c76
Loading
Loading
Loading
Loading
+1 −27
Changes for Single_Core_Optimization/examples/prefetching/ex_2__prefetching_by_pattern/README.md: 1 added line, 27 removed lines.
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ ones.
  and gets close to gcc's. Too short (256 B) is useless, too long (4 kB) worse
  again.
- On the same machine with the `powersave` profile, a prefetch 1–4 kB ahead gave
  +20–30% (review of 2026-10-02). There the core slows down its clock while it
  +20–30% . There the core slows down its clock while it
  waits for memory, and a loop that issues its loads late loses more. Always
  report the power profile with such numbers.

@@ -91,32 +91,6 @@ compiler can vectorise and that does not chain its additions. The hardware
prefetchers do the rest. Explicit prefetching is for irregular patterns, such
as `prefetching/ex_1` (binary search) and `prefetching/ex_3` (linked list).

### What changed in the code (2026-10-04)

- Fixed (all the versions printed wrong sums for some N):
  - v2 lost the last group of 4;
  - v3 and v4 started from the second group (elements 1–4 were never summed),
    and read past the end;
  - v5 and v6 read past the end, added an extra vector when N/4 was odd, and
    lost the final N % 8 elements;
  - v1 had an unused load.
- v1b was a standalone program with the old PAPI API (removed in PAPI 6); it is
  now a kernel that keeps the unused pre-load on purpose.
- New v7: a real software prefetch, with the distance as a parameter, and its
  control without prefetch.
- `prefetching2.vall.c`:
  - allocation sizes rounded to the alignment;
  - the kernel file is given by the Makefile (clang could not build the old
    `#include` trick);
  - each version prints its own label;
  - the transfer rate counts the bytes read once, in GB (10^9), and prints the %
    of a theoretical peak only with `-D_MEM_CLOCK=...` (it compared with
    hard-coded DDR3 numbers);
  - the cache wipe reads instead of writing, so no dirty lines are written back
    while the next timed loop runs.
- The same fixes in `prefetching2.v0.c`.
- `register` arrays removed (clang refuses them). New `Makefile`; `compile` calls
  it.

## Exercises