Software Archive
Read-only legacy content
17061 Discussions

_Cilk_spawn is undefined

Nikos_L_
Beginner
947 Views

Hello, I have installed Visual Studio 2013 and Intel Parallel Studio and when i write a cilk plus program (fibonacci to be accurate) it compiles it just fine, but it doesn't recognize the commands cilk_spawn and cilk_sync (if i move the cusror to these commands it says "_Cilk_spawn is undefined","_Cilk_sync is undefined" ). Also when i run the fibonacci program the serial version executes in almost the same amount of time as the parallel version (weird ah?). 

I researched on the internet for this problem but no-one seems to give a solution. 

Any help would be appreciated

0 Kudos
4 Replies
Nikos_L_
Beginner
947 Views

I forgot to say that I have changed the compiler to Intel c++

0 Kudos
Hansang_B_Intel
Employee
947 Views

Hi,

I don't see any problems with Visual Studio 2013 + Intel Parallel Studio XE 2016.

Could you please check if you are setting the Intel compiler correctly (e.g. solution property -> Intel Compiler -> Use Intel C++)? Also, don't forget to include "cilk/cilk.h" to use "cilk_spawn/cilk_sync/cilk_for" keywords. When properly configured, the editor should highlight the Cilk keywords.

As for the performance of Fibonacci, you can find some inforamtion in other topics:

https://software.intel.com/en-us/forums/intel-cilk-plus/topic/559858

https://software.intel.com/en-us/forums/intel-cilk-plus/topic/559859

 

0 Kudos
Nikos_L_
Beginner
947 Views

Yes the compiler is properly configured and I have included the cilk libraries. Here is a screenshot http://prntscr.com/90v6j3 .

I noticed that if i declare the fib function like this "cilk int fib (int n){...}" it highlights the Cilk keywords but still gives errors http://prntscr.com/90v9nl  .

Thanks for the help

0 Kudos
Hansang_B_Intel
Employee
947 Views

Hi,

Your first screenshot tells that the code was compiled correctly, and only the error highlighting tool is complaining about the Cilk things. I think the analysis tool (for highlighting) works independently of Intel compilers and doesn't understand the Cilk Plus extension to C/C++. The second example is not a valid program, so the compiler failed to compile the code.

0 Kudos
Reply