ROCm / HIPIFY

HIPIFY: Convert CUDA to Portable C++ Code
https://rocm.docs.amd.com/projects/HIPIFY/en/latest/
MIT License
499 stars 70 forks source link

[HIPIFY] What's the syntax to hipify an entire application? #1609

Closed klausbu closed 1 month ago

klausbu commented 1 month ago

What's the syntax to hipify an entire application (https://gitlab.com/unigehpfs/palabos) i.e. all the files containing cuda code located in a program source directory and its subdirectories?

The application uses c++ std parallel offloading and meets the requirements described here: https://rocm.blogs.amd.com/software-tools-optimization/hipstdpar/README.html . According to my quick check which offloading policy is implemented searching for the string "execution::par..." , only "execution::par_unseq" came up.

I am using Ubuntu 22.04 with the latest ROCm rocm-6.2.0 installed.

schung-amd commented 1 month ago

Hi @klausbu, I haven't looked into the specific repo, but hipify-clang supports JSON compilation databases (see documentation at https://rocmdocs.amd.com/projects/HIPIFY/en/latest/hipify-clang.html#using-json-compilation-database); give this a shot for automation of HIPIFY.

emankov commented 1 month ago
  1. hipify-clang accepts multiple source files in a single command line: https://github.com/ROCm/HIPIFY/blob/amd-staging/docs/hipify-clang.rst#usage
  2. For per-directory hipification, there is a script: https://github.com/ROCm/HIPIFY/blob/amd-staging/bin/hipconvertinplace.sh