0Pricing
CUDA Academy · درس

لماذا توجد الكتل

الاستقلالية والجدولة وقابلية التوسع.

لماذا توجد الكتل درس مجاني في CUDA Academy على CoddyKit. هذا هو الدرس 3 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في CUDA Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة CUDA Academy 4 دروس في المجموع.

بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.

Why Not Just Threads?

You might wonder why CUDA bothers grouping threads into blocks at all. The answer is about scheduling and scaling. 🤔

Blocks Are the Unit of Scheduling

The GPU hands out whole blocks to its streaming multiprocessors. A block is the chunk of work the hardware schedules as one piece.

Independence by Design

Blocks must run independently, in any order, with no guaranteed communication. This rule is what makes a kernel portable across GPUs.

Scalability for Free

A small GPU runs a few blocks at a time; a big one runs many. Independence lets the same code scale without you changing a line.

Cooperation Within a Block

Threads in the same block share fast on-chip memory and can synchronize. That tight teamwork is only possible because they stay together.

The Sync Boundary

A barrier like __syncthreads only works inside a block. There is no built-in way to sync across the whole grid mid-kernel.

__syncthreads();

Why No Global Sync?

If blocks could all wait on each other, the GPU could deadlock when it cannot fit them at once. Keeping blocks independent avoids that.

Blocks Hide Latency

When one block stalls on memory, the scheduler swaps in another ready block. Having many blocks keeps the cores busy.

Resources Are Per Block

Registers and shared memory are allotted per block. Smaller blocks let more of them fit on a multiprocessor at the same time.

Plenty of Blocks Is Good

A healthy launch uses many more blocks than the GPU has multiprocessors. Extra blocks give the scheduler room to balance work.

The Big Tradeoff

So blocks trade global cooperation for huge scalability. You give up cross-block sync and gain code that runs on any GPU.

Quick Check

Think about what block independence buys you.

Recap: The Point of Blocks

You saw why blocks exist: they are the schedulable, independent unit that delivers scalability, while threads inside cooperate closely. 🚀

الأسئلة الشائعة

هل درس «لماذا توجد الكتل» مجاني؟

نعم — نص درس «لماذا توجد الكتل» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة CUDA Academy، انتقل إلى CoddyKit PRO. تتضمن دورة CUDA Academy 4 دروس في المجموع.

ماذا ستتعلم في «لماذا توجد الكتل»؟

الاستقلالية والجدولة وقابلية التوسع. تتمرن على CUDA Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.

هل أحتاج إلى خبرة سابقة لأبدأ CUDA Academy؟

لا تُشترط خبرة سابقة. CUDA Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 3 من أصل 4.

كم من الوقت يستغرق درس «لماذا توجد الكتل»؟

معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.

هل يمكنني كتابة وتشغيل أكواد في درس CUDA Academy هذا؟

نعم. كل درس في CUDA Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.

جميع الدروس في هذه الدورة

  1. هرمية الخيوط
  2. threadIdx وblockIdx وblockDim
  3. لماذا توجد الكتل
  4. اختيار عدد الخيوط لكل كتلة
← العودة إلى CUDA Academy