hipify-perl

hipify-perl#

hipify-perl is an autogenerated perl-based script that heavily uses regular expressions.

Advantages:

  • Ease of use

  • No checks for input source NVIDIA CUDA code for correctness required

  • No dependency on third party tools, including CUDA

Disadvantages:

  • Inability or difficulty in implementing the following constructs:

    • Macros expansion

    • Namespaces:

      • Redefinition of CUDA entities in user namespaces

      • Using directive

    • Templates (some cases)

    • Device or host function calls differentiation

    • Correct injection of header files

    • Parsing complicated argument lists

Usage#

perl hipify-perl square.cu > square.cu.hip

Building hipify-perl#

To generate hipify-perl, run

hipify-clang --perl

You can choose to specify the output directory for the generated hipify-perl file using --o-hipify-perl-dir option.