<?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 Dpcpp /link flag on Windows generate executable with SYCL code not runnable on device in Intel® oneAPI DPC++/C++ Compiler</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Dpcpp-link-flag-on-Windows-generate-executable-with-SYCL-code/m-p/1240047#M856</link>
    <description>&lt;P&gt;Dear Support Team,&lt;/P&gt;
&lt;P&gt;I am trying Dpcpp 2021.1 on Win10 (Ver 2004) with SYCL running on Intel Core i7-8850H. Below are the compilation commands generated by cmake:&lt;/P&gt;
&lt;P&gt;C:\Program Files (x86)\Intel\oneAPI\compiler\2021.1.1\windows\..\windows\bin\dpcpp.exe /W1 /Od /D USE_DPCPP /D CPU /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /WX- /EHsc /std:c++17 /MD /c /IC:\Users\amont\Documents\github\amontse\CMakeDpcpp\.. /Fo"parallel.dir\Debug\\" C:\Users\amont\Documents\github\amontse\CMakeDpcpp\parallel\iota_parallel.cpp&lt;/P&gt;
&lt;P&gt;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX64\x64\Lib.exe /OUT:"C:\Users\amont\Documents\github\amontse\CMakeDpcpp\out\build\x64-dpcpp-Debug\Debug-CPU\Debug\parallel.lib" /NOLOGO /MACHINE:X64 parallel.dir\Debug\iota_parallel.obj&lt;/P&gt;
&lt;P&gt;C:\Program Files (x86)\Intel\oneAPI\compiler\2021.1.1\windows\..\windows\bin\dpcpp.exe /W1 /Od /D USE_DPCPP /D CPU /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /WX- /EHsc /std:c++17 /MD /c /IC:\Users\amont\Documents\github\amontse\CMakeDpcpp\.. /Fo"sequential.dir\Debug\\" C:\Users\amont\Documents\github\amontse\CMakeDpcpp\sequential\iota_sequential.cpp&lt;/P&gt;
&lt;P&gt;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX64\x64\Lib.exe /OUT:"C:\Users\amont\Documents\github\amontse\CMakeDpcpp\out\build\x64-dpcpp-Debug\Debug-CPU\Debug\sequential.lib" /NOLOGO /MACHINE:X64 sequential.dir\Debug\iota_sequential.obj&lt;/P&gt;
&lt;P&gt;C:\Program Files (x86)\Intel\oneAPI\compiler\2021.1.1\windows\..\windows\bin\dpcpp.exe /W1 /Od /D USE_DPCPP /D CPU /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /WX- /EHsc /std:c++17 /MD /c /IC:\Users\amont\Documents\github\amontse\CMakeDpcpp\.. /Fo"CMakeDpcpp.dir\Debug\\" C:\Users\amont\Documents\github\amontse\CMakeDpcpp\main\main.cpp&lt;/P&gt;
&lt;P&gt;C:\Program Files (x86)\Intel\oneAPI\compiler\2021.1.1\windows\..\windows\bin\dpcpp.exe /Fe"C:\Users\amont\Documents\github\amontse\CMakeDpcpp\out\build\x64-dpcpp-Debug\Debug-CPU\Debug\CMakeDpcpp.exe" CMakeDpcpp.dir\Debug\main.obj /WX- /MD /nologo &lt;STRONG&gt;/link&lt;/STRONG&gt; "..\Debug-CPU\Debug\sequential.lib" "..\Debug-CPU\Debug\parallel.lib"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The last command is to generate the final execution from main.obj sequential.lib (C++17 code) and parallel.lib (SYCL 1.2 code). The issue is that the executable is run but with exception throw in the SYCL codes:&lt;/P&gt;
&lt;P&gt;Running on device: Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz&lt;BR /&gt;An exception is caught while computing on device: Native API failed. Native API returns: -46 (CL_INVALID_KERNEL_NAME) -46 (CL_INVALID_KERNEL_NAME)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I REMOVE the /link switch in the last command of dpcpp, the executable generated is run and completed successfully as expected.&lt;/P&gt;
&lt;P&gt;An observation is that the executable generated with /link switch is 1/3 side of that generated without the /link switch. I guess the /link switch causes the dpcpp not putting the SPIR-V device code into the output executable.&lt;/P&gt;
&lt;P&gt;May Intel engineer have any comment?&lt;/P&gt;
&lt;P&gt;Amon&lt;/P&gt;</description>
    <pubDate>Wed, 23 Dec 2020 05:08:53 GMT</pubDate>
    <dc:creator>Tse__Amon</dc:creator>
    <dc:date>2020-12-23T05:08:53Z</dc:date>
    <item>
      <title>Dpcpp /link flag on Windows generate executable with SYCL code not runnable on device</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Dpcpp-link-flag-on-Windows-generate-executable-with-SYCL-code/m-p/1240047#M856</link>
      <description>&lt;P&gt;Dear Support Team,&lt;/P&gt;
