<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How select host device? in Intel® oneAPI DPC++/C++ Compiler</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-select-host-device/m-p/1526665#M3302</link>
    <description>&lt;P&gt;Hello&amp;nbsp;Srinivas,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you for your reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I may be mistaken, but the SYCL 2020 standard doesn't deprecate the host device. It just doesn't require a SYCL implementation to provide it anymore.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actually, I am not entirely satisfied with using the device selected by `cpu_selector_v` for debugging.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It remains different from the usual CPU. As far as I can see, on my system it uses an OpenCL backend, and while I can set a breakpoint in a line of code inside a kernel, the debugging capabilities I receive are limited compared to what I could get with a host device, where the code is executed as standard machine code and can be debugged as such. For instance, I cannot use step-by-step debugging.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please suggest a method for debugging SYCL kernels that is as convenient as debugging on the host device?&lt;/P&gt;</description>
    <pubDate>Fri, 22 Sep 2023 13:52:31 GMT</pubDate>
    <dc:creator>blinkfrog</dc:creator>
    <dc:date>2023-09-22T13:52:31Z</dc:date>
    <item>
      <title>How select host device?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-select-host-device/m-p/1525723#M3297</link>
      <description>&lt;P&gt;How can I select host device? I need this for debug purposes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;According to documentation (&lt;A href="https://intel.github.io/llvm-docs/doxygen/group__sycl__api__dev__sel.html#ga9fb90c16e9bfa0fbf5ae4675b51f489e" target="_blank"&gt;https://intel.github.io/llvm-docs/doxygen/group__sycl__api__dev__sel.html#ga9fb90c16e9bfa0fbf5ae4675b51f489e&lt;/A&gt;), `default_selector_v` selects host device, which, if I understand correctly, is CPU without acceleration.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, this code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;P&gt;auto d_selector{ sycl::default_selector_v };&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;queue q(d_selector, exception_handler)&lt;/P&gt;&lt;P&gt;std::cout &amp;lt;&amp;lt; "Running on device: "&lt;BR /&gt;&amp;lt;&amp;lt; q.get_device().get_info&amp;lt;info::device::name&amp;gt;() &amp;lt;&amp;lt; "\n";&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;outputs this:&lt;/P&gt;&lt;P&gt;`Running on device: Intel(R) Graphics [0x9a60]`&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use oneAPI 2023.2.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2023 09:13:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-select-host-device/m-p/1525723#M3297</guid>
      <dc:creator>blinkfrog</dc:creator>
      <dc:date>2023-09-20T09:13:30Z</dc:date>
    </item>
    <item>
      <title>Re: How select host device?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-select-host-device/m-p/1525729#M3298</link>
      <description>&lt;P&gt;If I try to use deprecated host_selector:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;`auto d_selector{ sycl::host_selector{} };`&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I get the exception:&lt;/P&gt;&lt;P&gt;"No device of requested type available."&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2023 09:35:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-select-host-device/m-p/1525729#M3298</guid>
      <dc:creator>blinkfrog</dc:creator>
      <dc:date>2023-09-20T09:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: How select host device?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-select-host-device/m-p/1525733#M3299</link>
      <description>&lt;P&gt;Ok, when I use usual `cpu_selector_v`, I can debug the device code, which is a bit surprising for me as device which is chosen by cpu_selector_v clearly uses vectorization, and I thought it performs the code on OpenCL backend.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can close the topic now, but I still would like to know if CPU-device is the same as host device (it shouldn't be, as it is noticeably faster than usual C++ scalar code), and, if not, why I still able to debug device code when it is selected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2023 09:52:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-select-host-device/m-p/1525733#M3299</guid>
      <dc:creator>blinkfrog</dc:creator>
      <dc:date>2023-09-20T09:52:29Z</dc:date>
    </item>
    <item>
      <title>Re: How select host device?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-select-host-device/m-p/1526648#M3300</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for posting in Intel Communities.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;gt;&amp;gt; &lt;EM&gt;How can I select host device? I need this for debug purposes.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"host device" typically refers to the CPU. This device is used for debugging and running code on the CPU&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As per SYCL 2020, "host_selector" is deprecated. For selecting the SYCL host device, you can use default_selector_v.&lt;/P&gt;
&lt;P&gt;In your case, default_selector_v selects an Intel Graphics device instead of the host(CPU).&lt;/P&gt;
&lt;P&gt;The default_selector_v queries all root devices from all SYCL backends in the system, calls the device selector on each device, and selects the one that returns the highest score.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;gt;&amp;gt;&lt;EM&gt;Ok, when I use usual `cpu_selector_v`, I can debug the device code, which is a bit surprising for me as device which is chosen by cpu_selector_v clearly uses vectorization, and I thought it performs the code on OpenCL backend.&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;I can close the topic now, but I still would like to know if CPU-device is the same as host device (it shouldn't be, as it is noticeably faster than usual C++ scalar code), and, if not, why I still able to debug device code when it is selected.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use cpu_selector_v, which should select a CPU device for execution of device code and debug purposes.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here while you are using cpu_selector_v, your CPU device is still considered as a supported device in SYCL which has a supported backend like OpenCL.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, here CPU device is considered as the host device, the CPU provides a guarantee that the device code can always be run as it is always available and can be used for debugging purposes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also check which selector is taking which device and the list of devices available in the system by running the below command.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;sycl-ls --verbose&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please refer to the below links for reference:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SYCL 2020 Reference Guide:&amp;nbsp;&lt;A href="https://registry.khronos.org/SYCL/specs/sycl-2020/pdf/sycl-2020.pdf" target="_blank"&gt;https://registry.khronos.org/SYCL/specs/sycl-2020/pdf/sycl-2020.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Intel oneAPI Programming Guide: &lt;A href="https://www.intel.com/content/www/us/en/docs/oneapi/programming-guide/2023-2/device-selection.html" target="_blank" rel="noopener"&gt;https://www.intel.com/content/www/us/en/docs/oneapi/programming-guide/2023-2/device-selection.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Data Parallel C++ by James Reinders: &lt;A href="https://link.springer.com/book/10.1007/978-1-4842-5574-2" target="_blank" rel="noopener"&gt;https://link.springer.com/book/10.1007/978-1-4842-5574-2&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please let us know if you still face any issues.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and Regards,&lt;/P&gt;
&lt;P&gt;Pendyala Sesha Srinivas&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2023 13:00:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-select-host-device/m-p/1526648#M3300</guid>
      <dc:creator>SeshaP_Intel</dc:creator>
      <dc:date>2023-09-22T13:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: How select host device?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-select-host-device/m-p/1526665#M3302</link>
      <description>&lt;P&gt;Hello&amp;nbsp;Srinivas,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you for your reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I may be mistaken, but the SYCL 2020 standard doesn't deprecate the host device. It just doesn't require a SYCL implementation to provide it anymore.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actually, I am not entirely satisfied with using the device selected by `cpu_selector_v` for debugging.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It remains different from the usual CPU. As far as I can see, on my system it uses an OpenCL backend, and while I can set a breakpoint in a line of code inside a kernel, the debugging capabilities I receive are limited compared to what I could get with a host device, where the code is executed as standard machine code and can be debugged as such. For instance, I cannot use step-by-step debugging.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please suggest a method for debugging SYCL kernels that is as convenient as debugging on the host device?&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2023 13:52:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-select-host-device/m-p/1526665#M3302</guid>
      <dc:creator>blinkfrog</dc:creator>
      <dc:date>2023-09-22T13:52:31Z</dc:date>
    </item>
    <item>
      <title>Re:How select host device?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-select-host-device/m-p/1528783#M3311</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;For debugging SYCL kernels, you can use Intel Distribution for GDB. You can debug the application on CPU and GPU using gdb-oneapi.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Please refer to the below links for more references.&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.intel.com/content/www/us/en/docs/distribution-for-gdb/get-started-guide-linux/2023-2/overview.html" target="_blank"&gt;https://www.intel.com/content/www/us/en/docs/distribution-for-gdb/get-started-guide-linux/2023-2/overview.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.intel.com/content/www/us/en/docs/distribution-for-gdb/get-started-guide-windows/2023-2/overview.html" target="_blank"&gt;https://www.intel.com/content/www/us/en/docs/distribution-for-gdb/get-started-guide-windows/2023-2/overview.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.intel.com/content/www/us/en/docs/distribution-for-gdb/tutorial-debugging-dpcpp-linux/2023-2/overview.html" target="_blank"&gt;https://www.intel.com/content/www/us/en/docs/distribution-for-gdb/tutorial-debugging-dpcpp-linux/2023-2/overview.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.intel.com/content/www/us/en/docs/distribution-for-gdb/tutorial-debugging-dpcpp-windows/2023-2/overview.html" target="_blank"&gt;https://www.intel.com/content/www/us/en/docs/distribution-for-gdb/tutorial-debugging-dpcpp-windows/2023-2/overview.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Please let us know if you face any issues.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Pendyala Sesha Srinivas&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 29 Sep 2023 10:40:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-select-host-device/m-p/1528783#M3311</guid>
      <dc:creator>SeshaP_Intel</dc:creator>
      <dc:date>2023-09-29T10:40:58Z</dc:date>
    </item>
    <item>
      <title>Re:How select host device?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-select-host-device/m-p/1528902#M3312</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks for accepting our solution. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Pendyala Sesha Srinivas&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 29 Sep 2023 16:51:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-select-host-device/m-p/1528902#M3312</guid>
      <dc:creator>SeshaP_Intel</dc:creator>
      <dc:date>2023-09-29T16:51:56Z</dc:date>
    </item>
  </channel>
</rss>

