none
Question about array_view's synchronize() RRS feed

  • Question

  • During I make a renderer using the C++ AMP, I'm getting curious about array_view's synchronize() function.
    The question is: after the end of parallel_for_each function, is there data for the array_view whitch still remain in VRAM?
    For more detail, I made a test code like this:
    /////////////////////////////////////////////////////////////////////////////////////////////////////////
        int i = 0;
        array_view<int, 1> vwI(1, &i);
        for (size_t j = 0; j < 10; ++j){
            parallel_for_each(vwI.extent, [=](index<1> i)restrict(amp){
                ++vwI[i];
            });
        }
        vwI.synchronize();
     
        cout << i << endl;
    /////////////////////////////////////////////////////////////////////////////////////////////////////////
    On this code, the result of print is '10'.

    But I want know that the result always '10' in every case.
    And is this safe?

    Sorry for my bad English.

    • Edited by MKzz Tuesday, August 2, 2016 5:17 AM
    Tuesday, August 2, 2016 5:14 AM