Calling a cilk fucntion by a c function

Calling a cilk fucntion by a c function

I am confused about stub functions for calling a cilk function by a regular c function. It seems there is an inconsistency on page 13 of the Cilk-5.4.6 manual. That and the previous page discuss this issue. I made up a fibonaccii program that I am trying to get to compile, but it does not.

I have attached the screenshot of the output and a copy of my source file. Please tell me what I am doing wrong.

If there are any other errors please point them out.I thought that this code was correct The example in the cilk-5.4.6 manual on page 13 is not clear. y = EXPORT(g) (context, 3.14); and y = EXPORT(g) (&x); have different number of args.

In miine it says

argument mismatch: 1 args passed, 2 expected

I am not seeing it.

Any help appreciated. Thanks in advance.

Newport_j

5 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项

I'm not sure if this is your problem, but you have declared EXPORT(fib) as returning a float in one place, but as an int in the other?

You are right, I caught that. In fact Ihave got my example program which I attached to previous post to compile and give me the correct answer. However, look on page 13, of the Cilk 5.4.6 manual and look at Fig. 2.4 (a) and (b). The (b) figure simply makes little sense. to me. The call line is

y = EXPORT(g) (&x). What?

I understand the first part where the Fig. 2.4 (a) and Fig. (b) hav many similarities, but the second part (context, 3.14) vs. (&x) isnot clear.Please explain the differences between, Fig. 2.4 (a) and Fig. 2.4 (b). The call lines do not seem to correlate.

Thanks in advance.

Newport_j

Hm, that seems like a typo to me... Does the code in 2.4(b) actually compile? I would think that the code in (a) is the correct version.

I do not know it looks like incomplete code so I can only guess. I thought it was a typo, but I just do not know.

Do you have the correct version?

Thanks in advance.

Newport_j

发表评论

登录添加评论。还不是成员?立即加入