This is an archive of the discontinued LLVM Phabricator instance.

[Polly][zorg] Enable GPGPU Codegen on the builders only if NVPTX is an LLVM target
AcceptedPublic

Authored by philip.pfaffe on Jun 7 2018, 9:24 AM.

Details

Summary

GPGPU Codegeneration requires the LLVM NVPTX target for it to work.
D47888 switches it off if that's not available, but still emits a warning.
Instead, just figure out if NVPTX is enabled and only then switch on GPGPU
codegen.

Event Timeline

philip.pfaffe created this revision.Jun 7 2018, 9:24 AM
Meinersbur added inline comments.Jun 7 2018, 12:17 PM
zorg/buildbot/builders/PollyBuilder.py
78–79

[suggestion] any('LLVM_TARGETS_TO_BUILD' in A and 'NVPTX' in A for A in extraCmakeArgs)

Does this actually work? Isn't extraCmakeArgs formatted like ['-DLLVM_TARGETS_TO_BUILD=X86;NVPTX'], that is, neither 'LLVM_TARGETS_TO_BUILD' nor 'NVPTX' as entire strings are in the list.

80–81

Could you add a comment why this is here?

philip.pfaffe marked an inline comment as done.Jun 7 2018, 2:11 PM
philip.pfaffe added inline comments.
zorg/buildbot/builders/PollyBuilder.py
78–79

Yes, that's why I'm iterating the list.

philip.pfaffe marked an inline comment as done.

Add a comment

Meinersbur added inline comments.Jun 7 2018, 2:21 PM
zorg/buildbot/builders/PollyBuilder.py
78–79

sorry, I seem to have confused 'NVPTX' in A and 'NVPTX' == A

Meinersbur accepted this revision.Jun 7 2018, 2:27 PM

I still think that any(True for ... is unnecessary.

This revision is now accepted and ready to land.Jun 7 2018, 2:27 PM

I still think that any(True for ... is unnecessary.

That's a way to find the first matching element and decide whether there is one in a compact functional way. Do you think it's stylistically questionable?

That's a way to find the first matching element and decide whether there is one in a compact functional way. Do you think it's stylistically questionable?

IMHO it is functionally identical to any('LLVM_TARGETS_TO_BUILD' in A and 'NVPTX' in A for A in extraCmakeArgs) which is even more compact. Why does your version add an if-constraint to the generator when any ignores false-ish elements anyway?

Fix weird iterator comprehension.

Meinersbur accepted this revision.Jul 17 2018, 3:38 PM

Sorry for the late reply

zorg/buildbot/builders/PollyBuilder.py
218

unrelated?