<html>
    <head>
      <base href="http://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 --- - Can't generate constant memory by NVPTX"
   href="http://llvm.org/bugs/show_bug.cgi?id=16278">16278</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Can't generate constant memory by NVPTX
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </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>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

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

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

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=10656" name="attach_10656" title="the llvm-ir sample">attachment 10656</a> <a href="attachment.cgi?id=10656&action=edit" title="the llvm-ir sample">[details]</a></span>
the llvm-ir sample

As the thread in <a href="http://ppt.cc/WT8z">http://ppt.cc/WT8z</a>.  llvm-ir sample is in the attachment.

I have a kernel that contains a constant variable declared in file scope like
this: 

   constant one_f = 1.0f; 
__kernel void test( ...){    ...  } 

Then it is compiled to llvm-ir: 

@one_f = addrspace(4) global float 1.000000e+00, align 4 
define void test(...){   ...   } 

Finally ptx: 

.visible .global .align 4 .f32 one_f = 0f3F800000; 
.entry test( ...) { ... } 

one_f is placed in global memory and load it by ld.global.f32 


Antony Yu</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>