0Pricing
CUDA Academy · บทเรียน

SIMT: คำสั่งเดียว หลายเธรด

รูปแบบการประมวลผลที่ทำให้ GPU ทำงานได้รวดเร็ว

SIMT: คำสั่งเดียว หลายเธรด เป็นบทเรียน CUDA Academy ฟรีบน CoddyKit นี่คือบทเรียนที่ 2 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน CUDA Academy และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส CUDA Academy มีบทเรียนทั้งหมด 4 บทเรียน

บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ

How the GPU Stays Busy

Thousands of cores need a smart way to be told what to do. The GPU's answer is SIMT: Single Instruction, Multiple Threads. ⚡

One Instruction, Many Threads

In SIMT, one instruction is broadcast to a whole group of threads at once. Each thread runs that same step, but on its own piece of data.

Same Recipe, Different Ingredients

Picture a kitchen where every cook follows the exact same recipe step, but each works on a different plate. That shared step is your instruction. 🍳

Meet the Warp

The GPU groups threads into bundles of 32 called a warp. A warp is the real unit that executes together, lockstep, one instruction at a time.

Why Bundles of 32

Issuing one instruction for 32 threads at once is far cheaper than 32 separate commands. That sharing is exactly where the GPU's efficiency comes from.

Each Thread Has Its Own Data

Threads in a warp share the instruction but keep private registers. So thread 0 and thread 5 run the same add, just on different numbers.

SIMT Is Not Quite SIMD

Classic SIMD processes fixed-width vectors. SIMT keeps the idea of shared instructions but lets each thread behave more independently when needed.

The Problem of Branches

What if half a warp takes an if branch and half does not? Threads in a warp want to march together, so a branch can split the group apart.

if (x > 0) {
  y = x * 2;
} else {
  y = -x;
}

Warp Divergence

When threads in a warp disagree on a branch, the warp runs each path in turn and disables the others. This serial replay is called divergence.

Divergence Costs Speed

Because divergent paths run one after another, you lose parallelism. Keeping a warp on the same path is a key idea for fast kernels.

Why SIMT Scales So Well

With one instruction feeding 32 threads, and many warps in flight, the GPU keeps its math units packed. That is how SIMT turns into raw throughput.

Quick Check

Let us make sure the SIMT vocabulary is solid.

Recap: SIMT

SIMT broadcasts one instruction to a warp of 32 threads, each on its own data. Avoid divergent branches to keep every thread marching together. 👍

คำถามที่พบบ่อย

บทเรียน “SIMT: คำสั่งเดียว หลายเธรด” ฟรีหรือไม่

ใช่ — ข้อความเต็มของ “SIMT: คำสั่งเดียว หลายเธรด” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส CUDA Academy ให้อัปเกรดเป็น CoddyKit PRO คอร์ส CUDA Academy มีบทเรียนทั้งหมด 4 บทเรียน

คุณจะเรียนรู้อะไรในบทเรียน “SIMT: คำสั่งเดียว หลายเธรด”

รูปแบบการประมวลผลที่ทำให้ GPU ทำงานได้รวดเร็ว คุณปฏิบัติ CUDA Academy ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน

คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน CUDA Academy หรือไม่

ไม่จำเป็นต้องมีประสบการณ์มาก่อน CUDA Academy บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 2 จากทั้งหมด 4 บทเรียน

บทเรียน “SIMT: คำสั่งเดียว หลายเธรด” ใช้เวลานานแค่ไหน

บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย

ฉันเขียนและรันโค้ดในบทเรียน CUDA Academy นี้ได้ไหม

ได้ บทเรียน CUDA Academy ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ

บทเรียนทั้งหมดในหลักสูตรนี้

  1. CPU เทียบกับ GPU: เวลาแฝงเทียบกับอัตราการประมวลผล
  2. SIMT: คำสั่งเดียว หลายเธรด
  3. CUDA คืออะไรในความเป็นจริง
  4. ปัญหาที่เหมาะกับ GPU
← กลับไปที่ CUDA Academy