[PATCH] D40275: [CUDA] Report "unsupported VLA" errors only on device side.

Hal Finkel via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 21 10:13:48 PST 2017


hfinkel added a comment.

> When Sema sees this code during compilation, it can not tell whether there is an error. Calling foo from the host code is perfectly valid. Calling it from device code is not. CUDADiagIfDeviceCode creates 'postponed' diagnostics which only gets emitted if we ever need to generate code for the function on device.

Interesting. I suspect that we'll end up dealing with this problem for OpenMP as well (in the future - for OpenMP v5). In this next version (for which the draft is available here: http://www.openmp.org/wp-content/uploads/openmp-TR6.pdf), we'll have "implicit declare target" functions (whereby we generate target code based on the locally-defined subset of the transitive closure of the call graph starting from target regions).


https://reviews.llvm.org/D40275





More information about the cfe-commits mailing list