]> granicus.if.org Git - clang/commit
[OpenCL] Forbid size dependent types used as kernel arguments
authorAlexey Sotkin <alexey.sotkin@intel.com>
Tue, 31 Jul 2018 20:26:43 +0000 (20:26 +0000)
committerAlexey Sotkin <alexey.sotkin@intel.com>
Tue, 31 Jul 2018 20:26:43 +0000 (20:26 +0000)
commit53fd6771b4fe88cbfaad8506c30d14ea97c4c0db
tree2c1a80758deb7cb11856caa70cd3fe0e311842e2
parente9901bde15692e135ee2b98005f5fb8cdc23fcd5
[OpenCL] Forbid size dependent types used as kernel arguments

Summary:
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.

Patch by: Andrew Savonichev

Reviewers: Anastasia, yaxunl

Subscribers: yaxunl, Anastasia, cfe-commits

Differential Revision: https://reviews.llvm.org/D49725

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338432 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaDecl.cpp
test/SemaOpenCL/invalid-kernel-parameters.cl