UBUNTU(1)
π¦ 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 as1if 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, likesm_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-hiddenif you want more, and honestly, more is right there)--help-listβ displays the list of available options (and--help-list-hiddenfor 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
- ubuntu stonking: hipify-clang 10.0+dfsg-0ubuntu1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms