6 lines
1.6 KiB
HTML
6 lines
1.6 KiB
HTML
<!doctype html><html lang="en"><meta charset="utf-8"><title>GPU buffers and transfer cost</title><h1>GPU buffers and transfer cost</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>Discrete GPUs often have device memory separate from host RAM. Uploads, downloads, launch overhead, and synchronization can dominate a small kernel. Unified memory changes the API but does not make movement free. Pinned host memory is a limited resource. The sample uses explicitly hypothetical timings; it illustrates accounting, not hardware performance.</p><p><strong>Practice and evidence:</strong> Predict the example or draw its state transitions. Change one assumption, test the boundary, and record the actual result. Explain what this small model does not establish about a production system.</p><pre><code class="language-python">cpu_ms=8
|
|
upload_ms,kernel_ms,download_ms=5,2,4
|
|
print("Hypothetical GPU total:",upload_ms+kernel_ms+download_ms)
|
|
print("Hypothetical CPU total:",cpu_ms)
|
|
</code></pre><p><strong>Expected result:</strong> <code>Hypothetical GPU total: 11
|
|
Hypothetical CPU total: 8</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://git.agilaos.com/matt/open_agx">Language reference: git.agilaos.com</a></p><p><a href="https://docs.nvidia.com/cuda/cuda-c-best-practices-guide/">Language reference: docs.nvidia.com</a></p></html> |