[PATCH] D120952: [clang][AST matchers] adding submatchers under cudaKernelCallExpr to match kernel launch config

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 16 06:08:19 PDT 2022


aaron.ballman added a comment.

In D120952#3384239 <https://reviews.llvm.org/D120952#3384239>, @ajohnson-uoregon wrote:

> For the specific argument matchers (`cudaBlockDim()`, `cudaStream()`, etc), I agree, I'm not sure if there's any other use cases in tree. I wasn't aware you could write local definitions like that, I could definitely do that within my project for those.

SGTM!

> I would still like to upstream `hasKernelConfig()` though, so it's at least possible to match the kernel config without defining a local matcher.

I think that's reasonable. One thing to keep in mind for that is there are multiple language modes that all have the notion of a kernel (OpenCL and SYCL both do as well). We should make sure the matcher can be extended for those cases someday in the future, or be given a CUDA-specific name (e.g, `hasCUDAKernelConfig()`) if that's a better approach. (I suspect polymorphic matchers will work fine for this, but it's worth someone considering explicitly.)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120952/new/

https://reviews.llvm.org/D120952



More information about the cfe-commits mailing list