title: Boolean Multiplication
body: <p>I would like to make a boolean multiplication using cuda 6, but I can't do it in a right way.
  B is a boolean symmetric matrix and I have to do B^n boolean multiplication.</p>
  
  <p>My C++ code is:</p>
  
  <pre><code>for (m=0; m&lt;dimension; m++) {
      for (n=0; n&lt;dimension; n++) {
          for (k=0; k&lt;dimension; k++) {
              temp=mat[m*dimension+k] &amp;&amp; mat[k*dimension+n];
              B[m*dimension+n]= B[m*dimension+n] || temp;
          }
      }
  }
  </code></pre>
  
  <p>I've found a piece of code, but I can't adapt it for my case.</p>
  
  <pre><code>__global__ void gpuMM(float *A, float *B, float *C, int N)
  {
      int row = blockIdx.y*blockDim.y + threadIdx.y;
      int col = blockIdx.x*blockDim.x + threadIdx.x;
  
      float sum = 0.f;
      for (int n = 0; n &lt; N; ++n)
           sum += A[row*N+n]*B[n*N+col];
  
      C[row*N+col] = sum;
  }
  </code></pre>