Hi,
+cfe-commits, as I think this series is now ready for pre-commit review.
This new patch series replaces series 1 and 2 entirely, and includes
the following changes:
- Driver and Frontend support for the .cu file extension and '-x cuda',
which both enable CUDA features.
- Improved parsing error recovery for kernel call expressions.
- Added a few diagnostics related to global functions and kernel calls.
- Redesigned CUDAKernelCallExpr to store cudaConfigureCall function
call as a subexpression. The cudaConfigureCall declaration is
now also used to parse the execution configuration. This has
a number of advantages:
- Reduces hardcoded surface area
- Same behaviour as NVIDIA toolchain
- Therefore future-proof; if the cudaConfigureCall parameter list
changes, there is no need to change CUDAKernelCallExpr
- Simplifies CUDAKernelCallExpr::child_end() which before needed
to take care with optional subexpressions
- Can utilise existing support (Sema and CodeGen) for CallExprs
- CodeGen support for CUDAKernelCallExpr. This calls cudaConfigureCall
to set the execution configuration before calling the global function
(currently not CodeGen'd for the host).
- Added small test suite, which tests Parse, Sema and CodeGen.
Future work:
- Host-side CodeGen support for global functions. This will involve
generating a local device stub which uses cudaSetupArgument and
cudaLaunch to set up the argument vector and launch the kernel,
similar to the NVIDIA toolchain.
Reviews appreciated.
Thanks,
0001-Basic-Add-CUDA-language-option.patch (1.14 KB)
0002-Driver-Frontend-add-CUDA-language-support.patch (5.26 KB)
0003-AST-support-for-extra-subexpressions-on-CallExpr-sub.patch (4.77 KB)
0004-AST-add-CUDAKernelCallExpr.patch (8.56 KB)
0005-AST-Sema-keep-track-of-cudaConfigureCall.patch (2.54 KB)
0006-Sema-support-for-building-CUDAKernelCallExpr-from-Ac.patch (6.08 KB)
0007-Lexer-add-CUDA-kernel-call-tokens.patch (2.07 KB)
0008-Parse-add-support-for-parsing-CUDA-kernel-calls.patch (5.76 KB)
0009-Basic-Sema-add-support-for-CUDA-location-attributes.patch (10.7 KB)
0010-Basic-Sema-Add-launch_bounds-attribute.patch (4.29 KB)
0011-Sema-diagnose-kernel-calls-to-non-global-functions.patch (2.31 KB)
0012-Sema-diagnose-kernel-functions-and-kernel-function-c.patch (3.32 KB)
0013-Sema-improve-ConvertArgumentsForCall-diagnostics.patch (2.08 KB)
0014-Sema-add-separate-diagnostics-for-too-few-many-exec-.patch (5.88 KB)
0015-Basic-add-PTXTargetInfo.patch (3.29 KB)
0016-CodeGen-add-PTXTargetCodeGenInfo.patch (2.08 KB)
0017-CodeGen-support-for-CUDAKernelCallExpr.patch (3.9 KB)
0018-Frontend-add-CodeGenOptions-CUDAIsDevice.patch (1.1 KB)
0019-CodeGen-filter-declarations-based-on-attributes-and-.patch (1.42 KB)
0020-Frontend-add-fcuda-is-device-flag.patch (2.69 KB)