 
     cudaStream_t stream[nstreams];
     for( int i = 0; i < nstreams; i++ )
+    {
+/* create the streams here */
         CUDA_CALL( cudaStreamCreate( &stream[i] ) );
+    } /* end for */
 
     cublasDestroy( handle );
     stat = cublasCreate( &handle );


    int currentTile = 0;

    CUDA_CALL( cudaEventRecord( start, 0 ) );

    while( currentTile < totalTiles )
    {

      int localStreams = 0;

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

        if( currentTile < totalTiles ) localStreams++;

        currentTile++;
      } /* end for */

/* copy tile of C to device */

      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 */

      for( int k = 0; k < linearTiles; k++ )
      {

/* stream A into device */

        for( int i = 0; i < localStreams; i++ )
        {

        int aOffset = INDX( rowTile[i], k, linearTiles ) *
                            tileSize * tileSize;
        CUDA_CALL( cudaMemcpyAsync( d_a[i], &p_a[aOffset], tileBytes,
                     cudaMemcpyHostToDevice, stream[i] ) );
        } /* end for */

/* stream B into device */

        for( int i = 0; i < localStreams; i++ )
        {
        int bOffset = INDX( k, colTile[i], linearTiles ) *
                            tileSize * tileSize;
        CUDA_CALL( cudaMemcpyAsync( d_b[i], &p_b[bOffset], tileBytes,
                     cudaMemcpyHostToDevice, stream[i] ) );

        } /* end for */
