<?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 std::set does not working in for_parallel() in Intel® oneAPI DPC++/C++ Compiler</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/std-set-does-not-working-in-for-parallel/m-p/1383213#M2123</link>
    <description>&lt;P&gt;While working using sycl I found something weird.&lt;BR /&gt;I started by using an unordered_set in my for_parallel() and everything worked perfectly, however I ended up having to ordered my set, so I thought that I would have just to replace all my 'unordered_set' by 'set' but it resulted in a&amp;nbsp; way too hard to understand by me error (cf error.txt).&lt;BR /&gt;After fooling around to understand a bit more the problem, I found out that It is impossible (at least for me) to manipulate set in a for_parallel() (ex iteration in a foreach or pass it as a parameter in a function) and I couldn't find anywhere on the internet someone having the same problem as me. The answer might be written in a documentation but I didn't find anything.&lt;/P&gt;
&lt;P&gt;The test code I wrote : test_set.cpp, test_unordered_set.cpp. The only difference in those two is that set is replaced by ordered_set.(I had to comment to be able to attach them)&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;So I only wanted to know why it is possible to use unordered_set in for_parallel() but not a set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your answer.&lt;/P&gt;</description>
    <pubDate>Tue, 10 May 2022 16:10:31 GMT</pubDate>
    <dc:creator>tgave</dc:creator>
    <dc:date>2022-05-10T16:10:31Z</dc:date>
    <item>
      <title>std::set does not working in for_parallel()</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/std-set-does-not-working-in-for-parallel/m-p/1383213#M2123</link>
      <description>&lt;P&gt;While working using sycl I found something weird.&lt;BR /&gt;I started by using an unordered_set in my for_parallel() and everything worked perfectly, however I ended up having to ordered my set, so I thought that I would have just to replace all my 'unordered_set' by 'set' but it resulted in a&amp;nbsp; way too hard to understand by me error (cf error.txt).&lt;BR /&gt;After fooling around to understand a bit more the problem, I found out that It is impossible (at least for me) to manipulate set in a for_parallel() (ex iteration in a foreach or pass it as a parameter in a function) and I couldn't find anywhere on the internet someone having the same problem as me. The answer might be written in a documentation but I didn't find anything.&lt;/P&gt;
&lt;P&gt;The test code I wrote : test_set.cpp, test_unordered_set.cpp. The only difference in those two is that set is replaced by ordered_set.(I had to comment to be able to attach them)&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;So I only wanted to know why it is possible to use unordered_set in for_parallel() but not a set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your answer.&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 16:10:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/std-set-does-not-working-in-for-parallel/m-p/1383213#M2123</guid>
      <dc:creator>tgave</dc:creator>
      <dc:date>2022-05-10T16:10:31Z</dc:date>
    </item>
    <item>
      <title>Re:std::set does not working in for_parallel()</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/std-set-does-not-working-in-for-parallel/m-p/1383776#M2131</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thank you for posting in Intel Communities.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;According to SYCL specifications(&lt;A href="https://www.khronos.org/registry/SYCL/specs/sycl-1.2.1.pdf)[page" target="_blank"&gt;https://www.khronos.org/registry/SYCL/specs/sycl-1.2.1.pdf)[page&lt;/A&gt; no-257], recursion is not allowed in a SYCL kernel or any code called from the kernel.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;"set" internally uses a BST(Binary Search Tree) whereas "unordered_set" internally uses a hash table. &lt;/P&gt;&lt;P&gt;Since BST uses recursive calls for traversals, we are getting an error: "SYCL kernel cannot call a recursive function".  &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;As SYCL doesn't allow us to use recursive calls inside a SYCL kernel, we can't use sets inside a SYCL kernel.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 12 May 2022 10:56:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/std-set-does-not-working-in-for-parallel/m-p/1383776#M2131</guid>
      <dc:creator>SantoshY_Intel</dc:creator>
      <dc:date>2022-05-12T10:56:36Z</dc:date>
    </item>
    <item>
      <title>Re:std::set does not working in for_parallel()</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/std-set-does-not-working-in-for-parallel/m-p/1384079#M2142</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 &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 13 May 2022 08:00:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/std-set-does-not-working-in-for-parallel/m-p/1384079#M2142</guid>
      <dc:creator>SantoshY_Intel</dc:creator>
      <dc:date>2022-05-13T08:00:15Z</dc:date>
    </item>
  </channel>
</rss>

