<?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 sycl::exception get_cl_code() function not working in Intel® oneAPI DPC++/C++ Compiler</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/sycl-exception-get-cl-code-function-not-working/m-p/1377734#M2052</link>
    <description>&lt;P&gt;The below piece of code from a oneAPI program is giving an error.&lt;/P&gt;
&lt;P&gt;if (e.get_cl_code() == CL_DEVICE_NOT_FOUND) {&lt;BR /&gt;std::cout &amp;lt;&amp;lt; "If you are targeting an FPGA, ensure that your "&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN class="ansi-bold"&gt;src/split/hough_transform_kernel.cpp:75:15: &lt;/SPAN&gt;&lt;SPAN class="ansi-magenta-intense-fg ansi-bold"&gt;warning: &lt;/SPAN&gt;&lt;SPAN class="ansi-bold"&gt;'get_cl_code' is deprecated: use sycl::exception.code() instead. [-Wdeprecated-declarations]&lt;/SPAN&gt;
        if (e.get_cl_code() == CL_DEVICE_NOT_FOUND) {
&lt;SPAN class="ansi-green-intense-fg ansi-bold"&gt;              ^&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As suggested in the error, tried using&amp;nbsp;&amp;nbsp;&lt;SPAN class="ansi-bold"&gt;sycl::exception.code() instead:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="ansi-bold"&gt;if (sycl::exception.code() == CL_DEVICE_NOT_FOUND) {&lt;BR /&gt;std::cout &amp;lt;&amp;lt; "If you are targeting an FPGA, ensure that your "&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;But that gives the following error:&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN class="ansi-bold"&gt;src/split/hough_transform_kernel.cpp:75:28: &lt;/SPAN&gt;&lt;SPAN class="ansi-red-intense-fg ansi-bold"&gt;error: &lt;/SPAN&gt;&lt;SPAN class="ansi-bold"&gt;cannot use dot operator on a type&lt;/SPAN&gt;
        if (sycl::exception.code() == CL_DEVICE_NOT_FOUND) {
&lt;SPAN class="ansi-green-intense-fg ansi-bold"&gt;                           ^&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please let me know what is the correct usage here.&lt;/P&gt;
&lt;P&gt;Further referring to the first error, it states '&lt;SPAN class="ansi-bold"&gt;'get_cl_code' is deprecated&lt;/SPAN&gt;', but the sycl specification from this link&amp;nbsp;&lt;A href="https://sycl.readthedocs.io/en/latest/iface/exception.html" target="_blank"&gt;https://sycl.readthedocs.io/en/latest/iface/exception.html&lt;/A&gt;&amp;nbsp;shows '&lt;SPAN class="ansi-bold"&gt;get_cl_code' is still supported. So please clarify where I can find the updated sycl spec for this error.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="ansi-bold"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="ansi-bold"&gt;Deepika&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 18 Apr 2022 01:45:54 GMT</pubDate>
    <dc:creator>DeepikaGanga</dc:creator>
    <dc:date>2022-04-18T01:45:54Z</dc:date>
    <item>
      <title>sycl::exception get_cl_code() function not working</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/sycl-exception-get-cl-code-function-not-working/m-p/1377734#M2052</link>
      <description>&lt;P&gt;The below piece of code from a oneAPI program is giving an error.&lt;/P&gt;
&lt;P&gt;if (e.get_cl_code() == CL_DEVICE_NOT_FOUND) {&lt;BR /&gt;std::cout &amp;lt;&amp;lt; "If you are targeting an FPGA, ensure that your "&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN class="ansi-bold"&gt;src/split/hough_transform_kernel.cpp:75:15: &lt;/SPAN&gt;&lt;SPAN class="ansi-magenta-intense-fg ansi-bold"&gt;warning: &lt;/SPAN&gt;&lt;SPAN class="ansi-bold"&gt;'get_cl_code' is deprecated: use sycl::exception.code() instead. [-Wdeprecated-declarations]&lt;/SPAN&gt;
        if (e.get_cl_code() == CL_DEVICE_NOT_FOUND) {
&lt;SPAN class="ansi-green-intense-fg ansi-bold"&gt;              ^&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As suggested in the error, tried using&amp;nbsp;&amp;nbsp;&lt;SPAN class="ansi-bold"&gt;sycl::exception.code() instead:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="ansi-bold"&gt;if (sycl::exception.code() == CL_DEVICE_NOT_FOUND) {&lt;BR /&gt;std::cout &amp;lt;&amp;lt; "If you are targeting an FPGA, ensure that your "&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;But that gives the following error:&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN class="ansi-bold"&gt;src/split/hough_transform_kernel.cpp:75:28: &lt;/SPAN&gt;&lt;SPAN class="ansi-red-intense-fg ansi-bold"&gt;error: &lt;/SPAN&gt;&lt;SPAN class="ansi-bold"&gt;cannot use dot operator on a type&lt;/SPAN&gt;
        if (sycl::exception.code() == CL_DEVICE_NOT_FOUND) {
&lt;SPAN class="ansi-green-intense-fg ansi-bold"&gt;                           ^&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please let me know what is the correct usage here.&lt;/P&gt;
&lt;P&gt;Further referring to the first error, it states '&lt;SPAN class="ansi-bold"&gt;'get_cl_code' is deprecated&lt;/SPAN&gt;', but the sycl specification from this link&amp;nbsp;&lt;A href="https://sycl.readthedocs.io/en/latest/iface/exception.html" target="_blank"&gt;https://sycl.readthedocs.io/en/latest/iface/exception.html&lt;/A&gt;&amp;nbsp;shows '&lt;SPAN class="ansi-bold"&gt;get_cl_code' is still supported. So please clarify where I can find the updated sycl spec for this error.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="ansi-bold"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="ansi-bold"&gt;Deepika&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Apr 2022 01:45:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/sycl-exception-get-cl-code-function-not-working/m-p/1377734#M2052</guid>
      <dc:creator>DeepikaGanga</dc:creator>
      <dc:date>2022-04-18T01:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: sycl::exception get_cl_code() function not working</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/sycl-exception-get-cl-code-function-not-working/m-p/1378108#M2053</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;Please try using the below code snippet as we are getting the expected results without any errors.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;catch(sycl::exception const&amp;amp; e) {
     if (e.code().value() == CL_DEVICE_NOT_FOUND) {&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please try and let us know if you are still facing any issues? Please provide us with a sample reproducer code if the provided code snippet does not work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;
&lt;P&gt;Varsha&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 12:05:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/sycl-exception-get-cl-code-function-not-working/m-p/1378108#M2053</guid>
      <dc:creator>VarshaS_Intel</dc:creator>
      <dc:date>2022-04-19T12:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: sycl::exception get_cl_code() function not working</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/sycl-exception-get-cl-code-function-not-working/m-p/1378376#M2058</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Glad to know that your issue is resolved. Thanks for accepting our solution. If you need any additional information, please post a new question as this thread will&amp;nbsp;no longer be monitored by Intel.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;
&lt;P&gt;Varsha&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2022 05:22:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/sycl-exception-get-cl-code-function-not-working/m-p/1378376#M2058</guid>
      <dc:creator>VarshaS_Intel</dc:creator>
      <dc:date>2022-04-20T05:22:08Z</dc:date>
    </item>
  </channel>
</rss>

