[PATCH] D49723: [OpenCL] Check for invalid kernel arguments in array types

Andrew Savonichev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 9 16:12:24 PST 2023


asavonic added a comment.

In D49723#4116435 <https://reviews.llvm.org/D49723#4116435>, @Ayal wrote:

> This is admittedly a couple of years old by now, but wonder about that other intended patch - Clang still seems to consider pointers in struct arguments to be illegal in CL2.0 (and CL3.0) - please see https://godbolt.org/z/E87z66h1d

Yeah, the patch got lost somewhere, I'm sorry...

TBH, I don't know why pointers in structs or arrays were disallowed in the first place. Even OpenCL 1.2 does not say it explicitly, although there is a bit suspicious point in s6.9.p:

  Arguments to kernel functions that are declared to be a struct or union do not allow
  OpenCL objects to be passed as elements of the struct or union

It does not say "pointers", just "OpenCL objects". Sounds more like events or images to me, not pointers.


Repository:
  rC Clang

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

https://reviews.llvm.org/D49723



More information about the cfe-commits mailing list