accelerator_view_removed exception of C++ AMP

This blog post assumes you have read the introduction to C++ AMP exceptions.

An instance of the accelerator_view_removed exception type is thrown to handle a Timeout Detection and Recovery ( TDR ) event while executing an operation on an accelerator.

Scenario

Exception Message

Code Snippet

TDR Event

ID3D11Device::RemoveDevice: Device removal has been triggered

/* Below is an instance where accelerator_view_removed

exception is thrown for a long running kernel.*/

array<int,1> deviceArray(dataVector.size(),dataVector);

try

{

   parallel_for_each(deviceArray.extent,[&](index<1> idx) restrict(amp)

   {

       // Long running computation

    });

    dataVector = deviceArray;

}

catch(accelerator_view_removed& ex)

{

     std::cout<< ex.what() << std::endl;

     std::cout<< ex.get_view_removed_reason() << std::endl;

}

 

Here comes to an end of C++ AMP Exception Series.

Happy C++ AMP Coding !! Smile

Comments

  • Anonymous
    January 10, 2014
    Hi Pavan, glad to find your blog here. I have a program which works fine on my W520 with Q2000M. However, it doesn't on my GTX480. on GTX480, it works with less data, such as 100000. when i want to work on 200000, it failed when trying copy data from device to host. i saw it was Concurrency::accelerator_view_removed error. and i used your method to catch it, it tells "failed to create constant buffer". do you have any idea about it, please? I used cudafy.net before, it just failed and it just told Timeout error. you can see the disscussion here: cudafy.codeplex.com/.../471390