&lt;P&gt;I am trying Dpcpp 2021.1 on Win10 (Ver 2004) with SYCL running on Intel Core i7-8850H. Below are the compilation commands generated by cmake:&lt;/P&gt;
&lt;P&gt;C:\Program Files (x86)\Intel\oneAPI\compiler\2021.1.1\windows\..\windows\bin\dpcpp.exe /W1 /Od /D USE_DPCPP /D CPU /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /WX- /EHsc /std:c++17 /MD /c /IC:\Users\amont\Documents\github\amontse\CMakeDpcpp\.. /Fo"parallel.dir\Debug\\" C:\Users\amont\Documents\github\amontse\CMakeDpcpp\parallel\iota_parallel.cpp&lt;/P&gt;
&lt;P&gt;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX64\x64\Lib.exe /OUT:"C:\Users\amont\Documents\github\amontse\CMakeDpcpp\out\build\x64-dpcpp-Debug\Debug-CPU\Debug\parallel.lib" /NOLOGO /MACHINE:X64 parallel.dir\Debug\iota_parallel.obj&lt;/P&gt;
&lt;P&gt;C:\Program Files (x86)\Intel\oneAPI\compiler\2021.1.1\windows\..\windows\bin\dpcpp.exe /W1 /Od /D USE_DPCPP /D CPU /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /WX- /EHsc /std:c++17 /MD /c /IC:\Users\amont\Documents\github\amontse\CMakeDpcpp\.. /Fo"sequential.dir\Debug\\" C:\Users\amont\Documents\github\amontse\CMakeDpcpp\sequential\iota_sequential.cpp&lt;/P&gt;
&lt;P&gt;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX64\x64\Lib.exe /OUT:"C:\Users\amont\Documents\github\amontse\CMakeDpcpp\out\build\x64-dpcpp-Debug\Debug-CPU\Debug\sequential.lib" /NOLOGO /MACHINE:X64 sequential.dir\Debug\iota_sequential.obj&lt;/P&gt;
&lt;P&gt;C:\Program Files (x86)\Intel\oneAPI\compiler\2021.1.1\windows\..\windows\bin\dpcpp.exe /W1 /Od /D USE_DPCPP /D CPU /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /WX- /EHsc /std:c++17 /MD /c /IC:\Users\amont\Documents\github\amontse\CMakeDpcpp\.. /Fo"CMakeDpcpp.dir\Debug\\" C:\Users\amont\Documents\github\amontse\CMakeDpcpp\main\main.cpp&lt;/P&gt;
&lt;P&gt;C:\Program Files (x86)\Intel\oneAPI\compiler\2021.1.1\windows\..\windows\bin\dpcpp.exe /Fe"C:\Users\amont\Documents\github\amontse\CMakeDpcpp\out\build\x64-dpcpp-Debug\Debug-CPU\Debug\CMakeDpcpp.exe" CMakeDpcpp.dir\Debug\main.obj /WX- /MD /nologo &lt;STRONG&gt;/link&lt;/STRONG&gt; "..\Debug-CPU\Debug\sequential.lib" "..\Debug-CPU\Debug\parallel.lib"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The last command is to generate the final execution from main.obj sequential.lib (C++17 code) and parallel.lib (SYCL 1.2 code). The issue is that the executable is run but with exception throw in the SYCL codes:&lt;/P&gt;
&lt;P&gt;Running on device: Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz&lt;BR /&gt;An exception is caught while computing on device: Native API failed. Native API returns: -46 (CL_INVALID_KERNEL_NAME) -46 (CL_INVALID_KERNEL_NAME)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I REMOVE the /link switch in the last command of dpcpp, the executable generated is run and completed successfully as expected.&lt;/P&gt;
&lt;P&gt;An observation is that the executable generated with /link switch is 1/3 side of that generated without the /link switch. I guess the /link switch causes the dpcpp not putting the SPIR-V device code into the output executable.&lt;/P&gt;
&lt;P&gt;May Intel engineer have any comment?&lt;/P&gt;
&lt;P&gt;Amon&lt;/P&gt;</description>
      <pubDate>Wed, 23 Dec 2020 05:08:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Dpcpp-link-flag-on-Windows-generate-executable-with-SYCL-code/m-p/1240047#M856</guid>
      <dc:creator>Tse__Amon</dc:creator>
      <dc:date>2020-12-23T05:08:53Z</dc:date>
    </item>
    <item>
      <title>Re:Dpcpp /link flag on Windows generate executable with SYCL code not runnable on device</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Dpcpp-link-flag-on-Windows-generate-executable-with-SYCL-code/m-p/1240165#M858</link>
      <description>&lt;P&gt;Hi Amon,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;That's right. During the final linking stage, the SPIR-V generic image (or a device-specific target image in the case of AOT compilation) combines with the host object files to generate a "fat" binary.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;You may find more details about the compilation flow in the link below:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/intel/llvm/blob/sycl/sycl/doc/CompilerAndRuntimeDesign.md" target="_blank"&gt;https://github.com/intel/llvm/blob/sycl/sycl/doc/CompilerAndRuntimeDesign.md&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;The error "CL_INVALID_KERNEL_NAME" can get triggered due to multiple reasons. It would be great if you could attach a minimal reproducible code sample that causes this error.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Rahul&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 23 Dec 2020 11:17:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Dpcpp-link-flag-on-Windows-generate-executable-with-SYCL-code/m-p/1240165#M858</guid>
      <dc:creator>RahulV_intel</dc:creator>
      <dc:date>2020-12-23T11:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: Re:Dpcpp /link flag on Windows generate executable with SYCL code not runnable on device</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Dpcpp-link-flag-on-Windows-generate-executable-with-SYCL-code/m-p/1240479#M860</link>
      <description>&lt;P&gt;Hello Rahul,&lt;/P&gt;
