<?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 Hi, in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Some-bugs-in-cilkplus-gcc/m-p/963722#M22408</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;okay, problems 3 and 4 seem to be fixed in GCC trunk, nevermind. Actually a workaround for 3 in cilkplus-gcc is to add an explicit this:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;cilk_spawn this-&amp;gt;foo()&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;cilkplus-gcc might be badly documented, but GCC trunk seems to only partially implement cilkplus as of this date, if I'm not mistaken. For example, cilk_for seems to be implemented, so I can't try to reproduce problems 1 and 2. Does anyone have any knowledge of the status of GCC trunk w.r.t cilk? In particular, is the performance comparable to other cilk implementations? And is there a trick to work around the absence of the cilk_for keyword to use parallel for loops?&lt;/P&gt;

&lt;P&gt;Best, Niklas&lt;/P&gt;</description>
    <pubDate>Tue, 21 Jan 2014 17:26:02 GMT</pubDate>
    <dc:creator>Niklas_B_</dc:creator>
    <dc:date>2014-01-21T17:26:02Z</dc:date>
    <item>
      <title>Some bugs in cilkplus-gcc</title>
      <link>https://community.intel.com/t5/Software-Archive/Some-bugs-in-cilkplus-gcc/m-p/963720#M22406</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I'm using the cilkplus GCC extensions and ran into a few smallish bugs. All of them are reproducible with the most recent cilkplus-gcc 'gcc version 4.9.0 20130520 (experimental) (GCC)'&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;$ g++ -v&lt;BR /&gt;
		Using built-in specs.&lt;BR /&gt;
		COLLECT_GCC=g++&lt;BR /&gt;
		COLLECT_LTO_WRAPPER=/usr0/home/nbaumstark/cilkplus-install/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper&lt;BR /&gt;
		Target: x86_64-unknown-linux-gnu&lt;BR /&gt;
		Configured with: /home/nbaumstark/cilkplus-gcc/configure --prefix=/home/nbaumstark/cilkplus-install --enable-languages=c,c++ --disable-multilib&lt;BR /&gt;
		Thread model: posix&lt;BR /&gt;
		gcc version 4.9.0 20130520 (experimental) (GCC)&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;1. cilk_for pollutes local namespace in template functions. I think I saw a report of this one somewhere, but can't find it anymore and it's not been fixed:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;template &amp;lt;typename T&amp;gt;&lt;BR /&gt;
		void test() {&lt;BR /&gt;
		&amp;nbsp; int test = 0;&lt;BR /&gt;
		&amp;nbsp; cilk_for (int i = 0; i &amp;lt; 10; ++i) test += i;&lt;BR /&gt;
		&amp;nbsp; cilk_for (int i = 0; i &amp;lt; 10; ++i) test += i;&lt;BR /&gt;
		}&lt;/P&gt;

	&lt;P&gt;int main() {&lt;BR /&gt;
		&amp;nbsp; test&amp;lt;int&amp;gt;();&lt;BR /&gt;
		}&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Output:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;$ g++ -lcilkrts -fcilkplus -mcx16 -O2 -Wall loop-var-pollution.cpp&lt;BR /&gt;
		loop-var-pollution.cpp: In instantiation of ‘void test() [with T = int]’:&lt;BR /&gt;
		loop-var-pollution.cpp:9:13:&amp;nbsp;&amp;nbsp; required from here&lt;BR /&gt;
		loop-var-pollution.cpp:5:17: error: redeclaration of ‘int i’&lt;BR /&gt;
		&amp;nbsp;&amp;nbsp; cilk_for (int i = 0; i &amp;lt; 10; ++i) test += i;&lt;BR /&gt;
		&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ^&lt;BR /&gt;
		loop-var-pollution.cpp:4:17: error: ‘int i’ previously declared here&lt;BR /&gt;
		&amp;nbsp;&amp;nbsp; cilk_for (int i = 0; i &amp;lt; 10; ++i) test += i;&lt;BR /&gt;
		&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ^&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;2. unused variable warnings for variables that are used in a cilk_for header:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;// compile with -Wall&lt;BR /&gt;
		void test() {&lt;BR /&gt;
		&amp;nbsp; int len = 10;&lt;BR /&gt;
		&amp;nbsp; int test = 0;&lt;BR /&gt;
		&amp;nbsp; cilk_for (int i = 0; i &amp;lt; len; ++i) test += i;&lt;BR /&gt;
		}&lt;/P&gt;

	&lt;P&gt;int main() {&lt;BR /&gt;
		&amp;nbsp; test();&lt;BR /&gt;
		}&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Output:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;$ g++ -lcilkrts -fcilkplus -mcx16 -O2 -Wall loop-var-unused.cpp&lt;BR /&gt;
		loop-var-unused.cpp: In function ‘void test()’:&lt;BR /&gt;
		loop-var-unused.cpp:3:7: warning: variable ‘len’ set but not used [-Wunused-but-set-variable]&lt;BR /&gt;
		&amp;nbsp;&amp;nbsp; int len = 10;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;3. Type errors with -std=c++11 and cilk_spawn with a method of the current instance:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;// compile with -Wall -std=c++11&lt;BR /&gt;
		template &amp;lt;typename T&amp;gt;&lt;BR /&gt;
		struct X {&lt;BR /&gt;
		&amp;nbsp; int test;&lt;BR /&gt;
		&amp;nbsp; X() : test(0) {}&lt;BR /&gt;
		&amp;nbsp; void foo() { test++; }&lt;BR /&gt;
		&amp;nbsp; void bar() {&lt;BR /&gt;
		&amp;nbsp;&amp;nbsp;&amp;nbsp; cilk_spawn foo();&lt;BR /&gt;
		&amp;nbsp;&amp;nbsp;&amp;nbsp; foo();&lt;BR /&gt;
		&amp;nbsp;&amp;nbsp;&amp;nbsp; cilk_sync;&lt;BR /&gt;
		&amp;nbsp; }&lt;BR /&gt;
		};&lt;/P&gt;

	&lt;P&gt;int main() {&lt;BR /&gt;
		&amp;nbsp; X&amp;lt;int&amp;gt;().bar();&lt;BR /&gt;
		}&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Output:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;$ g++ -lcilkrts -fcilkplus -mcx16 -O2 -Wall -std=c++11 this-method-spawn.cpp&lt;BR /&gt;
		this-method-spawn.cpp: In instantiation of ‘void X&amp;lt;T&amp;gt;::bar() [with T = int]’:&lt;BR /&gt;
		this-method-spawn.cpp:15:16:&amp;nbsp;&amp;nbsp; required from here&lt;BR /&gt;
		this-method-spawn.cpp:8:20: error: cannot convert ‘X&amp;lt;T&amp;gt;::foo&amp;lt;int&amp;gt;’ from type ‘void (X&amp;lt;int&amp;gt;::)()’ to type ‘void (X&amp;lt;int&amp;gt;::*)()’&lt;BR /&gt;
		&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cilk_spawn foo();&lt;BR /&gt;
		&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ^&lt;BR /&gt;
		this-method-spawn.cpp:8:20: error: must use ‘.*’ or ‘-&amp;gt;*’ to call pointer-to-member function in ‘_cilk_lmda_fn_var_000000 (...)’, e.g. ‘(... -&amp;gt;* _cilk_lmda_fn_var_000000) (...)’&lt;BR /&gt;
		cc1plus: warning: unused variable ‘sf_02’ [-Wunused-variable]&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;4. Warning about unused variable "sf_*". See example above. With -std=c++03, the error doesn't occur, but the warning does.&lt;/P&gt;

