<?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: Swizzle code cannot be compiled on Windows in Intel® oneAPI DPC++/C++ Compiler</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Swizzle-code-cannot-be-compiled-on-Windows/m-p/1414361#M2504</link>
    <description>&lt;P&gt;Hi Alex,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your patience.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;gt;I cannot build a provided example in debug mode (but release mode works nice).&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Regarding the issue with code compilation failing in debug mode, here are a few things that we want to let you know&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;"Compilation may fail on Windows in debug mode if a kernel uses std::array. This happens because debug version of std::array in Microsoft STL C++ headers calls functions that are illegal for the device code. As a workaround the following can be done:&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;gt; Dump compiler pipeline execution strings by passing -### option to the compiler. The compiler will print the internal execution strings of compilation tools. The actual compilation will not happen.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;gt; Modify the (usually) first execution string (it should have -fsycl-is-device option) by adding -D_CONTAINER_DEBUG_LEVEL=0 -D_ITERATOR_DEBUG_LEVEL=0 options to the end of the string. Execute all string one by one."&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Reference links:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/intel/llvm/blob/sycl/sycl/ReleaseNotes.md" target="_blank" rel="noopener"&gt;https://github.com/intel/llvm/blob/sycl/sycl/ReleaseNotes.md&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.intel.com/content/www/us/en/developer/articles/release-notes/intel-oneapi-dpc-c-compiler-release-notes.html" target="_blank"&gt;https://www.intel.com/content/www/us/en/developer/articles/release-notes/intel-oneapi-dpc-c-compiler-release-notes.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So we suggest you follow the workaround that is mentioned in the release notes&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Eg:&lt;/P&gt;
&lt;P&gt;icx /O2 -fsycl&amp;nbsp;-D_CONTAINER_DEBUG_LEVEL=0 -D_ITERATOR_DEBUG_LEVEL=0&amp;nbsp;/MD fig_11_6_load_store.cpp&lt;/P&gt;
&lt;P&gt;Intel(R) oneAPI DPC++/C++ Compiler for applications running on Intel(R) 64, Version 2022.1.0 Build 20220316&lt;/P&gt;
&lt;P&gt;Copyright (C) 1985-2022 Intel Corporation. All rights reserved.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ch11_vectors&amp;gt;fig_11_6_load_store.exe&lt;/P&gt;
&lt;P&gt;Passed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please give it a try and do let us know if have any issues.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Vidya.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 13 Sep 2022 05:20:49 GMT</pubDate>
    <dc:creator>VidyalathaB_Intel</dc:creator>
    <dc:date>2022-09-13T05:20:49Z</dc:date>
    <item>
      <title>Swizzle code cannot be compiled on Windows</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Swizzle-code-cannot-be-compiled-on-Windows/m-p/1365152#M1922</link>
      <description>&lt;DIV id="bodyDisplay" class="lia-message-body lia-component-message-view-widget-body lia-component-body-signature-highlight-escalation lia-component-message-view-widget-body-signature-highlight-escalation section_selectors question_selectors first_st_section" data-section_field_id="9a72-3991-29ec"&gt;
