none
I can debug kernel in one project but not kernel in another one RRS feed

  • Question

  • I have two c++ projects

    1) an example c++ Amp program from msdn

    2) my own c++ Amp test code

    I can step in kernel and debug #1, but I can't debug kernel in #2

    I get hollow break points in c++ code as well as hollow breakpoint in kernel code.

    #2 has the same "Debugger Type" setting which is GPU only, but I can not break and step into kernel code for #2, both programs are Debug builds....

    Tuesday, April 2, 2013 8:11 PM

Answers

  • I figured it out...

    I was calling this function in my project....(below)

    In order to debug, I need to not explicitly set the accelerator, the default one will be the GPU anyway.

    For debugging the GPU emulator would get chosen

    (That is, upon setting the "Debugging Type" to "GPU ONLY".


    accelerator pick_accelerator()
    {
        // get all accelerators known to the C++ AMP runtime
        vector<accelerator> accs = accelerator::get_all();
        for each (accelerator acc in accs)
        {
            std::wcout << acc.description << std::endl;
        }
        // empty ctor returns the one picked by the runtime by default
        accelerator chosen_one;

        // choose one, e.g. one that is not emulated
        auto result =
            std::find_if(accs.begin(), accs.end(), [] (accelerator acc)
        {
            return !acc.is_emulated; //.supports_double_precision
        });
        if (result != accs.end())
            chosen_one = *(result); // else not shown

        // output its description (tip: explore the other properties)
        std::wcout << chosen_one.description << std::endl;

        // set it as default... can only call this once per process
        accelerator::set_default(chosen_one.device_path);

        // ...or just return it
        return chosen_one;
    }

    • Marked as answer by MartinDOrtiz Wednesday, April 3, 2013 7:08 PM
    Tuesday, April 2, 2013 10:06 PM