These cause us to consider all functions in-between to be host
device.
You can nest these pragmas; you just can't have more 'end's than
'begin's.
Paths
| Differential D24975
[CUDA] Add #pragma clang force_cuda_host_device_{begin,end} pragmas. ClosedPublic Authored by jlebar on Sep 27 2016, 11:41 AM.
Details Summary These cause us to consider all functions in-between to be host You can nest these pragmas; you just can't have more 'end's than
Diff Detail
Event Timelinejlebar added a child revision: D24979: [CUDA] Support <complex> and std::min/max on the device..Sep 27 2016, 11:46 AM
jlebar marked 2 inline comments as done. Comment ActionsAddress Richard Smith's review comments:
Comment Actions Please add serialisation code for the push count for PCH. Should it be an error if the count is nonzero at the end of the TU? What happens if there are trailing tokens after the pragma?
jlebar marked 2 inline comments as done. jlebar edited edge metadata. Comment ActionsAddress Richard's comments. I'm fairly neutral on whether we want to make it an error not to match all of Comment Actions
Added code to make this an error. rsmith edited edge metadata. Comment ActionsPlease add a test to test/PCH for the serialization code. Otherwise, LGTM.
This revision is now accepted and ready to land.Oct 7 2016, 4:25 PM Comment Actions
Test added. It caught a bug, too. :) Thank you for the review. Closed by commit rL283677: [CUDA] Add #pragma clang force_cuda_host_device_{begin,end} pragmas. (authored by jlebar). · Explain WhyOct 8 2016, 3:25 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 74051 cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
cfe/trunk/include/clang/Parse/Parser.h
cfe/trunk/include/clang/Sema/Sema.h
cfe/trunk/include/clang/Serialization/ASTBitCodes.h
cfe/trunk/include/clang/Serialization/ASTReader.h
cfe/trunk/include/clang/Serialization/ASTWriter.h
cfe/trunk/lib/Parse/ParsePragma.cpp
cfe/trunk/lib/Sema/SemaCUDA.cpp
cfe/trunk/lib/Serialization/ASTReader.cpp
cfe/trunk/lib/Serialization/ASTWriter.cpp
cfe/trunk/test/PCH/pragma-cuda-force-host-device.cu
cfe/trunk/test/Parser/cuda-force-host-device-templates.cu
cfe/trunk/test/Parser/cuda-force-host-device.cu
|