&lt;DIV class="lia-message-body-content sub_section_element_selectors"&gt;
&lt;P class="sub_section_element_selectors"&gt;&lt;SPAN class="sub_section_element_selectors"&gt;I'm using Intel oneAPI BaseKit 2022.1.2 (w_BaseKit_p_2022.1.2.154_offline.exe), VisualStudio 2022 17.0.6 LTS, CMake 3.22.2, Ninja 1.10.2, VSCode 1.64.2, Windows 10 Pro 21H1 x64 English.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;&lt;SPAN class="sub_section_element_selectors"&gt;OneAPI &amp;amp; VisualStudio was fully reinstalled today.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;&lt;SPAN class="sub_section_element_selectors"&gt;I'm using a basic example &lt;/SPAN&gt;for &lt;A class="sub_section_element_selectors" href="https://github.com/oneapi-src/oneAPI-samples/tree/2022.1.0/Publications/DPC++/Ch11_vectors" target="_self" rel="nofollow noreferrer"&gt;vectors swizzling&lt;/A&gt;.&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;&lt;SPAN class="sub_section_element_selectors"&gt;Build log &lt;/SPAN&gt;&lt;SPAN class="sub_section_element_selectors"&gt;from clear CMD with manually called setvars.bat file &lt;/SPAN&gt;&lt;SPAN class="sub_section_element_selectors"&gt;was attached.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;&lt;SPAN class="sub_section_element_selectors"&gt;I cannot build a provided example in debug mode (but release mode works nice).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;&lt;SPAN class="sub_section_element_selectors"&gt;The project for reproducing an error was attached too.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;&lt;SPAN class="sub_section_element_selectors"&gt;The error can be reproduced by CMake (see the attached project) &amp;amp; VisualStudio UI (tested in another project). Code building was made with a DPC++ compiler.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;&lt;SPAN class="sub_section_element_selectors"&gt;How can I debug my project with an enabled swizzle macro?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;&lt;SPAN class="sub_section_element_selectors"&gt;With regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="sub_section_element_selectors"&gt;Alex&lt;/SPAN&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 02 Mar 2022 14:01:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Swizzle-code-cannot-be-compiled-on-Windows/m-p/1365152#M1922</guid>
      <dc:creator>AJIOB</dc:creator>
      <dc:date>2022-03-02T14:01:50Z</dc:date>
    </item>
    <item>
      <title>Re: Swizzle code cannot be compiled on Windows</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Swizzle-code-cannot-be-compiled-on-Windows/m-p/1365490#M1923</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for reaching out to us.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We are unable to reproduce the exact errors you are getting but we are also getting some other issues while trying to run the sample code from vectors swizzling.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;&amp;gt;&amp;gt;I cannot build a provided example in debug mode&amp;nbsp;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;But here are some changes we made with which we are able to make it compile and generate the executable successfully in both release and debug modes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please try commenting out the last two lines under the if(WIN32) code block in CMakeLists.txt as below?&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;if(WIN32)