&lt;P&gt;Finally I worked out the root cause of the issue: If I moved the lib containing the device code (i.e. parallel.lib in my example) BEFORE the /link switch then dpcpp.exe generates the output that the device code are execute correctly.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Amon&lt;/P&gt;</description>
      <pubDate>Thu, 24 Dec 2020 07:02:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Dpcpp-link-flag-on-Windows-generate-executable-with-SYCL-code/m-p/1240479#M860</guid>
      <dc:creator>Tse__Amon</dc:creator>
      <dc:date>2020-12-24T07:02:31Z</dc:date>
    </item>
    <item>
      <title>Re:Dpcpp /link flag on Windows generate executable with SYCL code not runnable on device</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Dpcpp-link-flag-on-Windows-generate-executable-with-SYCL-code/m-p/1241973#M878</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Good to know that it worked. Could you also let me know if I can close this thread from my end? &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Rahul&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 30 Dec 2020 10:44:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Dpcpp-link-flag-on-Windows-generate-executable-with-SYCL-code/m-p/1241973#M878</guid>
      <dc:creator>RahulV_intel</dc:creator>
      <dc:date>2020-12-30T10:44:26Z</dc:date>
    </item>
    <item>
      <title>Re:Dpcpp /link flag on Windows generate executable with SYCL code not runnable on device</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Dpcpp-link-flag-on-Windows-generate-executable-with-SYCL-code/m-p/1243319#M888</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I have not heard back from you, so I will go ahead and close this thread from my end. Further responses on this thread will be considered community only.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Rahul&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 05 Jan 2021 06:45:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Dpcpp-link-flag-on-Windows-generate-executable-with-SYCL-code/m-p/1243319#M888</guid>
      <dc:creator>RahulV_intel</dc:creator>
      <dc:date>2021-01-05T06:45:59Z</dc:date>
    </item>
  </channel>
</rss>

