【问题标题】:GPU breakpoint not hit when using C++ AMP使用 C++ AMP 时未命中 GPU 断点
【发布时间】:2012-09-04 16:39:01
【问题描述】:

我已将调试器类型设置为 GPU only 并在 8 行 parallel_for_each lambda 的每一行设置断点,包括行 parallel_for_each 语句,但它永远不会被命中。我在 Windows 8 Pro 上使用 Visual Studio 2012。

我需要采取什么步骤才能使断点起作用?

【问题讨论】:

    标签: c++ visual-c++ gpgpu c++-amp


    【解决方案1】:

    您的应用程序是否为 parallel_for_each 明确提供了加速器/加速器视图?如果是这样,您需要确保在调试时使用 REF 加速器,除非您的 GPU 驱动程序支持调试。

        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
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-04-27
    • 2011-12-01
    相关资源
    最近更新 更多