- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
long const dim;
Now, in a member function of the class in the .cpp file I have:
#pragma omp parallel for
for (long i = dim; i <= dd; i += dim)
.....
Then the following happens:
error: An OpenMP "for" must have a loop-invariant increment of integer type
The only way I got it to work is by adding before the pragma this:
long const dim(dim);
It seems the compiler is unable to take into account that dim is already a const as declared in the header, and I need to resort to this stupid looking fix.
Message Edited by Quince on 09-12-2005 05:57 PM
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
What compiler are you using?
Any chance you could post a small cut down here?
That said, assuming it is a problem in the compiler, the best route to get this addressed is to file a premier support issue. Can you do so?
Thanks,
Max
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
.h file:
class ART
{
public:
...
...
private:
...
...
long const dim;
...
...
};
.cpp file:
bool ART::MoveZig(float const img[])
{
...
...
long const dd(dim * dim);
float const fd2(static_cast(dim) / 2.0f - 0.5f), fh2(static_cast(hght) / 2.0f - 0.5f);
#pragma omp parallel for
for (long i = dim; i <= dd; i += dim)
{
long k;
if (sw) k = 6 * (dd - i);
else k = 6 * (i - dim);
for (long j = i - dim; j < i; ++j, k += 6)
{
... // No use of dim here
...
}
}
...
...
}
Compiling with icpc:
error: An OpenMP "for" must have a loop-invariant increment of integer type
for (long i = dim; i = dd; i += dim)
^
If, before the loop, I add:
long const dim(dim);
Then it compiles fine...
Message Edited by Quince on 09-20-2005 12:43 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
A developer was curious and confirmedthe problem. For best results and proper prioritization, I'd like to encourage you to submit a premier support issue if you have not done so.
Thanks,
Max
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
#pragma omp parallel
long const th(omp_get_thread_num());
#pragma omp master
{
if (th != 0) exit(0);
...
}
}
On random occasions the condition becomes true, i.e. we have a thread ID of a master thread that is not 0.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Any chance you could submit a Premier support issue?
thanks,
Max
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
For best results, try premier.intel.com
A developer may get curious and try out the code just from what you have posted, but I can make no guarantees. Any chance you could post the full testcase here?
Regards,
Max
Message Edited by mjdomeik on 09-27-2005 09:56 PM
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page