Programming guide#
2024-11-18
4 min read time
ROCm provides a robust environment for heterogeneous programs running on CPUs and AMD GPUs. ROCm supports various programming languages and frameworks to help developers access the power of AMD GPUs. The natively supported programming languages are HIP (Heterogeneous-Compute Interface for Portability) and OpenCL, but HIP bindings are available for Python and Fortran.
HIP is an API based on C++ that provides a runtime and kernel language for GPU programming and is the essential ROCm programming language. HIP is also designed to be a marshalling language, allowing code written for NVIDIA CUDA to be easily ported to run on AMD GPUs. Developers can use HIP to write kernels that execute on AMD GPUs while maintaining compatibility with CUDA-based systems.
OpenCL (Open Computing Language) is an open standard for cross-platform, parallel programming of diverse processors. ROCm supports OpenCL for developers who want to use standard frameworks across different hardware platforms, including CPUs, GPUs, and other accelerators. For more information, see OpenCL.
Python bindings can be found at ROCm/hip-python. Python is popular in AI and machine learning applications due to available frameworks like TensorFlow and PyTorch.
Fortran bindings can be found at ROCm/hipfort. It enables scientific, academic, and legacy applications, particularly those in high-performance computing, to run on AMD GPUs via HIP.
For a complete description of the HIP programming language, see the HIP programming guide.