This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Don't throw cudalib not found error if only front-end is required.
ClosedPublic

Authored by gtbercea on Sep 15 2017, 11:43 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

gtbercea created this revision.Sep 15 2017, 11:43 AM
tra added a subscriber: tra.Sep 15 2017, 11:47 AM
tra added inline comments.
lib/Driver/ToolChains/Cuda.cpp
505–508

This could probably be rephrased as:

if (DeviceOffloadingKind == Action::OFK_OpenMP && 
    DriverArgs.hasArg(options::OPT_S, options::OPT_c))) ...
gtbercea updated this revision to Diff 115444.Sep 15 2017, 11:54 AM

Contract check.

gtbercea updated this revision to Diff 115447.Sep 15 2017, 11:58 AM

Fix parantheses.

tra added a comment.Sep 15 2017, 12:08 PM

BTW, at least for CUDA compilation, '-c' would still needs libdevice as device-side will compile PTX to SASS and will need all the symbols PTX may refer to.
Would that not be the case for OpenMP's compilation, too?

gtbercea updated this revision to Diff 115481.Sep 15 2017, 1:45 PM

Fix condition.

tra added a comment.Sep 15 2017, 1:48 PM

Now we just need a test case to make sure this works as intended.

gtbercea updated this revision to Diff 115500.Sep 15 2017, 2:36 PM

Add test.

gtbercea updated this revision to Diff 115502.Sep 15 2017, 2:40 PM

Fix diff.

tra added a comment.Sep 15 2017, 3:20 PM

I'm not particularly familiar with OpenMP internals. Could you elaborate on why libdevice would not be needed with -c for the OpenMP case?
Is that because it would only apply to the host compilation and that nothing will be compiled for the openmp targets?
Does openmp allow separate compilation for the target (i.e. something similar to what --cuda-device-only does?)

test/Driver/openmp-offload-gpu.c
133

I'd have separate runs -- one with -S and another one with -c.

That would cover openMP compilation changes. There should also be similar test to verify new behavior for CUDA compilation.

gtbercea updated this revision to Diff 115697.Sep 18 2017, 11:51 AM

Only check for -S.

gtbercea added inline comments.Sep 18 2017, 11:57 AM
test/Driver/openmp-offload-gpu.c
133

There is no new behaviour for CUDA actually, I only introduce this for OpenMP offloading.

tra accepted this revision.Sep 18 2017, 12:07 PM
This revision is now accepted and ready to land.Sep 18 2017, 12:07 PM
hfinkel added inline comments.
test/Driver/openmp-offload-gpu.c
131

Do you need both -c and -S? I'm under the impression that -c -S is equivalent to -S.

gtbercea updated this revision to Diff 115948.Sep 19 2017, 6:24 PM
gtbercea closed this revision.Sep 25 2017, 2:08 PM
gtbercea reopened this revision.Sep 25 2017, 2:58 PM

Open.

This revision is now accepted and ready to land.Sep 25 2017, 2:58 PM
gtbercea closed this revision.Sep 26 2017, 8:37 AM