
Write Your First SSE Intrinsics Loop With _mm_add_ps
Add two float arrays of any length with SSE intrinsics in C: a four-wide main loop, a scalar tail, unaligned loads and the assembly you should see.
Allocators, cache-friendly data layout, profiling with perf, VTune and Instruments, benchmarking that means something, and memory safety without losing speed.

Add two float arrays of any length with SSE intrinsics in C: a four-wide main loop, a scalar tail, unaligned loads and the assembly you should see.

Learn what SIMD means, how a vector register splits into lanes, and how C intrinsics map to instructions, with a first program that adds four floats at once.

Reserve 1 GiB huge pages at boot on Linux with the hugepagesz=1G and hugepages= kernel parameters, check the pdpe1gb flag, and verify the pool in /proc/meminfo.

Ask the CUDA runtime for a block size that maximizes theoretical occupancy with cudaOccupancyMaxPotentialBlockSize, and learn why you must still time it.

Pin a process and its memory to one NUMA node with numactl --cpunodebind and --membind, compare it with --interleave and --preferred, and verify placement.

Read a machine's NUMA nodes, per-node memory and distance matrix with numactl --hardware, then see caches and devices with lstopo from hwloc on Linux.

Build and run the STREAM benchmark with gcc and OpenMP to measure sustainable memory bandwidth, size the arrays so they miss cache, and read the four kernels.

Label phases of a CUDA program with NVTX push and pop ranges, the C++ scoped_range helper and domains, so Nsight Systems shows your names beside the kernels.

NUMA gives each CPU socket its own local memory, so a core reads its own memory fastest and pays extra to reach another socket's. Learn why and how to see it.

Run ncu on one kernel, pick sections like SpeedOfLight and WarpStateStats, read the results and follow the rules for turning counters into a specific fix.

Latency is the wait for one memory access and bandwidth is bytes moved per second. See how they differ, how Little's law links them and which limits your loop.

Capture a CUDA timeline with nsys profile, read kernel, copy and API rows, find gaps and serialized streams, and print summary tables from the command line.
We send one email when a new post is published. No spam.