<?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>sujet OpenMP fails on iterator and range based loops in Windows debug builds dans Intel® oneAPI DPC++/C++ Compiler</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/OpenMP-fails-on-iterator-and-range-based-loops-in-Windows-debug/m-p/1753182#M4768</link>
    <description>&lt;P&gt;Using recent (2026, 2025, &amp;amp; 2024) oneAPI C++ on Windows I found that OpenMP parallel for on iterator-based and range-based for loops isn't working in debug builds, but index-based loops work. For example, this demo:&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;#include &amp;lt;vector&amp;gt;
#include &amp;lt;iostream&amp;gt;

int
main()
{
	std::vector&amp;lt; int &amp;gt; v = {0,1,2,3,4,5,6,7,8,9};

	// Works
	// #pragma omp parallel for
	// for ( std::vector&amp;lt; int &amp;gt;::size_type i = 0; i &amp;lt; v.size(); ++i ) {
	// 	++v[i];
	// }

	// Fails in in debug build at runtime
	#pragma omp parallel for
	for ( std::vector&amp;lt; int &amp;gt;::iterator i = v.begin(); i &amp;lt; v.end(); ++i ) {
		++(*i);
	}

	for ( int i : v ) std::cout &amp;lt;&amp;lt; i &amp;lt;&amp;lt; std::endl;
}&lt;/LI-CODE&gt;&lt;P&gt;compiled with:&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; icx /nologo /Qopenmp /Qopenmp-simd- /EHsc /Wall /Od /MDd&lt;BR /&gt;builds but terminates at runtime, sometimes popping up a dialog with "ITERATOR LIST CORRUPTED". With /MD or /MT it runs fine.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It doesn't appear to be a VC++ standard library limitation because I see the same problem with my own classes, yet I believe this usage worked some years ago.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Maybe this is a known/documented limitation but I couldn't find any information on it.&lt;/P&gt;</description>
    <pubDate>Mon, 06 Jul 2026 11:59:23 GMT</pubDate>
    <dc:creator>Mentzer__Stuart</dc:creator>
    <dc:date>2026-07-06T11:59:23Z</dc:date>
    <item>
      <title>OpenMP fails on iterator and range based loops in Windows debug builds</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/OpenMP-fails-on-iterator-and-range-based-loops-in-Windows-debug/m-p/1753182#M4768</link>
      <description>&lt;P&gt;Using recent (2026, 2025, &amp;amp; 2024) oneAPI C++ on Windows I found that OpenMP parallel for on iterator-based and range-based for loops isn't working in debug builds, but index-based loops work. For example, this demo:&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;#include &amp;lt;vector&amp;gt;
#include &amp;lt;iostream&amp;gt;

int
main()
{
	std::vector&amp;lt; int &amp;gt; v = {0,1,2,3,4,5,6,7,8,9};

	// Works
	// #pragma omp parallel for
	// for ( std::vector&amp;lt; int &amp;gt;::size_type i = 0; i &amp;lt; v.size(); ++i ) {
	// 	++v[i];
	// }

	// Fails in in debug build at runtime
	#pragma omp parallel for
	for ( std::vector&amp;lt; int &amp;gt;::iterator i = v.begin(); i &amp;lt; v.end(); ++i ) {
		++(*i);
	}

	for ( int i : v ) std::cout &amp;lt;&amp;lt; i &amp;lt;&amp;lt; std::endl;
}&lt;/LI-CODE&gt;&lt;P&gt;compiled with:&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; icx /nologo /Qopenmp /Qopenmp-simd- /EHsc /Wall /Od /MDd&lt;BR /&gt;builds but terminates at runtime, sometimes popping up a dialog with "ITERATOR LIST CORRUPTED". With /MD or /MT it runs fine.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It doesn't appear to be a VC++ standard library limitation because I see the same problem with my own classes, yet I believe this usage worked some years ago.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Maybe this is a known/documented limitation but I couldn't find any information on it.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jul 2026 11:59:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/OpenMP-fails-on-iterator-and-range-based-loops-in-Windows-debug/m-p/1753182#M4768</guid>
      <dc:creator>Mentzer__Stuart</dc:creator>
      <dc:date>2026-07-06T11:59:23Z</dc:date>
    </item>
  </channel>
</rss>

