[PATCH] D49083: [HIP] Register/unregister device fat binary only once

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 12 04:17:01 PDT 2018


yaxunl added a comment.

In https://reviews.llvm.org/D49083#1157586, @yaxunl wrote:

> In https://reviews.llvm.org/D49083#1157568, @tra wrote:
>
> > > HIP generates one fat binary for all devices after linking. However, for each compilation
> > >  unit a ctor function is emitted which register the same fat binary. 
> > >  Measures need to be taken to make sure the fat binary is only registered once.
> >
> > Are you saying that for HIP there's only one fatbin file with GPU code for the complete host executable, even if it consists of multiple HIP TUs?
>
>
> By 'TU' do you mean 'target unit'?
>
> For HIP there is only one fatbin file with GPU code for the complete host executable even if there are mulitple GPU sub-targets. Device code for different sub-targets are bundled together by clang-offload-bundler as one fatbin. Runtime will extract device code for different sub-targets.


It there are multiple translation units, there will be only one fatbin after linking, since the LLVM modules from different translation units will be linked together to generate one fatbin.


https://reviews.llvm.org/D49083





More information about the cfe-commits mailing list