Skip to content

Commit 3d7ae26

Browse files
committed
patch the CUDA code for failing CL hist case
1 parent 7ecb297 commit 3d7ae26

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/aspire/abinitio/commonline_sync3n.cu

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,9 +502,13 @@ void estimate_all_angles2(int j,
502502
} /* fixed width */
503503

504504
/* Divide accumulated angles (resulting in the mean alpha angle) */
505-
// (todo, can we have cnt = 0?)
506505
/* convert degree to radian */
507-
angles[pair_idx*3 + 1] *= M_PI / (180*cnt);
506+
if(cnt>0){
507+
angles[pair_idx*3 + 1] *= M_PI / (180*cnt);
508+
} else /* cnt 0 case */
509+
{
510+
angles[pair_idx*3 + 1] = 0;
511+
}
508512

509513
} /* estimate_all_angles2 kernel */
510514

0 commit comments

Comments
 (0)