title: Threads hierarchy design in CUDA for my code
body: <p>I want to convert my previous code in c++ to CUDA</p>
  
  <pre><code>for(int x=0 ; x &lt; 100; x++)
  {
      for(int y=0 ; y &lt; 100; y++)
      {
          for(int w=0 ; w &lt; 100; w++)
          {
              for(int z=0 ; z &lt; 100; z++)
              {
                ........
              }
          }
      }
  }
  </code></pre>
  
  <p>these loops combine to make a new int value.</p>
  
  <p>if I want to use CUDA I have to design threads hierarchy before building
  the kernel code.</p>
  
  <p>So How can I design the hierarchy ?</p>
  
  <p>depend on every loop I think it will be like this:</p>
  
  <p>100*100*100*100 = 100000000 thread .</p>
  
  <p>Could you help me</p>
  
  <p>Thanks</p>
  
  <p><strong>My CUDA spec:</strong></p>
  
  <blockquote>
    <p>CUDA Device #0</p>
    
    <p>Major revision number:         1</p>
    
    <p>Minor revision number:         1</p>
    
    <p>Name:                          GeForce G 105M</p>
    
    <p>Total global memory:           536870912</p>
    
    <p>Total shared memory per block: 16384</p>
    
    <p>Total registers per block:     8192</p>
    
    <p>Warp size:                     32</p>
    
    <p>Maximum memory pitch:          2147483647</p>
    
    <p>Maximum threads per block:     512</p>
    
    <p>Maximum dimension 1 of block:  512</p>
    
    <p>Maximum dimension 2 of block:  512</p>
    
    <p>Maximum dimension 3 of block:  64</p>
    
    <p>Maximum dimension 1 of grid:   65535</p>
    
    <p>Maximum dimension 2 of grid:   65535</p>
    
    <p>Maximum dimension 3 of grid:   1</p>
    
    <p>Clock rate:                    1600000</p>
    
    <p>Total constant memory:         65536</p>
    
    <p>Texture alignment:             256</p>
    
    <p>Concurrent copy and execution: No</p>
    
    <p>Number of multiprocessors:     1</p>
    
    <p>Kernel execution timeout:      Yes</p>
  </blockquote>