title: Calculation of CGMA in CUDA
body: <p>I am confused with the calculation of CGMA. I know that CGMA = # of operations / # of memory fetches. Firstly, when <code>x = g_A[idx]</code>, should I count the write operation to <code>x</code> or ignore it because it is stored in register? Likewise, in <code>z = (x*y) + (y/x) + (y-x);</code>, should I count read of <code>x</code> and <code>y</code> as memory reads in the calculation of CGMA? Finally, should I count all the operations in the Kernel function (those five lines)?</p>
  
  <pre><code>__global__ void PerformSomeOperations(int* g_A,int* g_B,int* g_C, int Size)
  {
      const int idx = threadIdx.x + (blockIdx.x*blockDim.x);
      if(idx &lt; Size)
      {
          int x = g_A[idx];
          int y = g_B[idx];
          int z = 0;
          z = (x*y) + (y/x) + (y-x);
          g_C[idx] = z;
      }
  }
  </code></pre>