- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi ,professors,
When i use parallel_for on my defining struct ,It can not work.
The part of my code is :
When i use parallel_for on my defining struct ,It can not work.
The part of my code is :
struct Result //This is my defining struct.
{
int Path;
double Amp;
double Phase;
};
void apfft(Result* T); //This is my defining function.
Result FFTResult
for(int i=0;i
FFTResult.Path=i;
FFTResult.Amp=0;
FFTResult.Phase=0;
apfft(&FFTResult);
}
The following is my parallel code , but it does not work.
class ParaFFT
{
void operator()(const blocked_range
{
for(int i=range.begin();i!=range.end();++i)
{
FFTResult.Path=i;
FFTResult.Amp=0;
FFTResult.Phase=0;
apfft(&FFTResult);
}
}
};
parallel_for(blocked_range
I try it many days,but i found i can not translate my own defining struct .
Please help me or instruct me . Many thanks.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
"parallel_for(blocked_range(0,L-1,1),FFTResult);"
The second parameter in a blocked_range constructor is exclusive (please check if this is what you meant), the second parameter in parallel_for should be a Body (FFTResult won't do what you want).
The second parameter in a blocked_range constructor is exclusive (please check if this is what you meant), the second parameter in parallel_for should be a Body (FFTResult won't do what you want).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My problem has beensolved.Thank you very much!

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