#set(CMAKE_C_COMPILER clang-cl)
#set(CMAKE_CXX_COMPILER dpcpp)
set(CMAKE_C_COMPILER icx)
set(CMAKE_CXX_COMPILER dpcpp)
#set(CMAKE_CXX_CREATE_STATIC_LIBRARY "lib &amp;lt;OBJECTS&amp;gt; /out:&amp;lt;TARGET&amp;gt;")
#set(CMAKE_CXX_LINK_EXECUTABLE "lld-link &amp;lt;OBJECTS&amp;gt; -o &amp;lt;TARGET&amp;gt; &amp;lt;LINK_LIBRARIES&amp;gt;")&lt;/LI-CODE&gt;
&lt;P&gt;After applying these changes please follow the below steps&lt;/P&gt;
&lt;P&gt;&amp;gt; mkdir build&lt;/P&gt;
&lt;P&gt;&amp;gt; cd build&lt;/P&gt;
&lt;P&gt;&amp;gt; cmake -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icx -DCMAKE_BUILD_TYPE=Debug -GNinja ..&lt;/P&gt;
&lt;P&gt;&amp;gt; ninja install&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can test the generated executables which are present under ../swizzle_bug/Ch11_vectors/install/Debug/*.exe&lt;/P&gt;
&lt;P&gt;Please find the below screenshot which contains the steps that we followed to run the code and do let us know if you face any issues.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="VidyalathaB_Intel_0-1646308578199.png" style="width: 400px;"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/27225iB2B5145292A8DBE5/image-size/medium?v=v2&amp;amp;px=400&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="VidyalathaB_Intel_0-1646308578199.png" alt="VidyalathaB_Intel_0-1646308578199.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Vidya.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 11:58:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Swizzle-code-cannot-be-compiled-on-Windows/m-p/1365490#M1923</guid>
      <dc:creator>VidyalathaB_Intel</dc:creator>
      <dc:date>2022-03-03T11:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: Swizzle code cannot be compiled on Windows</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Swizzle-code-cannot-be-compiled-on-Windows/m-p/1365833#M1930</link>
      <description>&lt;P&gt;Hello Vidya&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I made build steps as you said. My error repeats. Log &amp;amp; changed CMakeLists.txt were attached.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The main difference of our logs is used compilers: I'm using &lt;SPAN&gt;IntelLLVM (aka DPC++?) &amp;amp; you are using IntelClang (aka Intel Compiler Classic?).&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I installed only DPC++ compiler, no any other (for saving space).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please, force use DPC++ compiler, that was provided with oneAPI BaseKit 2022.1.2 with required VisualStudio version.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I reproduced that bug with Windows SDK 10.0.20348, 10.0.19041, 10.0.16299 (all installed versions).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With regards,&lt;BR /&gt;Alex&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2022 12:29:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Swizzle-code-cannot-be-compiled-on-Windows/m-p/1365833#M1930</guid>
      <dc:creator>AJIOB</dc:creator>
      <dc:date>2022-03-04T12:29:07Z</dc:date>
    </item>
    <item>
      <title>Re:Swizzle code cannot be compiled on Windows</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Swizzle-code-cannot-be-compiled-on-Windows/m-p/1366771#M1945</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;&amp;gt;&amp;gt;The main difference of our logs is used compilers: I'm using IntelLLVM (aka DPC++?) &amp;amp; you are using IntelClang (aka Intel Compiler Classic?).&lt;/I&gt;&lt;/P&gt;&lt;P&gt;Thanks for pointing it out.&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&lt;I&gt;with required VisualStudio version.&lt;/I&gt;&lt;/P&gt;&lt;P&gt;We tried the sample in Intel oneAPI command prompt for Intel 64 for VS 2022 and the issue is reproducible from our end as well.&lt;/P&gt;&lt;P&gt;We have forwarded this case to the concerned development team and will keep updating this thread.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vidya.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 08 Mar 2022 11:59:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Swizzle-code-cannot-be-compiled-on-Windows/m-p/1366771#M1945</guid>
      <dc:creator>VidyalathaB_Intel</dc:creator>
      <dc:date>2022-03-08T11:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: Swizzle code cannot be compiled on Windows</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Swizzle-code-cannot-be-compiled-on-Windows/m-p/1414361#M2504</link>
      <description>&lt;P&gt;Hi Alex,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your patience.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;gt;I cannot build a provided example in debug mode (but release mode works nice).&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Regarding the issue with code compilation failing in debug mode, here are a few things that we want to let you know&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;"Compilation may fail on Windows in debug mode if a kernel uses std::array. This happens because debug version of std::array in Microsoft STL C++ headers calls functions that are illegal for the device code. As a workaround the following can be done:&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;gt; Dump compiler pipeline execution strings by passing -### option to the compiler. The compiler will print the internal execution strings of compilation tools. The actual compilation will not happen.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;gt; Modify the (usually) first execution string (it should have -fsycl-is-device option) by adding -D_CONTAINER_DEBUG_LEVEL=0 -D_ITERATOR_DEBUG_LEVEL=0 options to the end of the string. Execute all string one by one."&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Reference links:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/intel/llvm/blob/sycl/sycl/ReleaseNotes.md" target="_blank" rel="noopener"&gt;https://github.com/intel/llvm/blob/sycl/sycl/ReleaseNotes.md&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.intel.com/content/www/us/en/developer/articles/release-notes/intel-oneapi-dpc-c-compiler-release-notes.html" target="_blank"&gt;https://www.intel.com/content/www/us/en/developer/articles/release-notes/intel-oneapi-dpc-c-compiler-release-notes.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So we suggest you follow the workaround that is mentioned in the release notes&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Eg:&lt;/P&gt;
&lt;P&gt;icx /O2 -fsycl&amp;nbsp;-D_CONTAINER_DEBUG_LEVEL=0 -D_ITERATOR_DEBUG_LEVEL=0&amp;nbsp;/MD fig_11_6_load_store.cpp&lt;/P&gt;
&lt;P&gt;Intel(R) oneAPI DPC++/C++ Compiler for applications running on Intel(R) 64, Version 2022.1.0 Build 20220316&lt;/P&gt;
&lt;P&gt;Copyright (C) 1985-2022 Intel Corporation. All rights reserved.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ch11_vectors&amp;gt;fig_11_6_load_store.exe&lt;/P&gt;
&lt;P&gt;Passed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please give it a try and do let us know if have any issues.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Vidya.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 05:20:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Swizzle-code-cannot-be-compiled-on-Windows/m-p/1414361#M2504</guid>
      <dc:creator>VidyalathaB_Intel</dc:creator>
      <dc:date>2022-09-13T05:20:49Z</dc:date>
    </item>
    <item>
      <title>Re:Swizzle code cannot be compiled on Windows</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Swizzle-code-cannot-be-compiled-on-Windows/m-p/1415850#M2535</link>
      <description>&lt;P&gt;Hi Alex,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;As we haven't heard back from you we assume that your issue is resolved and closing this thread. Please post a new question if you need any additional assistance from Intel as this thread will longer be  monitored.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vidya.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Sep 2022 05:57:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Swizzle-code-cannot-be-compiled-on-Windows/m-p/1415850#M2535</guid>
      <dc:creator>VidyalathaB_Intel</dc:creator>
      <dc:date>2022-09-20T05:57:07Z</dc:date>
    </item>
  </channel>
</rss>

