0Pricing
CUDA Academy · درس

مقيّد بالحساب مقابل مقيّد بالذاكرة

اقرأ مخطط السقف للتخطيط للإصلاحات.

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

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

Two Kinds of Limit

Every kernel hits one of two walls. It is either compute-bound, limited by math, or memory-bound, limited by data movement. ⚖️

Compute-Bound, Defined

A compute-bound kernel keeps the math units busy and rarely waits on memory. Its limit is raw arithmetic throughput.

Memory-Bound, Defined

A memory-bound kernel spends its time waiting for data. The cores sit idle while bytes crawl in from global memory.

Arithmetic Intensity

The key ratio is arithmetic intensity: math operations done per byte loaded. High intensity leans compute, low leans memory.

The Roofline Picture

On a roofline plot, low-intensity kernels hit the sloped memory ceiling, while high-intensity ones hit the flat compute ceiling.

Why Diagnosis Matters

Fixing the wrong wall wastes effort. Adding math to a memory-bound kernel changes nothing; you must cut data traffic instead.

Fixing Memory-Bound Kernels

To speed a memory-bound kernel, coalesce accesses, reuse data in shared memory, and cache values to read less.

Fixing Compute-Bound Kernels

For compute-bound work, raise parallelism, use faster math, or reach for tensor cores to push past the math ceiling.

Most Kernels Are Memory-Bound

In practice, the majority of CUDA kernels are memory-bound. Bandwidth, not arithmetic, is usually the scarce resource.

Let the Profiler Decide

Do not guess the wall. The roofline in Nsight Compute places your kernel under the correct ceiling for you.

A Simple Mental Test

Ask one question: are the cores or the memory pipes closer to peak? Whichever is saturated names your bound.

Quick Check

A kernel has very low arithmetic intensity.

Recap

Diagnose the wall first: memory-bound kernels need less traffic, compute-bound ones need more math. The roofline tells you which. 👏

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

هل درس «مقيّد بالحساب مقابل مقيّد بالذاكرة» مجاني؟

نعم — نص درس «مقيّد بالحساب مقابل مقيّد بالذاكرة» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 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. العرض الزمني في Nsight Systems
  2. مقاييس النواة في Nsight Compute
  3. مقيّد بالحساب مقابل مقيّد بالذاكرة
  4. إضافة تعليقات إلى الكود باستخدام NVTX
← العودة إلى CUDA Academy