UBUNTU(1)

πŸ“¦ version 10.0, in ubuntu stonking

πŸ¦‹ NAME πŸ¦‹

Ubuntu β€” CUDA to HIP source translator. That's it, that's the name, that's the whole job description bestie πŸ’–


✨ DESCRIPTION ✨

Okay so here's the vibe: you feed it CUDA, it hands you back HIP. It's giving glow-up machine, fr fr.

The USAGE goes a little something like this:

hipify-clang [options] <source0> [... <sourceN>]

And then there's OPTIONS, which is a lot, so buckle up πŸŽ€

πŸ’… CUDA to HIP source translator options πŸ’…

  • -- β€” the divider between hipify-clang options and clang options. Don't put it in there if you've got no clang options, okay? it's not decor, it's a boundary 🫢
  • -D <macro>=<value> β€” defines macro as value, or just as 1 if you straight up didn't give it a value. lowkey generous of it.
  • -I <directory> β€” adds a directory to the include search path so it can actually find your stuff πŸ”
  • --amap β€” "as much as possible" energy: it tries to hipify everything it can, and it ignores 'default-preprocessor'. obsessed with the ambition ngl.
  • --clang-resource-directory=<directory> β€” the clang resource path, aka the path to the parent folder of the 'include' folder, and that folder is where '__clang_cuda_runtime_wrapper.h' and the other header files used on runtime live 🏠
  • --csv β€” generate documentation in CSV format πŸ“Š
  • --cuda-gpu-arch=<value> β€” CUDA GPU architecture, like sm_35. You can specify it more than once, it's not a one-and-done situation πŸ’…
  • --cuda-kernel-execution-syntax β€” keeps CUDA kernel launch syntax exactly as it is (this one's the default, so it's already serving)
  • --cuda-path=<directory> β€” where CUDA is installed πŸ“
  • --default-preprocessor β€” turns on default preprocessor behaviour (it's synonymous with '--skip-excluded-preprocessor-conditional-blocks', they're twins ✨)
  • --doc-format=<value> β€” documentation format: 'full' (the default), 'strict', or 'compact'. Heads up: you must also specify the '--md' or '--csv' option, no exceptions 🚨
  • --doc-roc=<value> β€” ROC documentation generation: 'skip' (default), 'separate', or 'joint'. Same deal, the '--md' or '--csv' option must be specified 🚨
  • --examine β€” the combo meal: it combines the '-no-output' and '-print-stats' options πŸ“
  • --experimental β€” hipifies the HIP APIs that are experimentally supported. And if you don't use it? the corresponding warnings get emitted at you πŸ’€
  • --extra-arg=<string> β€” an extra argument appended to the compiler command line
  • --extra-arg-before=<string> β€” an extra argument prepended to the compiler command line. before, bestie, not after, this is the whole point of it 😀
  • --hip-kernel-execution-syntax β€” transforms CUDA kernel launch syntax into a regular HIP function call. It overrides '--cuda-kernel-execution-syntax', so it wins the argument, periodt πŸ‘‘
  • --hipdnn β€” enable/disable hipDNN hipification support. Disabled by default, so it's just sitting there waiting for you.
  • --inplace β€” modifies the input file in-place. Careful, that's your original, no take-backs πŸ™ˆ
  • --local-headers β€” enables hipification of quoted local headers (non-recursive, so it stays in its lane)
  • --local-headers-recursive β€” enables hipification of quoted local headers recursively. it goes all the way down πŸŒ€
  • --md β€” generate documentation in Markdown format ✍️
  • --miopen β€” translates to 'miopen' instead of 'hip' wherever it possibly can
  • --no-backup β€” skips making a backup file for the hipified source. brave. iconic. slightly terrifying 🫣
  • --no-output β€” writes zero translated output to stdout, silent main character energy 🀫
  • --no-undocumented-features β€” does not rely on undocumented features in code transformation. playing it safe, we respect it.
  • --no-warnings-on-undocumented-features β€” suppresses the warnings about undocumented features in code transformation. the "I don't want to hear it" option πŸ’œ
  • -o <filename> β€” output filename
  • --o-dir=<directory> β€” output directory
  • --o-hipify-perl-dir=<directory> β€” output directory, specifically for the hipify-perl script
  • --o-python-map-dir=<directory> β€” output directory, specifically for the Python map
  • --o-stats=<filename> β€” output filename for statistics πŸ“ˆ
  • -p <string> β€” build path (more on this below, don't scroll past it)
  • --perl β€” generate hipify-perl πŸͺ
  • --print-stats β€” prints translation statistics
  • --print-stats-csv β€” prints translation statistics into a CSV file
  • --python β€” generate hipify-python 🐍
  • --roc β€” translates to 'roc' instead of 'hip' wherever it possibly can
  • --save-temps β€” saves the temporary files
  • --skip-excluded-preprocessor-conditional-blocks β€” enables default preprocessor behaviour by skipping undefined conditional blocks
  • --temp-dir=<directory> β€” temporary directory
  • -v β€” shows the commands it's running and goes verbose. it's a talker now πŸ—£οΈ
  • --versions β€” displays the versions of the supported 3rd-party software 🌈

🧚 Generic Options 🧚

  • --help β€” displays the available options (and --help-hidden if you want more, and honestly, more is right there)
  • --help-list β€” displays the list of available options (and --help-list-hidden for more, same deal)
  • --version β€” displays the version of this program ⭐

Now, the important lore πŸ’–

-p <build-path> is used to read a compile command database.

For example, it can be a CMake build directory in which a file named compile_commands.json exists (use the -DCMAKE_EXPORT_COMPILE_COMMANDS=ON CMake option to get this output). When no build path is specified, a search for compile_commands.json will be attempted through all parent paths of the first input file. See: https://clang.llvm.org/docs/HowToSetupToolingForLLVM.html for an example of setting up Clang Tooling on a source tree.

<source0> ... specify the paths of source files. These paths are looked up in the compile command database. If the path of a file is absolute, it needs to point into CMake's source tree. If the path is relative, the current working directory needs to be in the CMake source tree and the file must be in a subdirectory of the current working directory. "./" prefixes in the relative files will be automatically removed, but the rest of a relative path must be a suffix of a path in the compile command database. iykyk πŸ¦‹

Optimized build.

That's the page, bestie β€” brought to you by hipify-clang, dated September 2026, and yeah it's still filed under UBUNTU(1) which is a whole choice but we're going with it πŸ’€βœ¨ stay hipified, ily 🫢

πŸ“¦ where this page comes from