返回課程
AI022 專業人士

AMD HIP 程式設計指南

一份完整的技術手冊,介紹異構計算介面可移植性(HIP)。它提供 C++ 執行時 API 與核心語言,讓開發者能從單一原始碼建立可在 AMD 與 NVIDIA GPU 上執行的可攜式應用程式。本指南涵蓋安裝、環境設定、程式設計模型、記憶體配置,以及將 CUDA 程式碼轉換至 HIP 的工具。

4.9
12.0h
841 學習者
4 lessons
0 讚好
人工智能
開始學習

課程總覽

📚 內容摘要

一份針對異質運算介面可攜性(HIP)的完整技術手冊。它提供 C++ 執行時 API 與內核語言,讓開發者能從單一原始碼建立可在 AMD 與 NVIDIA GPU 上執行的可攜應用程式。本指南涵蓋安裝、環境設定、程式設計模型、記憶體配置,以及將 CUDA 程式碼轉換至 HIP 所需的工具。

掌握可攜式 GPU 程式設計:一套原始碼適用於 AMD 與 NVIDIA 平台。

作者: Advanced Micro Devices, Inc.(AMD)

致謝: AMD、AMD Arrow 商標、AMD Instinct、Radeon、ROCm 及其組合均為 Advanced Micro Devices, Inc. 之商標。Linux 為 Linus Torvalds 之註冊商標。PCIe 為 PCI-SIG Corporation 之註冊商標。

🎯 學習目標

  1. 定義 HIP 框架的主要特性與價值主張。
  2. 示範如何使用系統工具存取與查詢 HIP 環境。
  3. 解釋 HIP 可攜性與其編譯器技術之間的架構關係。
  4. 執行針對 NVIDIA 與 AMD 環境的平台特定安裝。
  5. 協調多來源庫的建置流程,以從原始碼編譯 HIP。
  6. 使用系統設定與驗證工具確認安裝成功。
  7. 配置與管理 GPU 記憶體,包含 HIP 記憶體配置、一致性控制與零複製主機記憶體可見性。
  8. 使用 HIP 特有的函數/變數修飾符、向量類型與同步原語開發高效率核心程式。
  9. 利用波長內操作(warp shuffle)、投票(vote)、投標(ballot)與合作群組功能實作進階平行演算法。
  10. 使用 HIPIFY 工具自動轉換 CUDA 程式碼至 HIP,並管理就地專案轉換。

課程

Lesson

This lesson introduces the multi-vendor dilemma in high-performance computing, where hardware heterogeneity and proprietary APIs create software fragmentation and maintenance debt. Students will learn how the HIP framework addresses these challenges by enabling performance portability and simplifying the transition between different GPU architectures.

This lesson covers the installation and configuration of the Heterogeneous-compute Interface for Portability (HIP) environment, focusing on the single-source paradigm for cross-platform GPU development. Students will learn how to manage environment variables like CUDA_PATH and HIP_PATH to enable the hipcc compiler to route code effectively across NVIDIA and AMD hardware architectures.

AI022: HIP Programming Model and API Deep Dive (Lesson 3) explores the architectural foundations of the HIP ecosystem, focusing on the ROCm stack, hardware discovery, and the porting workflow from CUDA to AMD architectures. Students will learn to utilize the hipify-perl and hipcc toolchains, manage low-level HSA runtime initialization, and implement effective memory mapping for GPU resource orchestration.

This lesson explores the Heterogeneous-compute Interface for Portability (HIP), a C++ runtime API designed to enable cross-platform GPU development by abstracting hardware layers for both NVIDIA and AMD systems. Students will learn how to configure the HIP environment, utilize the hipcc compiler, and apply functional mappings to migrate legacy CUDA applications to a unified, portable codebase.