Two languages, same kernel — read them side by side
This is the kernel you already wrote in lesson 1, now placed inside a complete program with both halves. The micro-pattern (one thread per element, bounds-check with if (idx < N)) is what you'll see inside conv kernels, attention masks, position encodings — everywhere a per-element compute meets parallel hardware.
Build BOTH versions on whatever hardware you have, run both, compare. Note the line count: CUDA has more boilerplate around malloc/memcpy, Metal has more boilerplate around encoder/pipeline setup. Net is similar (~50 lines each). Save both files in a folder named track5_vector_add/; we'll evolve them in the next two lessons.
Progress
Progress is local-only — sign in to sync across devices.