Skip to content

Commit

Permalink
Checkpoint
Browse files Browse the repository at this point in the history
Signed-off by: David Rowenhorst <[email protected]>
  • Loading branch information
drowenhorst-nrl committed May 12, 2024
1 parent 6cb5474 commit df9c31f
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions pyebsdindex/opencl/clnlpar.cl
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ __kernel void normd(
const long nrow = get_global_size(1);
const long indx_xy = x+y*ncol;

long i, j;
long indx_j, indx_ij, count;
long i, j, q;
long indx_j, indx_ij;

long nnn = (2*sr+1) * (2*sr+1);

Expand All @@ -197,30 +197,33 @@ __kernel void normd(
//printf("%f", sigma_xy);
float sigma_ij, nn, dd;

count = 0;
for(j=y-nn; j<=y+nn; ++j){

indx_j = (j >= 0) ? (j): abs(j);
indx_j = (indx_j < nrow) ? (indx_j): nrow - (indx_j -nrow +1);
indx_j = ncol * indx_j;

for(i=x-nn; i<=x+nn; ++i){
dd = d[count+nnn*indx_xy];
nn = n[count+nnn*indx_xy];
if (nn > 1e-3){

indx_ij = (i >= 0) ? (i): abs(i);
indx_ij = (indx_ij < ncol) ? (indx_ij): ncol - (indx_ij -ncol +1);
indx_ij = (indx_ij + indx_j);
sigma_ij = sigma[indx_ij];
sigma_ij *= sigma_ij;

sigma_ij = sigma_ij + sigma_xy;
dd -= nn*sigma_ij;
dd /= (sigma_ij * sqrt(2.0*nn));
//printf("%f\n", dd) ;
d[count+nnn*indx_xy] = dd;
for(q=0;q<nnn;q++){
dd = d[q+nnn*indx_xy];
nn = n[q+nnn*indx_xy];
if (nn > 1e-3){
dd -= nn*sigma_ij;
dd /= (sigma_ij * sqrt(2.0*nn));
//printf("%f\n", dd) ;
d[q+nnn*indx_xy] = dd;
}

}
count += 1;

}

}
Expand Down

0 comments on commit df9c31f

Please sign in to comment.