array_view variable cause stack overflow(amp), when use for() loop in the parallel_for_each() RRS feed

  • Question

  • HI.

    I am porting marching cube CUDA sample to C++ AMP.

    My problem is stack overflow(amp) when the code attemped below.

    The problem occur in debug configuration only. Release is ok.

    It is very long and complex source, so I made the problem source code in my guess.

    The problem occur when I use 'numVerts' in for loop.

    'numVerts' is a value from 'numVertsTable'(array_view).

    When I change the code 'for(uint j=0; j<100; j+=3)', it works fine.

    I don't know why array_view variable cause stack overflow in for loop.

    how can I avoid it?

    Any comment would be helpful.

    array_view<const uint, 1> d_numVertsTable(256, numVertsTable);

    parallel_for_each(e.tile<1, 1, NTHREADS>(),

    [=] (tiled_index<1, 1, NTHREADS> t_idx) restrict(amp)


    uint numVerts = numVertsTable[cubeindex];

    for(uint j=0; j<numVerts; j+=3)



    Tuesday, September 4, 2012 11:57 AM


All replies