<?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 program stops when declarating queue but gives no error or output (works in the VS Debugger) in Intel® oneAPI DPC++/C++ Compiler</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/SYCL-program-stops-when-declarating-queue-but-gives-no-error-or/m-p/1371391#M1990</link>
    <description>&lt;P&gt;I am new to SYCL and I am trying to execute a very simple code. Here it is:&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;#include &amp;lt;CL/sycl.hpp&amp;gt;
using namespace sycl;

int main() {
    default_selector device_selector;
    std::cout &amp;lt;&amp;lt; "Device selector has been initialized.\n";

    queue q(device_selector);
    std::cout &amp;lt;&amp;lt; "Queue has been initialized.\n";

    return 0;
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I am using Visual Studio 2019 and I am compilating with Intel oneAPI DPC++ 2022. If I run the code in the Visual Studio Debugger, I obtain:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="none"&gt;&amp;gt; Device selector has been initialized.
&amp;gt; Queue has been initialized.
&amp;gt; Sortie de C:\Users\...\Release\test.exe (processus 8516). Code : 0.
&amp;gt; Press any key to continue...&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So this is perfectly what I am expecting. But if I run the same .exe in my command prompt, I obtain:&lt;/P&gt;
&lt;LI-CODE lang="none"&gt;&amp;gt; C:\Users\...\Release&amp;gt;test.exe
&amp;gt; Device selector has been initialized.
&amp;gt;
&amp;gt; C:\Users\...\Release&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It appears that an error occured during the declaration of the queue.&amp;nbsp; But what I get back is nothing, no error, just as if the program ran perfectly.&lt;/P&gt;
&lt;P&gt;I have also noticed that during the short time when the program is running in the command prompt (something like one second), I saw that the program&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Windows Problem Reporting&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;ran in the Task Manager. Than it vanished as soon as the program apparently finished to compute.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also tried this code:&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;#include &amp;lt;CL/sycl.hpp&amp;gt;
using namespace sycl;

int main() {
    default_selector device_selector;
    std::cout &amp;lt;&amp;lt; "Device selector has been initialized.\n";

    try {
        queue q(device_selector);
    } catch (...) {
        std::cout &amp;lt;&amp;lt; "There's an error! Maybe.\n";
    }

    std::cout &amp;lt;&amp;lt; "Queue has been initialized.\n";

    return 0;
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The output was exactly the same.&lt;/P&gt;
&lt;P&gt;If someone has a hint or an idea, I would be pleased to read it.&lt;/P&gt;</description>
    <pubDate>Wed, 23 Mar 2022 16:05:45 GMT</pubDate>
    <dc:creator>frmar</dc:creator>
    <dc:date>2022-03-23T16:05:45Z</dc:date>
    <item>
      <title>SYCL program stops when declarating queue but gives no error or output (works in the VS Debugger)</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/SYCL-program-stops-when-declarating-queue-but-gives-no-error-or/m-p/1371391#M1990</link>
      <description>&lt;P&gt;I am new to SYCL and I am trying to execute a very simple code. Here it is:&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;#include &amp;lt;CL/sycl.hpp&amp;gt;
using namespace sycl;

int main() {
    default_selector device_selector;
    std::cout &amp;lt;&amp;lt; "Device selector has been initialized.\n";

    queue q(device_selector);
    std::cout &amp;lt;&amp;lt; "Queue has been initialized.\n";

    return 0;
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I am using Visual Studio 2019 and I am compilating with Intel oneAPI DPC++ 2022. If I run the code in the Visual Studio Debugger, I obtain:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="none"&gt;&amp;gt; Device selector has been initialized.
&amp;gt; Queue has been initialized.
&amp;gt; Sortie de C:\Users\...\Release\test.exe (processus 8516). Code : 0.
&amp;gt; Press any key to continue...&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So this is perfectly what I am expecting. But if I run the same .exe in my command prompt, I obtain:&lt;/P&gt;
&lt;LI-CODE lang="none"&gt;&amp;gt; C:\Users\...\Release&amp;gt;test.exe
&amp;gt; Device selector has been initialized.
&amp;gt;
&amp;gt; C:\Users\...\Release&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It appears that an error occured during the declaration of the queue.&amp;nbsp; But what I get back is nothing, no error, just as if the program ran perfectly.&lt;/P&gt;
&lt;P&gt;I have also noticed that during the short time when the program is running in the command prompt (something like one second), I saw that the program&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Windows Problem Reporting&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;ran in the Task Manager. Than it vanished as soon as the program apparently finished to compute.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also tried this code:&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;#include &amp;lt;CL/sycl.hpp&amp;gt;
using namespace sycl;

int main() {
    default_selector device_selector;
    std::cout &amp;lt;&amp;lt; "Device selector has been initialized.\n";

    try {
        queue q(device_selector);
    } catch (...) {
        std::cout &amp;lt;&amp;lt; "There's an error! Maybe.\n";
    }

    std::cout &amp;lt;&amp;lt; "Queue has been initialized.\n";

    return 0;
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The output was exactly the same.&lt;/P&gt;
&lt;P&gt;If someone has a hint or an idea, I would be pleased to read it.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 16:05:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/SYCL-program-stops-when-declarating-queue-but-gives-no-error-or/m-p/1371391#M1990</guid>
      <dc:creator>frmar</dc:creator>
      <dc:date>2022-03-23T16:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: SYCL program stops when declarating queue but gives no error or output (works in the VS Debugger</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/SYCL-program-stops-when-declarating-queue-but-gives-no-error-or/m-p/1371685#M1993</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for posting in Intel Communities.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've tried compiling both the sample codes that you've provided and I am able to get the expected results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please refer to the attached screenshots for more information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please let us know if you're using Intel oneAPI command prompt or System command prompt?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you wish to execute the code on System command prompt, then please configure the oneAPI environment by following the steps mentioned below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Go to File Explorer --&amp;gt; C:\Program Files (x86)\intel\oneAPI --&amp;gt; Copy Address --&amp;gt; Open System command prompt and go to this path --&amp;gt; Then enter the command "setvars.bat" to configure your oneAPI environment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, could you please try compiling a sample code on oneAPI CLI and let us know if you're facing the same issue?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please follow the steps mentioned in the link below to build and run a sample project.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.intel.com/content/www/us/en/develop/documentation/get-started-with-intel-oneapi-base-windows/top/run-project-visual-studio-command-line.html" target="_blank" rel="noopener"&gt;https://www.intel.com/content/www/us/en/develop/documentation/get-started-with-intel-oneapi-base-windows/top/run-project-visual-studio-command-line.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please do let us know if you are still facing the same issue while compiling the sample code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and Regards,&lt;/P&gt;
&lt;P&gt;Ditipriya.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2022 11:01:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/SYCL-program-stops-when-declarating-queue-but-gives-no-error-or/m-p/1371685#M1993</guid>
      <dc:creator>DitiD_Intel</dc:creator>
      <dc:date>2022-03-24T11:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: SYCL program stops when declarating queue but gives no error or output (works in the VS Debugger</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/SYCL-program-stops-when-declarating-queue-but-gives-no-error-or/m-p/1371711#M1995</link>
      <description>&lt;P&gt;Hello Ditipriya,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a lot for your answer. The .exe file was indeed working when I was using the Intel oneAPI command prompt. After using setvars.bat, everything is working perfectly, even in the Windows command prompt.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a nice day.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2022 13:27:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/SYCL-program-stops-when-declarating-queue-but-gives-no-error-or/m-p/1371711#M1995</guid>
      <dc:creator>frmar</dc:creator>
      <dc:date>2022-03-24T13:27:25Z</dc:date>
    </item>
    <item>
      <title>Re:SYCL program stops when declarating queue but gives no error or output (works in the VS Debugger)</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/SYCL-program-stops-when-declarating-queue-but-gives-no-error-or/m-p/1371947#M1998</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&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 and Regards,&lt;/P&gt;&lt;P&gt;Ditipriya.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 25 Mar 2022 05:48:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/SYCL-program-stops-when-declarating-queue-but-gives-no-error-or/m-p/1371947#M1998</guid>
      <dc:creator>DitiD_Intel</dc:creator>
      <dc:date>2022-03-25T05:48:11Z</dc:date>
    </item>
  </channel>
</rss>

