title: OpenCL void pointer arithmetic - strange behavior
body: <p>I have wrote an OpenCL kernel that is using the opencl-opengl interoperability to read vertices and indices, but probably this is not even important because I am just doing simple pointer addition in order to get a specific vertex by index.</p>
  
  <pre><code>uint pos = (index + base)*stride;
  </code></pre>
  
  <p>Here i am calculating the absolute position in bytes, in my example pos is 28,643,328 with a stride of 28, index = 0 and base = 1,022,976. Well, that seems correct.</p>
  
  <p>Unfortunately, I cant use <code>vload3</code> directly because the offset parameter isn't calculated as an absolute address in bytes. So I just add <code>pos</code> to the pointer <code>void* vertices_gl</code></p>
  
  <pre><code>void* new_addr = vertices_gl+pos;
  </code></pre>
  
  <p><code>new_addr</code> is in my example = 0x2f90000 and this is where the strange part begins, </p>
  
  <p><code>vertices_gl</code> = 0x303f000</p>
  
  <hr>
  
  <p>The result (<code>new_addr</code>) should be 0x4B90000  (0x303f000 + 28,643,328)</p>
  
  <p>I dont understand why the address vertices_gl is getting decreased by 716,800 (0xAF000)</p>
  
  <hr>
  
  <p>I'm targeting the GPU: AMD Radeon HD5830</p>
  
  <p>Ps: for those wondering, I am using a printf to get these values :) ( couldn't get CodeXL working)</p>