Quantcast
Channel: Parallel Computing in C++ and Native Code forum
Viewing all articles
Browse latest Browse all 856

C++ AMP compilation error - IL is not available when compiling the call graph for the concurrency::parallel_for_each

$
0
0

This problem occurs when a lambda or a functor, which calls an external function, is used as the second parameter of "Concurrency::parallel_for_each". That's quite confussing, since the compiler won't have any problem dealing with ordinary external inline functions. Here's a test code that shows the problem.

#include <amp.h>

using namespace Concurrency;


class functor1
{
public:
	int operator()(index<1>) const restrict(cpu, amp);
};


class functor2//functor2 is implemented in another file
{
public:
	int operator()(index<1>) const restrict(cpu, amp);
};


int functor1::operator()(index<1>) const restrict(cpu, amp)
{
	return 0;
}


int main()
{
	functor1 func1;
	functor2 func2;
	parallel_for_each(extent<1>(), func1);//no error
	parallel_for_each(extent<1>(), func2);//error
	return 0;
}


Viewing all articles
Browse latest Browse all 856

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>