This is an archive of the discontinued LLVM Phabricator instance.

Add NVPTX Support to ValidCPUList (enabling march notes)
ClosedPublic

Authored by erichkeane on Feb 7 2018, 1:57 PM.

Diff Detail

Event Timeline

erichkeane created this revision.Feb 7 2018, 1:57 PM

rebased, reflowed tests.

echristo accepted this revision.Feb 8 2018, 11:33 AM

LGTM with an inline comment.

include/clang/Basic/Cuda.h
49

We have last, invalid, etc... maybe we should pick one among all the targets? :)

This revision is now accepted and ready to land.Feb 8 2018, 11:33 AM
tra added a subscriber: tra.Feb 8 2018, 11:43 AM
tra added inline comments.
test/Misc/target-invalid-cpu-note.c
38

Nit: Generally speaking this note is false. For any given version of CUDA, some of the listed GPU variants will not be accepted. E.g. CUDA versions before 9.1 do not know anything about sm_72, but CUDA-9.1 does not supports sm_20.

erichkeane added inline comments.Feb 8 2018, 11:48 AM
test/Misc/target-invalid-cpu-note.c
38

Is there somewhere else that this is checked? It seems that the 'setCPU' function here checks against this same list.

tra added inline comments.Feb 8 2018, 12:02 PM
test/Misc/target-invalid-cpu-note.c
38

We have CheckCudaVersionSupportsArch() in lib/Driver/ToolChains/Cuda.cpp.
I'm not sure if CUDA version is already known at the time we check -target-cpu, though.

I'm OK with the ful list for now if it's hard to get to the CUDA version.

This revision was automatically updated to reflect the committed changes.