HomePhabricator

[HIP] Align device binary

Authored by yaxunl on Fri, Sep 25, 9:34 AM.

Description

[HIP] Align device binary

To facilitate faster loading of device binaries and share them among processes,
HIP runtime favors their alignment being 4096 bytes. HIP runtime can load
unaligned device binaries, however, aligning them at 4096 bytes results in
faster loading and less shared memory usage.

This patch adds an option -bundle-align to clang-offload-bundler which allows
bundles to be aligned at specified alignment. By default it is 1, which is NFC
compared to existing format.

This patch then aligns embedded fat binary and device binary inside fat binary
at 4096 bytes.

It has been verified this change does not cause significant overall file size increase
for typical HIP applications (less than 1%).

Differential Revision: https://reviews.llvm.org/D88734

Details

Committed
yaxunlFri, Oct 2, 3:10 PM
Differential Revision
D88734: [HIP] Align device binary
Parents
rG04fce1515b7a: [libc++] Fix the build with GCC < 10
Branches
Unknown
Tags
Unknown