 
       for( int i = 0; i < localStreams; i++ )
       {
-        int coffset = INDX( rowTile[i], colTile[i], linearTiles ) *
+        int cOffset = INDX( rowTile[i], colTile[i], linearTiles ) *
                             tileSize * tileSize;
-        CUDA_CALL( cudaMemcpyAsync( &p_c[coffset], d_c[i], tileBytes,
+        CUDA_CALL( cudaMemcpyAsync( &p_c[cOffset], d_c[i], tileBytes,
                         cudaMemcpyDeviceToHost, stream[i] ) );
       } /* end for */
 


        for( int i = 0; i < localStreams; i++ )
        {
          CUBLAS_CALL( cublasSetStream( handle, stream[i] ) );
          CUBLAS_CALL( cublasDgemm( handle, CUBLAS_OP_N, CUBLAS_OP_N,
                 tileSize, tileSize, tileSize,
                 &alpha,


    int currentTile = 0;

/* starting the timer */

    CUDA_CALL( cudaEventRecord( start, 0 ) );

/* while loop over all the tiles */

    while( currentTile < totalTiles )
    {

      int localStreams = 0;

/* assign a tile to each stream */

      for( int i = 0; i < nstreams; i++ )
      {
        rowTile[i] = currentTile % linearTiles;
        colTile[i] = currentTile / linearTiles;

/*   using localStreams in case we run out of tiles and still have streams
     then we just keep some streams idle  */

        if( currentTile < totalTiles ) localStreams++;

        currentTile++;
      } /* end for */

/* copy tile of C to device, each stream does a different tile of C */

      for( int i = 0; i < localStreams; i++ )
      {
        int cOffset = INDX( rowTile[i], colTile[i], linearTiles ) *
                            tileSize * tileSize;
        CUDA_CALL( cudaMemcpyAsync( d_c[i], &p_c[cOffset], tileBytes,
                     cudaMemcpyHostToDevice, stream[i] ) );

      } /* end for */