&lt;P&gt;The source code is attached as a tarball.&lt;/P&gt;

&lt;P&gt;Best regards,&lt;/P&gt;

&lt;P&gt;Niklas Baumstark&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2014 21:20:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Some-bugs-in-cilkplus-gcc/m-p/963720#M22406</guid>
      <dc:creator>Niklas_B_</dc:creator>
      <dc:date>2014-01-20T21:20:34Z</dc:date>
    </item>
    <item>
      <title>Maybe you should try building</title>
      <link>https://community.intel.com/t5/Software-Archive/Some-bugs-in-cilkplus-gcc/m-p/963721#M22407</link>
      <description>&lt;P&gt;Maybe you should try building the current gcc source e.g.&amp;nbsp;svn co svn://gcc.gnu.org/svn/gcc/trunk&lt;/P&gt;

&lt;P&gt;and file any problem reports on gcc bugzilla; you could mention the pr numbers here.&lt;/P&gt;

&lt;P&gt;I'll have to confess I have little personal interest in the many lto cases which fail their standard testsuite.&lt;/P&gt;

&lt;P&gt;I'll try your cases later, if I can figure out easily how to run. &amp;nbsp;gcc cilkplus doesn't seem well enough documented to me.&lt;/P&gt;

&lt;P&gt;I must deal with the snow now.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2014 16:31:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Some-bugs-in-cilkplus-gcc/m-p/963721#M22407</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2014-01-21T16:31:00Z</dc:date>
    </item>
    <item>
      <title>Hi,</title>
      <link>https://community.intel.com/t5/Software-Archive/Some-bugs-in-cilkplus-gcc/m-p/963722#M22408</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;okay, problems 3 and 4 seem to be fixed in GCC trunk, nevermind. Actually a workaround for 3 in cilkplus-gcc is to add an explicit this:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;cilk_spawn this-&amp;gt;foo()&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;cilkplus-gcc might be badly documented, but GCC trunk seems to only partially implement cilkplus as of this date, if I'm not mistaken. For example, cilk_for seems to be implemented, so I can't try to reproduce problems 1 and 2. Does anyone have any knowledge of the status of GCC trunk w.r.t cilk? In particular, is the performance comparable to other cilk implementations? And is there a trick to work around the absence of the cilk_for keyword to use parallel for loops?&lt;/P&gt;

