SuiteSparse/GPUQREngine/Source/BucketList/BucketList_GrowBundles.cpp
void BucketList::GrowBundles
(
    void
)
{
    //Console.WriteLine("=== GrowBundles");
    for (int i = 0; i < numBundles; i++ )
    {
        LLBundle& bundle = Bundles[i];

        /* The bundle is a phantom bundle if it only has a shadow entry.
         * In this case, we choose not to grow the bundle. */
        if(bundle.First == EMPTY) continue;

        /* Absorb any idle tiles from the bucket. */
        int nativeBucket = bundle.NativeBucket;
        bool hasIdleTiles = (head[nativeBucket] != EMPTY);

        //Console.WriteLine("Bundle " + bundle + "
        //  has NativeBucket " + nativeBucket);

        /* If there are idle tiles in the bucket, try to grow the bundle. */
        if (hasIdleTiles)
        {
            //Console.WriteLine("  Detected Idle Tiles:" + head[nativeBucket]);

            /* Set up the task to be an apply factorize. */
            bundle.CurrentTask = TASKTYPE_GenericApplyFactorize;

            /* Grow the bundle. */
            while (head[nativeBucket] != EMPTY && !bundle.IsFull())
            {
                int newTile = RemoveHead(nativeBucket);
                triu[newTile] = false;
                bundle.AddTileToDelta(newTile);
            }
        }
        /* Else upgrade the task if pipelining gives us an edge. */
        else if (bundle.Count > 1)
        {
            bundle.CurrentTask = TASKTYPE_GenericApplyFactorize;
        }
        else if (bundleCount[nativeBucket] == 1 && Wavefront == nativeBucket-1)
        {
            bundle.CurrentTask = TASKTYPE_GenericApplyFactorize;
        }

        /* If we upgraded to apply-factorize, we need another VT block. */
        if(bundle.CurrentTask == TASKTYPE_GenericApplyFactorize)
        {
            bundle.VT[1] = allocateVT();
        }
    }
}
/* Grow existing bundles and advance the task type to APPLY_FACTORIZE. */
Grow existing bundles and advance the task type to APPLY_FACTORIZE.
Grow existing bundles and advance the task type to APPLY_FACTORIZE .
void BucketList::GrowBundles
(
    void
)
{
    for (int i = 0; i < numBundles; i++ )
    {
        LLBundle& bundle = Bundles[i];
        if(bundle.First == EMPTY) continue;
        int nativeBucket = bundle.NativeBucket;
        bool hasIdleTiles = (head[nativeBucket] != EMPTY);
        if (hasIdleTiles)
        {
            bundle.CurrentTask = TASKTYPE_GenericApplyFactorize;
            while (head[nativeBucket] != EMPTY && !bundle.IsFull())
            {
                int newTile = RemoveHead(nativeBucket);
                triu[newTile] = false;
                bundle.AddTileToDelta(newTile);
            }
        }
        else if (bundle.Count > 1)
        {
            bundle.CurrentTask = TASKTYPE_GenericApplyFactorize;
        }
        else if (bundleCount[nativeBucket] == 1 && Wavefront == nativeBucket-1)
        {
            bundle.CurrentTask = TASKTYPE_GenericApplyFactorize;
        }
        if(bundle.CurrentTask == TASKTYPE_GenericApplyFactorize)
        {
            bundle.VT[1] = allocateVT();
        }
    }
}
void BucketList :: GrowBundles ( void ) { for ( int i = 0 ; i < numBundles ; i ++ ) { LLBundle & bundle = Bundles [ i ] ; if ( bundle . First == EMPTY ) continue ; int nativeBucket = bundle . NativeBucket ; bool hasIdleTiles = ( head [ nativeBucket ] != EMPTY ) ; if ( hasIdleTiles ) { bundle . CurrentTask = TASKTYPE_GenericApplyFactorize ; while ( head [ nativeBucket ] != EMPTY && ! bundle . IsFull ( ) ) { int newTile = RemoveHead ( nativeBucket ) ; triu [ newTile ] = false ; bundle . AddTileToDelta ( newTile ) ; } } else if ( bundle . Count > 1 ) { bundle . CurrentTask = TASKTYPE_GenericApplyFactorize ; } else if ( bundleCount [ nativeBucket ] == 1 && Wavefront == nativeBucket - 1 ) { bundle . CurrentTask = TASKTYPE_GenericApplyFactorize ; } if ( bundle . CurrentTask == TASKTYPE_GenericApplyFactorize ) { bundle . VT [ 1 ] = allocateVT ( ) ; } } }
Grow existing bundles and advance the task type to APPLY_FACTORIZE.
Grow existing bundles and advance the task type to APPLY_FACTORIZE .
//Console.WriteLine("=== GrowBundles"); /* The bundle is a phantom bundle if it only has a shadow entry.
         * In this case, we choose not to grow the bundle. */ /* Absorb any idle tiles from the bucket. */ //Console.WriteLine("Bundle " + bundle + " //  has NativeBucket " + nativeBucket); /* If there are idle tiles in the bucket, try to grow the bundle. */ //Console.WriteLine("  Detected Idle Tiles:" + head[nativeBucket]); /* Set up the task to be an apply factorize. */ /* Grow the bundle. */ /* Else upgrade the task if pipelining gives us an edge. */ /* If we upgraded to apply-factorize, we need another VT block. */