|
| View previous topic :: View next topic |
| Author |
Message |
hwswcodesign
Joined: 18 Nov 2009 Posts: 3
|
Posted: Mon Nov 23, 2009 5:41 am Post subject: Parallel for loop: Internal compiler error |
|
|
Hi,
I'm trying to compile a simple loop where the iteration boundaries are not fix:
| Code: |
#pragma acc region
{
#pragma acc for
for (int y = ytl; y < ybr; y++) {
for (int x = xtl; x < xbr; x++) {
float v1 = a[x + y*width];
float v2 = b[x + y*width];
sum += (v1 - v2);
}
}
}
|
However, the compiler exits with an internal compiler error:
| Code: |
PGC-F-0000-Internal compiler error. unknown reference 15 (test.c: 46)
PGC/x86-64 Linux 10.0-0: compilation aborted
|
The loop is inside of a function ending at line number 46.
When I replace xtl by a constant, the compiler generates working code for CUDA. Is there any way to get around this issue?
Best regards,
Richard |
|
| Back to top |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 4996 Location: The Portland Group Inc.
|
Posted: Mon Nov 23, 2009 1:50 pm Post subject: |
|
|
Hi Richard,
I tried to recreate the ICE, but was unable. If you could send an example code which reproduces the error to PGI customer service (trs@pgroup.com), I would appreciate it.
What I did encounter was that I needed to specify the bounds of the a and b arrays in the copyin clause. It's possible that you need to do the same. For example:
| Code: | % cat test.c
#include <stdio.h>
#include <accel.h>
float foo (float *a, float *b, int xtl, int ytl, int ybr,int xbr,int width) {
float sum;
#pragma acc region copyin(a[0:xtl], b[0:xtl])
{
for (int y = ytl; y < ybr; y++) {
for (int x = xtl; x < xbr; x++) {
float v1 = a[x + y*width];
float v2 = b[x + y*width];
sum += (v1 - v2);
}
}
}
return sum;
}
% pgcc -c test.c -Msafeptr -ta=nvidia -V10.0 -Minfo=accel
foo:
9, Generating copyin(b[:xtl])
Generating copyin(a[:xtl])
11, Loop is parallelizable
Accelerator kernel generated
11, #pragma acc for parallel, vector(256)
15, Sum reduction generated for sum
12, Loop is parallelizable
|
Hope this helps,
Mat |
|
| Back to top |
|
 |
hwswcodesign
Joined: 18 Nov 2009 Posts: 3
|
Posted: Tue Nov 24, 2009 7:29 am Post subject: |
|
|
Hi Mat,
using the copyin clause was the right hint!
I had still some problems since I used structs to store some parameters and got the same error message. Using normal variables solved the problem!
Richard |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2002 phpBB Group
|