<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Error in OpenCL kernel parameter: '__global [SOME_STRUCT] *__private' cannot be used as the type of a kernel parameter"
   href="https://bugs.llvm.org/show_bug.cgi?id=50081">50081</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Error in OpenCL kernel parameter: '__global [SOME_STRUCT] *__private' cannot be used as the type of a kernel parameter
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>OpenCL
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>drohr@jwdt.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>anastasia.stulova@arm.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=24791" name="attach_24791" title="testcase">attachment 24791</a> <a href="attachment.cgi?id=24791&action=edit" title="testcase">[details]</a></span>
testcase

The attached testcase fails to compile for me with C++ for OpenCL using clang
trunk (clang version 13.0.0 (<a href="https://github.com/llvm/llvm-project.git">https://github.com/llvm/llvm-project.git</a>
1d96107cfec5539b02b4464009a6c330c0593e44)) giving several errors of the form:

test2.cl:30328:93: error: '__global o2::gpu::GPUConstantMem *__private' cannot
be used as the type of a kernel parameter
__kernel void krnl_GPUTPCNeighboursFinder(__global char *gpu_mem, __global
GPUConstantMem * pConstant, int iSlice_internal ) { __local typename
GPUTPCNeighboursFinder::GPUSharedMemory smem; GPUTPCNeighboursFinder::template
Thread<GPUTPCNeighboursFinder::defaultKernel>(get_num_groups(0),
get_local_size(0), get_group_id(0), get_local_id(0), smem,
GPUTPCNeighboursFinder::Processor((*pConstant))[iSlice_internal] ); }
                                                                               
            ^
test2.cl:30329:94: error: '__global o2::gpu::GPUConstantMem *__private' cannot
be used as the type of a kernel parameter
__kernel void krnl_GPUTPCNeighboursCleaner(__global char *gpu_mem, __global
GPUConstantMem * pConstant, int iSlice_internal ) { __local typename
GPUTPCNeighboursCleaner::GPUSharedMemory smem;
GPUTPCNeighboursCleaner::template
Thread<GPUTPCNeighboursCleaner::defaultKernel>(get_num_groups(0),
get_local_size(0), get_group_id(0), get_local_id(0), smem,
GPUTPCNeighboursCleaner::Processor((*pConstant))[iSlice_internal] ); }

Command to reproduce:
clang++ -cl-std=clc++ -x cl -emit-llvm --target=spir64-unknown-unknown -Xclang
-fdenormal-fp-math-f32=ieee -cl-mad-enable -cl-no-signed-zeros
-ferror-limit=1000 -Xclang -finclude-default-header
-Dcl_clang_storage_class_specifiers -c test2.cl -o test.bc</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>