&lt;P&gt;Best, Niklas&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2014 17:26:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Some-bugs-in-cilkplus-gcc/m-p/963722#M22408</guid>
      <dc:creator>Niklas_B_</dc:creator>
      <dc:date>2014-01-21T17:26:02Z</dc:date>
    </item>
    <item>
      <title>Hi Niklas,</title>
      <link>https://community.intel.com/t5/Software-Archive/Some-bugs-in-cilkplus-gcc/m-p/963723#M22409</link>
      <description>&lt;P&gt;Hi Niklas,&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _Cilk_for is not merged into the trunk yet. It is currently under review by the GCC reviewers. It is a different implementation and I am hoping that you problems outlined in 1 and 2 should disappear when it gets into trunk.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	Balaji V. Iyer.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2014 17:33:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Some-bugs-in-cilkplus-gcc/m-p/963723#M22409</guid>
      <dc:creator>Balaji_I_Intel</dc:creator>
      <dc:date>2014-01-21T17:33:16Z</dc:date>
    </item>
    <item>
      <title>Okay, that sounds reasonable.</title>
      <link>https://community.intel.com/t5/Software-Archive/Some-bugs-in-cilkplus-gcc/m-p/963724#M22410</link>
      <description>&lt;P&gt;Okay, that sounds reasonable. Since there are workarounds for all issues, I'm going to stick with cilkplus-gcc until _Cilk_for is merged into the GCC trunk.&lt;/P&gt;

&lt;P&gt;Thanks guys!&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2014 17:35:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Some-bugs-in-cilkplus-gcc/m-p/963724#M22410</guid>
      <dc:creator>Niklas_B_</dc:creator>
      <dc:date>2014-01-21T17:35:42Z</dc:date>
    </item>
  </channel>
</rss>

