Types
PrefetchLocality {.size: 4.} = enum NoTemporalLocality = 0, LowTemporalLocality = 1, ModerateTemporalLocality = 2, HighTemporalLocality = 3
- Source Edit
PrefetchRW {.size: 4.} = enum Read = 0, Write = 1
- Source Edit
Consts
LASER_MEM_ALIGN {.intdefine.} = 64
- Source Edit
Templates
template assume_aligned[T](data: ptr T; alignment: static int = LASER_MEM_ALIGN): ptr T
- Source Edit
template prefetch[T](data: ptr (T or UncheckedArray[T]); rw: static PrefetchRW = Read; locality: static PrefetchLocality = HighTemporalLocality)
-
Prefetch examples:
- https://scripts.mit.edu/~birge/blog/accelerating-code-using-gccs-prefetch-extension/
- https://stackoverflow.com/questions/7327994/prefetching-examples
- https://lemire.me/blog/2018/04/30/is-software-prefetching-__builtin_prefetch-useful-for-performance/
- https://www.naftaliharris.com/blog/2x-speedup-with-one-line-of-code/
template withCompilerOptimHints()
- Source Edit