CUDAプログラミングガイド
開発者がNVIDIA GPU上で実行される高性能なコードを書くためのCUDAプログラミングモデルを学ぶための公式で包括的なリソース。このガイドでは、プラットフォームアーキテクチャ、プログラミングインターフェース、高度なハードウェア機能、および技術仕様についてカバーしています。
コース概要
📚 コンテンツ概要
開発者向けの公式で包括的なリソース。NVIDIA GPU上で実行される高性能コードを書くためのCUDAプログラミングモデルについて学ぶことができます。このガイドでは、プラットフォームアーキテクチャ、プログラミングインターフェース、高度なハードウェア機能、技術仕様についてカバーしています。
業界標準のガイドにより、並列計算の芸術を習得しましょう。NVIDIA CUDA
著者: NVIDIA Corporation
謝辞: Copyright © 2007-2024 NVIDIA Corporation および関連会社。すべての権利を保有。
🎯 学習目標
- 異種システムにおけるホスト(CPU)とデバイス(GPU)の役割を定義する。
- SIMTプログラミングモデルとスレッド、ブロック、グリッドの階層的構造を説明する。
- PTX(Parallel Thread Execution)とバイナリコード(cubins)の違いを区別し、ジャストインタイム(JIT)コンパイルが互換性を促進する仕組みを説明する。
- CUDAカーネルの開発とコンパイル:__global__関数の記述、三重矢印表記による実行設定、NVCCコンパイルワークフローの管理。
- メモリとデータ移動の最適化:ユニファイドメモリ、明示的メモリ、マップドメモリのモデルの違いを理解し、効率的な転送のためにページロックされたホストメモリを実装する。
- 並列実行の管理:CUDAストリーム、イベント、コオペラティブグループを使用して非同期タスクを管理し、CPU-GPU間の同期を行う。
- 複雑なポインタ演算を行い、アーキテクチャ上のボトルネック(ヴァン・ノイマン型対ハーバード型)を特定する。
- 高度なCUDA実行パターンを実装する。プログラムによる依存カーネル起動や異種バッチメモリ転送を含む。
- スレッドスコープ、非同期プロキシ、パイプラインといったハードウェア固有の機能を活用し、並行性を最大化する。
- プリフェッチ、使用ヒント、ページサイズ管理を用いてユニファイドメモリのパフォーマンスを設定・チューニングする。
レッスン 共 5 课时 · 预计 30.0h
レッスン
Lesson
This lesson introduces the fundamental shift from latency-optimized CPU architectures to throughput-oriented GPU computing. Students will learn to distinguish between these processing models and understand how the CUDA programming platform enables massive parallel execution for data-intensive tasks.
This lesson introduces the fundamentals of CUDA kernel development, focusing on the SIMT execution model and the use of the __global__ specifier to launch parallel functions on GPU Streaming Multiprocessors. Students will learn how to manage asynchronous kernel execution, handle device memory, and structure code to ensure effective hardware utilization.
This lesson explores the fundamental differences between von Neumann and Harvard architectures, focusing on how memory access pathways impact computational performance. Students will learn to identify the von Neumann bottleneck, understand the benefits of split-cache Harvard designs, and analyze how modern systems utilize a Modified Harvard Architecture to balance throughput with programming flexibility.
AI021: Optimization, Graphs, and Hardware Accelerators (Lesson 4) explores the shift from CPU-bottlenecked stream execution to GPU-autonomous workflows. Students will learn to utilize modern primitives like CUDA Graphs, lazy loading, and asynchronous memory prefetching to minimize host-side overhead and maximize hardware efficiency.
This lesson explores the technical reference and language extensions in CUDA, focusing on the relationship between virtual architectures (PTX) and real hardware (SASS). Students will learn to manage compute capabilities, utilize architecture-specific macros, and navigate language constraints to ensure code portability and performance.