ROCm/HIPIFY

HIPIFY: Convert CUDA to Portable C++ Code

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 50 minutes ago
Added to GitGenius on August 31st, 2025
Created on March 2nd, 2020
Open Issues & Pull Requests: 36 (+0)
Number of forks: 107
Total Stargazers: 723 (+0)
Total Subscribers: 22 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 22.3 hours
Mean response time: 183.0 days
90th percentile: 671.8 days
Tracked items: 59

How this project is maintained

Around half of the issues opened in the past year never receive a reply. 30% of open issues come from outside the core team, a mix of external reports and the maintainers' own roadmap. Work labelled "feature" is answered fastest, typically in about 6 hours, while "question" waits about 2 days. Only 4% of issues opened in the past year have been closed. Three people close 75% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 23
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 736 days
Stale 30+ days: 22
Stale 90+ days: 21

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • bug (66)
  • feature (57)
  • question (51)
  • clang (27)
  • build (22)
  • perl (17)
  • test (15)
  • failure (12)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

HIPify is a source-to-source translator developed by AMD, designed to automatically convert CUDA code to HIP (Heterogeneous-compute Interface for Portability). HIP is a C++-based programming language and runtime API that allows developers to write portable code that can run on a variety of hardware, including AMD GPUs, NVIDIA GPUs, and CPUs. The primary goal of HIPify is to reduce the effort required to port existing CUDA applications to the AMD ROCm platform, thereby broadening the potential user base for these applications and fostering a more open and competitive heterogeneous computing ecosystem.

At its core, HIPify operates by parsing CUDA source code and applying a series of transformations to replace CUDA-specific constructs with their HIP equivalents. This includes replacing CUDA runtime API calls (like `cudaMalloc`, `cudaMemcpy`) with corresponding HIP API calls (`hipMalloc`, `hipMemcpy`), modifying CUDA kernel launch syntax to align with HIP’s launch parameters, and handling differences in memory models and data types. It doesn't aim for a perfect, fully automated conversion; complex CUDA features or code heavily reliant on NVIDIA-specific extensions may require manual intervention after HIPify's initial pass. However, it significantly accelerates the porting process, handling the majority of common CUDA code patterns.

The repository contains the HIPify tool itself, written in Python, along with a suite of tests and examples. The tool utilizes clang as a frontend for parsing C++ code (CUDA is essentially a dialect of C++). It leverages clang’s Abstract Syntax Tree (AST) representation to identify CUDA constructs and apply the necessary transformations. The tests are crucial for verifying the correctness of the translations and ensuring that HIPify doesn't introduce regressions. The examples demonstrate how to use HIPify on various CUDA code snippets and projects, showcasing its capabilities and limitations. The repository also includes documentation detailing the installation process, usage instructions, and supported CUDA features.

HIPify’s functionality extends beyond simple API replacements. It addresses key differences between CUDA and HIP, such as the handling of shared memory, thread synchronization, and device properties. It attempts to automatically manage these differences, providing a more seamless transition for developers. Furthermore, HIPify supports different levels of conversion. It can perform a basic conversion, replacing only the most obvious CUDA API calls, or a more aggressive conversion that attempts to optimize the code for HIP and ROCm. The level of conversion can be controlled through command-line options.

The project is actively maintained and continuously improved. AMD regularly adds support for new CUDA features and addresses bugs reported by the community. Contributions from external developers are also welcome, fostering a collaborative environment for enhancing the tool's capabilities. HIPify is a vital component of the ROCm ecosystem, enabling developers to leverage the power of AMD GPUs without being locked into the NVIDIA CUDA platform. It represents a significant step towards achieving true portability in heterogeneous computing, allowing code to be written once and run efficiently on a diverse range of hardware.