Skip to content

Commit

Permalink
Fix #120
Browse files Browse the repository at this point in the history
Fix a bug whereby the CUDA code would crash for particular initial configurations made by nucleotides aligned along z.
  • Loading branch information
lorenzo-rovigatti committed Aug 30, 2024
1 parent 68b8437 commit 2b69edf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/CUDA/cuda_utils/CUDA_lr_common.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,8 @@ __forceinline__ __device__ void operator-=(float4 &a, float4 b) {
__forceinline__ __device__ c_number4 stably_normalised(const c_number4 &v) {
c_number max = fmaxf(fmaxf(fabsf(v.x), fabsf(v.y)), fabsf(v.z));
c_number4 res = v / max;
return res / _module(res);
c_number res_mod = _module(res);
return (res_mod > 0.f) ? res / res_mod : res;
}

#endif /* CUDA_LR_COMMON */

0 comments on commit 2b69edf

Please sign in to comment.