Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code distribution failed #32

Open
ThinhinaneIhadadene opened this issue Nov 7, 2018 · 4 comments
Open

Code distribution failed #32

ThinhinaneIhadadene opened this issue Nov 7, 2018 · 4 comments

Comments

@ThinhinaneIhadadene
Copy link

ThinhinaneIhadadene commented Nov 7, 2018

I tried to distribute this implementation of warp_affine, which I could parallelize with Pluto

  float A00,A01,A10,A11;
  int coord_00_c,coord_00_r,coord_01_c,coord_01_r,coord_10_c,coord_10_r,coord_11_c,coord_11_r;
  float o_r,o_c,r,c;  double t_start, t_end;
	init_array() ;
	IF_TIME(t_start = rtclock());
  int n_r,n_c;
 int i,j;
 const float a00=0.1f;
 const float a01=0.1f;
 const float a10=0.1f;
 const float a11=0.1f;
 const float b00=0.1f;
 const float b10 =0.1f;
#pragma scop
    for (n_r = 0; n_r < ROWS; n_r++) {
        for (n_c = 0; n_c < COLS; n_c++) {
            o_r = a11 * n_r + a10 * n_c + b00;
            o_c = a01 * n_r + a00 * n_c + b10;
            r = o_r - floorf(o_r);
            c = o_c - floorf(o_c);
            coord_00_r = floorf(o_r);
            coord_00_c = floorf(o_c);
            coord_01_r = coord_00_r;
            coord_01_c = coord_00_c + 1;
            coord_10_r = coord_00_r + 1;
            coord_10_c = coord_00_c;
            coord_11_r = coord_00_r + 1;
            coord_11_c = coord_00_c + 1;
            coord_00_r = clamp(coord_00_r, 0, ROWS - 1);
            coord_00_c = clamp(coord_00_c, 0, COLS - 1);
            coord_01_r = clamp(coord_01_r, 0, ROWS - 1);
            coord_01_c = clamp(coord_01_c, 0, COLS - 1);
            coord_10_r = clamp(coord_10_r, 0, ROWS - 1);
            coord_10_c = clamp(coord_10_c, 0, COLS - 1);
            coord_11_r = clamp(coord_11_r, 0, ROWS - 1);
            coord_11_c = clamp(coord_11_c, 0, COLS - 1);
             A00 = src[coord_00_r][coord_00_c];
             A10 = src[coord_10_r][coord_10_c];
             A01 = src[coord_01_r][coord_01_c];
             A11 = src[coord_11_r][coord_11_c];
           dst[n_r][n_c] = mixf(mixf(A00, A10, r), mixf(A01, A11, r), c);
          }
        }
#pragma endscop

and it failed with this error :

[CLooG] INFO: 1 dimensions (over 3) are scalar.
pluto: ast_transform.c:193: pluto_mark_parallel: Assertion `stmt->ploop_id == i' failed.
../../polycc: line 60:  5016 Aborted                 (core dumped) $pluto $*

Here is the folder which contains the whole code and all the required files, it also contains the full output.
warp_affine.zip.
I get the same error when I try to use a scalar variable with a reduction, here is an example :

int q,w,cc,e,r;
init_array() ;
 float prod1;
#pragma scop
for (int q = 0; q < ROWS - 5; q++) {
    for (int w = 0; w < COLS - 5; w++) {
        for (int cc = 0; cc < 3; cc++) {
            prod1=0.0f;
            for (int r = 0; r < 5; r++) {
              prod1 += src[q + r][w][cc] * kernelX[r];
            }
            temp[q][w][cc] = prod1;
        }
    }
}
#pragma endscop

I also get ./isl_list_templ.c:246: index out of bounds when running make par , I couldn't understand why.
Thanks.

@ThinhinaneIhadadene ThinhinaneIhadadene changed the title Distributing warp_affine program failed Code distribution failed Nov 10, 2018
@bondhugula
Copy link
Owner

Thanks for reporting this. Sorry about the slow response - I'll be able to look at this by this weekend. Pluto has no support for detecting private / local vars. So I wouldn't replace temp[q][w][cc] by a scalar. The compiler you finally use will likely do this scalar replacement on the generated code.

@ThinhinaneIhadadene
Copy link
Author

Thanks.
what about the warp affine algorithm, why it couldn't be distributed while it could be parallelized?

@bondhugula
Copy link
Owner

Can I know which version of Pluto you are using?

$ ./polycc -v

@ThinhinaneIhadadene
Copy link
Author

the output of ./polycc -v is PLUTO 0.11.4-311-g28e4655

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants