[PATCH] D49725: [OpenCL] Forbid size dependent types used as kernel arguments

Andrew Savonichev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 24 04:34:07 PDT 2018


asavonic created this revision.
Herald added subscribers: cfe-commits, Anastasia, yaxunl.

Size_t, intptr_t, uintptr_t and ptrdiff_t cannot be used as kernel
arguments, according to OpenCL Specification s6.9k:

  The size in bytes of these types are implementation-defined and in
  addition can also be different for the OpenCL device and the host
  processor making it difficult to allocate buffer objects to be passed
  as arguments to a kernel declared as pointer to these types.


Repository:
  rC Clang

https://reviews.llvm.org/D49725

Files:
  lib/Sema/SemaDecl.cpp
  test/SemaOpenCL/invalid-kernel-parameters.cl

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49725.157005.patch
Type: text/x-patch
Size: 4708 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180724/35d73d5e/attachment-0001.bin>


More information about the cfe-commits mailing list