<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Parallel-Computing on Sanketh's Blog</title><link>https://sankethbk.github.io/blog/tags/parallel-computing/</link><description>Recent content in Parallel-Computing on Sanketh's Blog</description><generator>Hugo -- 0.166.0</generator><language>en-us</language><lastBuildDate>Sun, 30 Aug 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://sankethbk.github.io/blog/tags/parallel-computing/index.xml" rel="self" type="application/rss+xml"/><item><title>CUDA Programming Model: Writing and Launching Kernels</title><link>https://sankethbk.github.io/blog/posts/gpu/2026-08-30-2-cuda-programming-model/</link><pubDate>Sun, 30 Aug 2026 00:00:00 +0000</pubDate><guid>https://sankethbk.github.io/blog/posts/gpu/2026-08-30-2-cuda-programming-model/</guid><description>&lt;h1 id="cuda-programming-model-writing-and-launching-kernels"&gt;CUDA Programming Model: Writing and Launching Kernels&lt;/h1&gt;
&lt;p&gt;The &lt;a href="https://sankethbk.github.io/blog/gpu/2026-08-30-cuda-thread-hierarchy"&gt;previous note&lt;/a&gt; covered the hierarchy: thread, warp, block, grid, and how those map to SMs. This note turns that hierarchy into actual code. By the end, you will have seen a complete CUDA program, understood every line, and know how a host program hands work to the GPU.&lt;/p&gt;
&lt;p&gt;CUDA is an extension of C/C++. Most of the code you write is ordinary C++. A small number of CUDA-specific pieces — kernel functions, the launch syntax, a few memory APIs, and built-in thread indices — turn a sequential program into a massively parallel one.&lt;/p&gt;</description></item><item><title>CUDA Thread Hierarchy: Grids, Blocks, Warps, and Threads</title><link>https://sankethbk.github.io/blog/posts/gpu/2026-08-30-1-cuda-thread-hierarchy/</link><pubDate>Sun, 30 Aug 2026 00:00:00 +0000</pubDate><guid>https://sankethbk.github.io/blog/posts/gpu/2026-08-30-1-cuda-thread-hierarchy/</guid><description>&lt;h1 id="cuda-thread-hierarchy-grids-blocks-warps-and-threads"&gt;CUDA Thread Hierarchy: Grids, Blocks, Warps, and Threads&lt;/h1&gt;
&lt;p&gt;The &lt;a href="https://sankethbk.github.io/blog/gpu/2026-08-29-anatomy-of-a-gpu"&gt;previous note&lt;/a&gt; mapped the hardware: SM, warp scheduler, register file, shared memory, L2, device memory. This note maps the &lt;em&gt;software abstraction&lt;/em&gt; CUDA exposes on top of that hardware. The two maps fit together almost one-to-one, and once you see how, most of CUDA stops being arbitrary syntax and becomes named hardware concepts.&lt;/p&gt;
&lt;p&gt;CUDA organizes parallel work into four nested levels:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Grid
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; └── Block (threads in a block can share fast on-chip memory, and sync)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; └── Warp (32 threads, executed in lockstep on the hardware)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; └── Thread (your kernel code, from one thread&amp;#39;s point of view)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This note works from the bottom up: start with the thread (the thing you actually program), then warp, then block, then grid, then show how the whole tower maps onto the GPU die.&lt;/p&gt;</description></item><item><title>CPU vs GPU Architecture</title><link>https://sankethbk.github.io/blog/posts/gpu/2026-08-29-cpu-vs-gpu/</link><pubDate>Sat, 29 Aug 2026 00:00:00 +0000</pubDate><guid>https://sankethbk.github.io/blog/posts/gpu/2026-08-29-cpu-vs-gpu/</guid><description>&lt;h1 id="cpu-vs-gpu-architecture"&gt;CPU vs GPU Architecture&lt;/h1&gt;
&lt;h2 id="why-gpus-exist"&gt;Why GPUs exist&lt;/h2&gt;
&lt;p&gt;For decades, single-thread CPU performance improved &amp;ldquo;for free&amp;rdquo; — you write the same sequential code, and it runs faster on the next generation of chips, because clock speeds kept climbing.&lt;/p&gt;
&lt;p&gt;Around the mid-2000s, that stopped. Clock speeds hit a &lt;strong&gt;power wall&lt;/strong&gt; — you can&amp;rsquo;t keep cranking frequency without the chip melting. So the industry pivoted from &amp;ldquo;make one core faster&amp;rdquo; to &amp;ldquo;put more cores on the chip.&amp;rdquo; This is the multicore/manycore shift, and it&amp;rsquo;s the reason parallel programming stopped being a niche HPC skill and became something every programmer eventually runs into.&lt;/p&gt;</description></item></channel></rss>