southgary

problem on built the kernel

Discussion created by southgary on Oct 8, 2009
Latest reply on Oct 12, 2009 by southgary
The host code is added

Hello!

Thank you for answer me in the last question. I have tried to design a iteration program but the following error is found on bulit the kernel.

Picture: http://i1015.photobucket.com/albums/af280/southgary/bug.jpg

Anyone know what is that?

 

__kernel void iter(__global float *jdiag, __global int *col_ind, __global int *jd_ptr, __global float *B, __global float *xnew) { int col = 0; int i = 0; int j = 0; int N = 4; float xold[4] = {0}; int detect_limit = 0; float temp = 0; float tempnew = 0; float tempold = 0; float limit = 0.1; int ii; int jdiag_ptr = 0; int Ndata = 0; //Start iterative for (ii=0;ii<10;ii++){ detect_limit=0; for (i=0;i<N;i++){ Ndata = jd_ptr[i+1] - jd_ptr[i]; //find the number of valua jdiag_ptr = jd_ptr[i]; //store the start pointer for(j=0;j<Ndata;j++){ //start calculate col_ind[jdiag_ptr+j] = col; if(col != i){ temp += jdiag[jdiag_ptr+j]*xold[col]; } } xnew[i] = (B[i]-temp)/jdiag[jdiag_ptr]; } for (i=0;i<N; i++){ tempnew = xnew[i]; tempold = xold[i]; if(xnew[i] < 0){ tempnew = xnew[i]*(-1); } if(xold[i] < 0){ tempold = xold[i]*(-1); //printf("tempold %3.2f\n", tempold); } temp = tempnew-tempold; if(temp < 0){ temp = temp*(-1); } if (temp > limit){ xold[i]=xnew[i]; detect_limit++; } } } }

Outcomes