title: Why is z always zero in CUDA kernel
body: <p>I am using Cudafy to do some calculations on a NVIDIA GPU. 
  (Quadro K1100M capability 3.0, if it matters)</p>
  
  <p>My question is, when I use the following</p>
  
  <pre class="lang-cs prettyprint-override"><code>cudaGpu.Launch(new dim3(44,8,num), new dim(8, 8)).MyKernel...
  </code></pre>
  
  <p>why are my z indexes from the GThread instance always zero when I use this in my kernel?</p>
  
  <pre><code>int z = thread.blockIdx.z * thread.blockDim.z + thread.threadIdx.z;
  </code></pre>
  
  <p>Furthermore, if I have to do something like
  </p>
  
  <pre><code>cudaGpu.Launch(new dim3(44,8,num), new dim(8, 8, num)).MyKernel...
  </code></pre>
  
  <p>z does give different indexes as it should, but num can't be very large because of the restrictions on number of threads per block. Any surgestion on how to work around this?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>Another way to phrase it. Can I use thread.z in my kernel (for anything useful) when block size is only 2D?</p>