Curyous
Curyous

Reputation: 8866

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?

Upvotes: 3

Views: 527

Answers (1)

Ade Miller
Ade Miller

Reputation: 13743

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

Upvotes: 4

Related Questions