- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Notice that ICC 13.0.1 failed to compile a cilk spawn with a lambda capturing an array by value. Here is the small test case.
void foo(const float*);
void bar() {
float A[2] = {0, 1};
_Cilk_spawn [=](){ foo(A); }();
}
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
that's indeed a compiler bug. It seems cilk_spawn surprisingly does not work with lambdas. I've filed a defect ticket (edit: DPD200239458) and let you know if I learn more.
Best regards,
Georg Zitzlsberger
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
after some analysis it turns out that passing an array by value caused this internal error. Passing by reference works.
Let me provide you a workaround that should have less impact for you (pass pointer to array by value instead):
[cpp]
void foo(const float*);
void bar() {
float AA[2] = {0, 1};
float *A = AA;
_Cilk_spawn [=](){ foo(A); }();
}
[/cpp]
Edit: Another one would be using named lambdas:
[cpp]
void foo(const float*);
void bar() {
float A[2] = {0, 1};
auto templ = [=](){ foo(A); };
_Cilk_spawn templ();
}
[/cpp]
We're still working on fixing this issue. I'll keep you in the loop.
Best regards,
Georg Zitzlsberger
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
the problem will be fixed with Intel(R) Composer XE 2013 Update 3.
Best regards,
Georg Zitzlsberger

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page