<?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:DPC++ deadlock an application after using buffe... in Intel® oneAPI DPC++/C++ Compiler</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPC-deadlock-an-application-after-using-buffer-with-quot-write/m-p/1193623#M589</link>
    <description>&lt;P&gt;Hi Nikita,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Moving towards your question, t&lt;SPAN style="background-color: var(--lwc-colorbackgroundinput,#ffffff); color: var(--lwc-colortextweak,#3e3e3c);"&gt;here is no such restriction on working with the buffer via host accessors. You can do that according to your scenario. But there are some important things which you have to follow while using the host accessor which will help you to resolve your problem.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Creating accessor of the access target &lt;STRONG&gt;host_buffer&lt;/STRONG&gt; is a blocking operation that defines a requirement on the host and blocks the caller until the requirement is satisfied. So we need to call its destructor in order to stop the blocking operation.&lt;/P&gt;
&lt;P&gt;You can put those accessor and there related processes in the scope so that it will automatically call its destructor and will execute the remaining operations without blocking. Below code snippet will help you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;{ //start of scope
            auto buf_w = buf2.get_access&amp;lt;access::mode::write&amp;gt;();
            for (size_t i = 0; i &amp;lt; ARRAY_SIZE; i++)
                &amp;lt;operations&amp;gt;
} //end of scope
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have also attached the modified code with necessary changes you also refer them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Warm Regards,&lt;/P&gt;
&lt;P&gt;Abhishek&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 20 Jul 2020 13:03:43 GMT</pubDate>
    <dc:creator>AbhishekD_Intel</dc:creator>
    <dc:date>2020-07-20T13:03:43Z</dc:date>
    <item>
      <title>DPC++ deadlock an application after using buffer with "write" access on host side</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPC-deadlock-an-application-after-using-buffer-with-quot-write/m-p/1193326#M581</link>
      <description>&lt;P&gt;As described in title, if you create buffer, get "write" access, fill memory via the accessor on host side, and then try to get read accessor on host side too, then you will be blocked forever. Looks like, that host side wait realizing some mutex lock, but I suspect, that the mutex should be released also on host side, so deadlock.&lt;BR /&gt;I know, that you can use buffer constructor, which receive host memory ptr (which can have needed data, which initialise before buffer construction), but if I am not mistaken, SYCL don't disallow to working with buffer via accessor on host side. And API also allow it, otherwise I couldn't write the code via existed SYCL API.&lt;/P&gt;
&lt;P&gt;Minimal reproduce example is attached. File with building instruction, full backtrace and system description is attached too.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2020 18:17:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPC-deadlock-an-application-after-using-buffer-with-quot-write/m-p/1193326#M581</guid>
      <dc:creator>sirgienko</dc:creator>
      <dc:date>2020-07-17T18:17:19Z</dc:date>
    </item>
    <item>
      <title>Re:DPC++ deadlock an application after using buffe...</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPC-deadlock-an-application-after-using-buffer-with-quot-write/m-p/1193623#M589</link>
      <description>&lt;P&gt;Hi Nikita,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Moving towards your question, t&lt;SPAN style="background-color: var(--lwc-colorbackgroundinput,#ffffff); color: var(--lwc-colortextweak,#3e3e3c);"&gt;here is no such restriction on working with the buffer via host accessors. You can do that according to your scenario. But there are some important things which you have to follow while using the host accessor which will help you to resolve your problem.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Creating accessor of the access target &lt;STRONG&gt;host_buffer&lt;/STRONG&gt; is a blocking operation that defines a requirement on the host and blocks the caller until the requirement is satisfied. So we need to call its destructor in order to stop the blocking operation.&lt;/P&gt;
&lt;P&gt;You can put those accessor and there related processes in the scope so that it will automatically call its destructor and will execute the remaining operations without blocking. Below code snippet will help you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;{ //start of scope
            auto buf_w = buf2.get_access&amp;lt;access::mode::write&amp;gt;();
            for (size_t i = 0; i &amp;lt; ARRAY_SIZE; i++)
                &amp;lt;operations&amp;gt;
} //end of scope
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have also attached the modified code with necessary changes you also refer them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Warm Regards,&lt;/P&gt;
&lt;P&gt;Abhishek&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jul 2020 13:03:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPC-deadlock-an-application-after-using-buffer-with-quot-write/m-p/1193623#M589</guid>
      <dc:creator>AbhishekD_Intel</dc:creator>
      <dc:date>2020-07-20T13:03:43Z</dc:date>
    </item>
    <item>
      <title>Re:DPC++ deadlock an application after using buffe...</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPC-deadlock-an-application-after-using-buffer-with-quot-write/m-p/1193627#M591</link>
      <description>&lt;P&gt;Hi Nikita,&lt;/P&gt;
&lt;P&gt;Happy to know that the provided solution helped you. Please confirm if we can close this thread.&lt;/P&gt;
&lt;P&gt;You can always post a new thread if you face any issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Warm Regards,&lt;/P&gt;
&lt;P&gt;Abhishek&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jul 2020 13:16:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPC-deadlock-an-application-after-using-buffer-with-quot-write/m-p/1193627#M591</guid>
      <dc:creator>AbhishekD_Intel</dc:creator>
      <dc:date>2020-07-20T13:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: Re:DPC++ deadlock an application after using buffe...</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPC-deadlock-an-application-after-using-buffer-with-quot-write/m-p/1193628#M592</link>
      <description>&lt;P&gt;Yes, this thread can be closed.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jul 2020 13:20:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPC-deadlock-an-application-after-using-buffer-with-quot-write/m-p/1193628#M592</guid>
      <dc:creator>sirgienko</dc:creator>
      <dc:date>2020-07-20T13:20:03Z</dc:date>
    </item>
    <item>
      <title>Re:DPC++ deadlock an application after using buffe...</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPC-deadlock-an-application-after-using-buffer-with-quot-write/m-p/1193634#M593</link>
      <description>&lt;P&gt;Thank you for the confirmation we are closing this thread.&lt;/P&gt;&lt;P&gt;Please post a new thread if you have further issues.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Warm Regards,&lt;/P&gt;&lt;P&gt;Abhishek&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Jul 2020 13:29:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPC-deadlock-an-application-after-using-buffer-with-quot-write/m-p/1193634#M593</guid>
      <dc:creator>AbhishekD_Intel</dc:creator>
      <dc:date>2020-07-20T13:29:05Z</dc:date>
    </item>
  </channel>
</rss>

