This is an archive of the discontinued LLVM Phabricator instance.

[CUDA] Include single GPU binary, NFCI.
ClosedPublic

Authored by Hahnfeld on Feb 19 2018, 6:18 AM.

Details

Summary

Binaries for multiple architectures are combined by fatbinary,
so the current code was effectively not needed.

Diff Detail

Event Timeline

Hahnfeld created this revision.Feb 19 2018, 6:18 AM
tra added inline comments.Feb 20 2018, 10:17 AM
lib/Driver/ToolChains/Clang.cpp
4659

Nit: Passing multiple things as a single input may need some more details.
E.g. ...receives all device-side outputs in a single fatbin as Inputs[1]

lib/Frontend/CompilerInvocation.cpp
1044–1045

If more than one gpu binary is passed, all but last will be ignored.
IMO in this case we would want to either warn that some inputs were ignored or report an error that there is more than one GPU binary.

Hahnfeld added inline comments.Feb 20 2018, 10:24 AM
lib/Frontend/CompilerInvocation.cpp
1044–1045

Well, -fcuda-include-gpubinary is only recognized on cc1. I think we can assume that we are correctly assembling our command line, can't we? (Nobody else checks the options here...)

tra accepted this revision.Feb 20 2018, 10:43 AM
tra added inline comments.
lib/Frontend/CompilerInvocation.cpp
1044–1045

Fair enough. Assert, then?

This revision is now accepted and ready to land.Feb 20 2018, 10:43 AM
Hahnfeld added inline comments.Feb 20 2018, 10:51 AM
lib/Frontend/CompilerInvocation.cpp
1044–1045

I added an assert in lib/Driver/ToolChains/Clang.cpp where we are constructing the command line. I think that guarantees that we are getting only a single argument.

Hahnfeld updated this revision to Diff 135649.Feb 23 2018, 8:38 AM
Hahnfeld marked an inline comment as done.

Update comment.

This revision was automatically updated to reflect the committed changes.