๐Ÿ”ฅโ€นAct I ยท Cold Boot
โœฆ 0 XP
Chapter 1 / 8

Energize the cores

New here? Read the 60-sec briefing โ†—

1,024 cores sit cold and dark. Each one is a single GPU thread, waiting for an instruction. Wake them: every core grabs one reading from the input buffer and doubles its energy.

This is the map pattern, one thread per element, the most fundamental GPU operation. The same shape powers a per-pixel image filter.

โ†ณ Recall: i is this core's own global index, its one slot in the buffer. briefing โ†—

GRID โ†’ BLOCKS โ†’ THREADS
block 00123block 10123block 20123

The grid is split into blocks; each block holds the same threads (here 4). block_idx says which block, thread_idx says which thread inside it (0..3). Global index i = block_dim ร— block_idx + thread_idx. Highlighted: block 1, thread 2 โ†’ 4ร—1 + 2 = 6.

YOUR TASK
  1. 1The thread index i is already computed for you.
  2. 2Inside the guard, write the doubled value to out[i].
๐Ÿ’ก Each core touches exactly one element: out[i] = inp[i] * 2.0
core_01_map.mojo
PUZZLE 1 ยท MAP
Clear all 8 chapters to forgeโšก Cold Boot Core Shard