Clang error: invalid pipe access modifier (expecting A) (err_opencl_builtin_pipe_invalid_access_modifier)
Jump to navigation
Jump to search
Text | error: invalid pipe access modifier (expecting A) |
---|---|
Type | Error |
Category | Semantic Issue |
Internal Id | err_opencl_builtin_pipe_invalid_access_modifier |
Internal Message | invalid pipe access modifier (expecting %0)
|
Regular Expression | (?:error|fatal error)\: invalid pipe access modifier \(expecting (.*?)\)
|
First Commit | 2016-01-26 3a9952c9e7d0 [OpenCL] Pipe builtin functions |
Description
Example
Flags | -xcl -cl-std=CL2.0 -Xclang -finclude-default-header
|
|
---|---|---|
Source |
__kernel void test(__write_only pipe int p) { // Incorrect pipe access modifier
int v;
sub_group_commit_read_pipe(p, &v);
}
| |
Compiler Output |
<source>:3:30: error: invalid pipe access modifier (expecting read_only) |
Clang Internals (17.0.6)
Git Commit Message
[OpenCL] Pipe builtin functions Summary: Support for the pipe built-in functions for OpenCL 2.0. The pipe builtin functions may have infinite kinds of element types, one approach would be to just generate calls that would always use generic types such as void*. This patch is based on bader's opencl support patch on SPIR-V branch. Reviewers: Anastasia, pekka.jaaskelainen Subscribers: keryell, bader, cfe-commits Differential Revision: http://reviews.llvm.org/D15914 llvm-svn: 258773
Used in Clang Sources
This section lists all occurrences of the diagnostic within the Clang's codebase. For each occurrence, an auto-extracted snipped from the source code is listed including key elements like control structures, functions, or classes. It should illustrate the conditions under which the diagnostic is activated.
clang/lib/Sema/SemaChecking.cpp (line 1677)
/// Returns true if pipe element type is different from the pointer.
static bool checkOpenCLPipeArg(Sema &S, CallExpr *Call) {
// ...
case Builtin::BIread_pipe:
case Builtin::BIreserve_read_pipe:
case Builtin::BIcommit_read_pipe:
case Builtin::BIwork_group_reserve_read_pipe:
case Builtin::BIsub_group_reserve_read_pipe:
case Builtin::BIwork_group_commit_read_pipe:
case Builtin::BIsub_group_commit_read_pipe:
if (!(!AccessQual || AccessQual->isReadOnly())) {
S.Diag(Arg0->getBeginLoc(), diag::err_opencl_builtin_pipe_invalid_access_modifier) << "read_only" << Arg0->getSourceRange();
clang/lib/Sema/SemaChecking.cpp (line 1691)
/// Returns true if pipe element type is different from the pointer.
static bool checkOpenCLPipeArg(Sema &S, CallExpr *Call) {
// ...
case Builtin::BIwrite_pipe:
case Builtin::BIreserve_write_pipe:
case Builtin::BIcommit_write_pipe:
case Builtin::BIwork_group_reserve_write_pipe:
case Builtin::BIsub_group_reserve_write_pipe:
case Builtin::BIwork_group_commit_write_pipe:
case Builtin::BIsub_group_commit_write_pipe:
if (!(AccessQual && AccessQual->isWriteOnly())) {
S.Diag(Arg0->getBeginLoc(), diag::err_opencl_builtin_pipe_invalid_access_modifier) << "write_only" << Arg0->getSourceRange();
Triggered in Clang Tests
This section lists all internal Clang test cases that trigger the diagnostic.
clang/test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl
- clang/test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl:18:14: error: invalid pipe access modifier (expecting write_only)
- clang/test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl:19:14: error: invalid pipe access modifier (expecting write_only)
- clang/test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl:25:32: error: invalid pipe access modifier (expecting write_only)
- clang/test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl:31:31: error: invalid pipe access modifier (expecting write_only)
- clang/test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl:47:13: error: invalid pipe access modifier (expecting read_only)
- clang/test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl:48:13: error: invalid pipe access modifier (expecting read_only)
- clang/test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl:54:31: error: invalid pipe access modifier (expecting read_only)
- clang/test/SemaOpenCL/invalid-pipe-builtin-cl2.0.cl:60:30: error: invalid pipe access modifier (expecting read_only)