Click here to Skip to main content
15,890,947 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a process function like below, I want to convert it to parallel_for processing, anyone can do it.

C++
static void calc(const double b[120], const double x[163970], double y[163970])
{
	int k, j;
	memset(&y[0], 0, 163970U * sizeof(double));
	for (k = 0; k < 120; k++) {
		for (j = k; j + 1 < 163971; j++) {
			y[j] += b[k] * x[j - k];
		}
	}
}
Posted
Comments

1 solution

Please see: http://msdn.microsoft.com/en-us/library/system.threading.tasks.parallel%28v=vs.110%29.aspx[^].

Everything else is just the routine software development work. If you face some problems you won't be able to solve, please show what have you tried so far, explain what's the problem and ask your further questions.

—SA
 
Share this answer
 
v3
Comments
Sergey Alexandrovich Kryukov 25-Jun-14 10:00am    
Hongjun Ge commented:
"From this web page i can't find out solution".

I would ask: what have you tried so far?

—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900