[PATCH] D52377: [HIP] Support early finalization of device code

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 1 08:26:42 PDT 2018


yaxunl added a comment.

In https://reviews.llvm.org/D52377#1242547, @tra wrote:

> Overall the patch look OK. I'll take a closer look on Monday.
>
> Which mode do you expect will be most commonly used for HIP by default? With this patch we'll have two different ways to do similar things in HIP vs. CUDA.
>  E.g. by default CUDA compiles GPU code in each TU in a complete executable and requires -fcuda-rdc to compile to GPU object file.
>  HIP defaults to object-file compilation and requires --hip-early-finalize to match CUDA's default behavior.
>
> I wonder if it would make sense to provide a single way to control this behavior. E.g. `--fgpu-rdc` (an alias for -cuda-rdc, perhaps?) would default to true in HIP, but disabled in CUDA. `-fno-gpu-rdc` would force 'whole GPU executable per TU' mode.


Agree that --fgpu-rdc and -fno-gpu-rdc are better names of the options. I will make changes to use these options.

For the default option, we will use -fno-gpu-rdc to be consistent with cuda-clang.


https://reviews.llvm.org/D52377





More information about the cfe-commits mailing list