Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GPU breakpoint not hit when using C++ AMP

I've set the debugger type to GPU only and set a breakpoint on every line of an 8-line parallel_for_each lambda, including the line parallel_for_each statement, but it never gets hit. I'm using Visual Studio 2012 on Windows 8 Pro.

What step do I need to take to make the breakpoint work?

like image 303
Curyous Avatar asked Jun 06 '26 15:06

Curyous


1 Answers

Is your application explicitly providing an accelerator/accelerator_view for the parallel_for_each? If so you need to ensure that when debugging you use the REF accelerator unless your GPU driver supports debugging.

    accelerator defaultAcc (accelerator::default_accelerator);
    accelerator_view defaultView = defaultAcc.default_view;

#ifndef _DEBUG
    std::vector<accelerator> allAccelerators = accelerator::get_all();
    allAccelerators.erase(std::remove_if(allAccelerators.begin(), allAccelerators.end(), 
        [](const accelerator& acc){ return (acc.is_emulated) || 
                            (acc.device_path == accelerator::cpu_accelerator);} ),
                 allAccelerators.end());

    if (allAccelerators.size() > 0)
        defaultView = allAccelerators[0].default_view;
#endif
like image 130
Ade Miller Avatar answered Jun 09 '26 06:06

Ade Miller