<?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 How can I submit two queues parallelly in DPC++? in Intel® oneAPI DPC++/C++ Compiler</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-can-I-submit-two-queues-parallelly-in-DPC/m-p/1405733#M2413</link>
    <description>&lt;P&gt;Hello, I am a beginner of DPC++. Recently I ran into a problem about submitting two queues parallelly on two devices.&lt;/P&gt;
&lt;P&gt;Now I have two Intel GPUs, I want to submit my two queues to them. One queue for one GPU. So maybe I only need half original time to compute my task.&lt;/P&gt;
&lt;P&gt;Could you give me a piece of simple example code about parallel task submission? I can not post my code online for some reasons. Thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 03 Aug 2022 15:04:09 GMT</pubDate>
    <dc:creator>tanzl_ustc</dc:creator>
    <dc:date>2022-08-03T15:04:09Z</dc:date>
    <item>
      <title>How can I submit two queues parallelly in DPC++?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-can-I-submit-two-queues-parallelly-in-DPC/m-p/1405733#M2413</link>
      <description>&lt;P&gt;Hello, I am a beginner of DPC++. Recently I ran into a problem about submitting two queues parallelly on two devices.&lt;/P&gt;
&lt;P&gt;Now I have two Intel GPUs, I want to submit my two queues to them. One queue for one GPU. So maybe I only need half original time to compute my task.&lt;/P&gt;
&lt;P&gt;Could you give me a piece of simple example code about parallel task submission? I can not post my code online for some reasons. Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 15:04:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-can-I-submit-two-queues-parallelly-in-DPC/m-p/1405733#M2413</guid>
      <dc:creator>tanzl_ustc</dc:creator>
      <dc:date>2022-08-03T15:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: How can I submit two queues parallelly in DPC++?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-can-I-submit-two-queues-parallelly-in-DPC/m-p/1406258#M2418</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for posting in Intel communities.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We can use a custom device selector to run multiple device queues parallelly.&lt;/P&gt;
&lt;P&gt;Custom Device Selector is a user-defined class, which is derived from the device selector class.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We can select any device(CPU (or) any Accelerator) using this Custom Device Selector.&lt;/P&gt;
&lt;P&gt;Please refer to the below code snippet for more details.&lt;/P&gt;
&lt;P&gt;You can use 2 Intel GPUs to run the program through a custom device selector as defined in the below code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;#include&amp;lt;CL/sycl.hpp&amp;gt;
#include&amp;lt;vector&amp;gt;
#include&amp;lt;iostream&amp;gt;
#include&amp;lt;string&amp;gt;
using namespace cl::sycl;
using namespace std;
static const int N = 4;
class my_selector1 : public device_selector
{
public:
int operator()(const device &amp;amp;dev) const
{
int score = -1;
if ( (dev.is_gpu()) &amp;amp;&amp;amp; (dev.get_info&amp;lt;info::device::name&amp;gt;().find("GPU1")!= std::string::npos) )//Replace GPU1 with your available INTEL GPU
{
score += 25;
std::cout &amp;lt;&amp;lt; "my_selector1 = "&amp;lt;&amp;lt; dev.get_info&amp;lt;info::device::name&amp;gt;()&amp;lt;&amp;lt;"\n" ;
}

return score;
}
};
class my_selector2 : public device_selector
{
public:
int operator()(const device &amp;amp;dev) const
{
int score = -1;
if ( (dev.is_gpu()) &amp;amp;&amp;amp; (dev.get_info&amp;lt;info::device::name&amp;gt;().find("GPU2")== std::string::npos) )//Replace GPU2 with your available INTEL GPU
{
score += 800;
std::cout &amp;lt;&amp;lt; "my_selector2 = "&amp;lt;&amp;lt; dev.get_info&amp;lt;info::device::name&amp;gt;()&amp;lt;&amp;lt;"\n" ;
}
return score;
}
};

int main()
{
auto Q1 = queue{ my_selector1{} };
int *a1 = malloc_shared&amp;lt;int&amp;gt;(N, Q1);
for(int i=0; i&amp;lt;N; i++) a1[i] = i;
std::cout &amp;lt;&amp;lt; "Selected device: " &amp;lt;&amp;lt;Q1.get_device().get_info&amp;lt;info::device::name&amp;gt;() &amp;lt;&amp;lt; "\n";
Q1.single_task([=](){
    for(int i=0;i&amp;lt;N;i++){
      a1[i] *= 2;
    }
  }).wait();

auto Q2 = queue{ my_selector2{} };
int *a2 = malloc_shared&amp;lt;int&amp;gt;(N, Q2);
for(int i=0; i&amp;lt;N; i++) a2[i] = i;
std::cout &amp;lt;&amp;lt; "Selected device: " &amp;lt;&amp;lt;Q2.get_device().get_info&amp;lt;info::device::name&amp;gt;() &amp;lt;&amp;lt; "\n";
Q2.single_task([=](){
    for(int i=0;i&amp;lt;N;i++){
      a2[i] *= 3;
    }
  }).wait();

for(int i=0; i&amp;lt;N; i++) std::cout &amp;lt;&amp;lt; a1[i] &amp;lt;&amp;lt; std::endl;
for(int i=0; i&amp;lt;N; i++) std::cout &amp;lt;&amp;lt; a2[i] &amp;lt;&amp;lt; std::endl;
free(a1, Q1);
free(a2, Q2);

return 0;
}&lt;/LI-CODE&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, 05 Aug 2022 08:03:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-can-I-submit-two-queues-parallelly-in-DPC/m-p/1406258#M2418</guid>
      <dc:creator>SeshaP_Intel</dc:creator>
      <dc:date>2022-08-05T08:03:48Z</dc:date>
    </item>
    <item>
      <title>Re:How can I submit two queues parallelly in DPC++?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-can-I-submit-two-queues-parallelly-in-DPC/m-p/1407830#M2432</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;We haven't heard back from you. Could you please provide an update on your issue?&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, 12 Aug 2022 06:10:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-can-I-submit-two-queues-parallelly-in-DPC/m-p/1407830#M2432</guid>
      <dc:creator>SeshaP_Intel</dc:creator>
      <dc:date>2022-08-12T06:10:45Z</dc:date>
    </item>
    <item>
      <title>Re:How can I submit two queues parallelly in DPC++?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-can-I-submit-two-queues-parallelly-in-DPC/m-p/1409408#M2444</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;We assume that your issue is resolved. 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, 19 Aug 2022 11:34:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/How-can-I-submit-two-queues-parallelly-in-DPC/m-p/1409408#M2444</guid>
      <dc:creator>SeshaP_Intel</dc:creator>
      <dc:date>2022-08-19T11:34:07Z</dc:date>
    </item>
  </channel>
</rss>

