# Foundations

<!-- https://learn-kernels.com/chapters/foundations -->

A kernel is a function launched as thousands to millions of threads at once. Everything in the rest of this book, tiling, occupancy, coalescing, roofline analysis, is a consequence of how those threads are grouped and where the data they touch actually lives.

## 4 sections

1.  [1.1Threads, blocks, and warps](https://learn-kernels.com/chapters/foundations/threads-blocks-and-warps)
2.  [1.2Compute-bound and memory-bound](https://learn-kernels.com/chapters/foundations/compute-bound-and-memory-bound)
3.  [1.3The KV cache](https://learn-kernels.com/chapters/foundations/the-kv-cache)
4.  [1.4Compilation and machine code](https://learn-kernels.com/chapters/foundations/compilation-and-machine-code)
