<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - [CUDA] cannot find matching tex2D"
   href="https://llvm.org/bugs/show_bug.cgi?id=26400">26400</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[CUDA] cannot find matching tex2D
          </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>All
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>C++
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>wujingyue@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>texture<float4, 2, cudaReadModeElementType> texA;

__global__ void readTexels(float* d_out) {
  float4 v = tex2D(texA, 0.0f, 0.0f);
  *d_out = v.x + v.y + v.z + v.w;
}

$ clang++ texture.cu -c --cuda-gpu-arch=sm_35

texture.cu:4:14: error: no matching function for call to 'tex2D'
  float4 v = tex2D(texA, 0.0f, 0.0f);
             ^~~~~
/usr/local/cuda/include/texture_indirect_functions.h:522:39: note: candidate
template ignored: couldn't infer template argument 'T'
__TEXTURE_INDIRECT_FUNCTIONS_DECL__ T tex2D(cudaTextureObject_t texObject,
float x, float y)
...

nvcc can compile this file. The declaration of the matching tex2D is in
texture_fetch_functions.h, and its definition is in
texture_fetch_functions.hpp.</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>