<?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 Yes it works. Thanks. in Intel® oneAPI DPC++/C++ Compiler</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-to-run-dpc-code-on-Intel-HD-Graphic-atop-Nvidia-GPU/m-p/1182497#M374</link>
    <description>&lt;P&gt;Yes it works. Thanks.&lt;/P&gt;</description>
    <pubDate>Sat, 15 Feb 2020 14:50:15 GMT</pubDate>
    <dc:creator>nnain1</dc:creator>
    <dc:date>2020-02-15T14:50:15Z</dc:date>
    <item>
      <title>How to run dpc++ code on Intel HD Graphic atop Nvidia GPU</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-to-run-dpc-code-on-Intel-HD-Graphic-atop-Nvidia-GPU/m-p/1182494#M371</link>
      <description>&lt;P&gt;My windows laptop has two Gpus, nvidia GPU and Intel HD Graphic. How to run dpc++ code on Intel Graphic atop Nvidia GPU?&lt;/P&gt;
&lt;PRE class="brush:cpp; class-name:dark;"&gt;queue myQueue(gpu_selector{}) &lt;/PRE&gt;

&lt;P&gt;gives Nvidia GPU and can't find Intel Graphic.&lt;/P&gt;
&lt;P&gt;But I just like to make Intel Graphic for dpc++ applications, not for any other applications and processes.&lt;/P&gt;
&lt;P&gt;My system can detect both as shown in the following image.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="devices.png"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/10628iA87E3DBA504E790F/image-size/large?v=v2&amp;amp;px=999&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="devices.png" alt="devices.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 13:31:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-to-run-dpc-code-on-Intel-HD-Graphic-atop-Nvidia-GPU/m-p/1182494#M371</guid>
      <dc:creator>nnain1</dc:creator>
      <dc:date>2020-02-03T13:31:01Z</dc:date>
    </item>
    <item>
      <title>Hi,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-to-run-dpc-code-on-Intel-HD-Graphic-atop-Nvidia-GPU/m-p/1182495#M372</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks for reaching out to us.&lt;/P&gt;&lt;P&gt;We are working on your issue. We will get back to you with a sample code template with your requirements.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;-Goutham&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2020 11:57:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-to-run-dpc-code-on-Intel-HD-Graphic-atop-Nvidia-GPU/m-p/1182495#M372</guid>
      <dc:creator>GouthamK_Intel</dc:creator>
      <dc:date>2020-02-04T11:57:30Z</dc:date>
    </item>
    <item>
      <title>Hi Nyan,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-to-run-dpc-code-on-Intel-HD-Graphic-atop-Nvidia-GPU/m-p/1182496#M373</link>
      <description>&lt;P&gt;Hi Nyan,&lt;/P&gt;&lt;P&gt;Sorry for the delay in response.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please use the below "&lt;STRONG&gt;custom_selector&lt;/STRONG&gt;" class in order to select a specific device from available devices.&lt;/P&gt;&lt;P&gt;Here in this "&lt;STRONG&gt;custom_selector&lt;/STRONG&gt;" class, we are explicitly selecting Intel iGPU over Nvidia GPU.&lt;/P&gt;
&lt;PRE class="brush:cpp; class-name:dark;"&gt;#include &amp;lt;CL/sycl.hpp&amp;gt;
#include &amp;lt;string&amp;gt; 

using namespace cl::sycl;

class custom_selector : public device_selector {
 public:
  custom_selector() : device_selector() {}

  int operator()(const device&amp;amp; device) const override {
      std::string device_name=device.get_info&amp;lt;info::device::name&amp;gt;();
      if (device_name.find("Intel")!=std::string::npos) // Selecting Intel Device
           if (device.get_info&amp;lt;info::device::device_type&amp;gt;() == info::device_type::gpu) //Selecting GPU device
               return 100;
     return -1;
  }
};

int main() {
  custom_selector selector;
  queue myQueue(selector);
    {
    std::cout&amp;lt;&amp;lt;"Device Name: "&amp;lt;&amp;lt;myQueue.get_device().get_info&amp;lt;info::device::name&amp;gt;() &amp;lt;&amp;lt;std::endl;
  myQueue.submit([&amp;amp;](handler&amp;amp; cgh) {
    cgh.parallel_for&amp;lt;class my_selector&amp;gt;(dataRange, [=](item&amp;lt;1&amp;gt; item) {
      size_t idx = item.get_linear_id();
//==============Your code Logic==================
    });
  });
}
    myQueue.wait();
  return 0;
}&lt;/PRE&gt;

&lt;P&gt;I hope this resolves your issue. Please let us know if you face any further issues.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Goutham&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 08:27:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-to-run-dpc-code-on-Intel-HD-Graphic-atop-Nvidia-GPU/m-p/1182496#M373</guid>
      <dc:creator>GouthamK_Intel</dc:creator>
      <dc:date>2020-02-12T08:27:00Z</dc:date>
    </item>
    <item>
      <title>Yes it works. Thanks.</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-to-run-dpc-code-on-Intel-HD-Graphic-atop-Nvidia-GPU/m-p/1182497#M374</link>
      <description>&lt;P&gt;Yes it works. Thanks.&lt;/P&gt;</description>
      <pubDate>Sat, 15 Feb 2020 14:50:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-to-run-dpc-code-on-Intel-HD-Graphic-atop-Nvidia-GPU/m-p/1182497#M374</guid>
      <dc:creator>nnain1</dc:creator>
      <dc:date>2020-02-15T14:50:15Z</dc:date>
    </item>
    <item>
      <title>Hi,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-to-run-dpc-code-on-Intel-HD-Graphic-atop-Nvidia-GPU/m-p/1182498#M375</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Glad to hear that the solution&amp;nbsp;provided has worked. We are closing this thread.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2020 05:09:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-to-run-dpc-code-on-Intel-HD-Graphic-atop-Nvidia-GPU/m-p/1182498#M375</guid>
      <dc:creator>RahulV_intel</dc:creator>
      <dc:date>2020-02-17T05:09:00Z</dc:date>
    </item>
  </channel>
</rss>

