Commit a2577d72 authored by Qi Chu's avatar Qi Chu

postcoh_kernel.cu: use atan2 instead of atan for a full phase for coa_phase of triggers

parent f21b7993
......@@ -576,7 +576,7 @@ __global__ void ker_coh_max_and_chisq_versatile
/* set the d_snglsnr_* */
snglsnr_H[peak_cur + write_ifo_mapping[j] * max_npeak] = sqrt(tmp_maxsnr.re * tmp_maxsnr.re + tmp_maxsnr.im * tmp_maxsnr.im);
/* set the d_coa_phase_* */
snglsnr_H[peak_cur + (3 + write_ifo_mapping[j]) * max_npeak] = atan(tmp_maxsnr.re / tmp_maxsnr.im);
snglsnr_H[peak_cur + (3 + write_ifo_mapping[j]) * max_npeak] = atan2(tmp_maxsnr.im, tmp_maxsnr.re);
for (int ishift = threadIdx.x - autochisq_half_len; ishift <= autochisq_half_len; ishift += blockDim.x)
{
......@@ -747,7 +747,7 @@ __global__ void ker_coh_max_and_chisq_versatile
/* set the d_snglsnr_* */
snglsnr_bg_H[output_offset + write_ifo_mapping[j] * hist_trials * max_npeak] = sqrt(tmp_maxsnr.re * tmp_maxsnr.re + tmp_maxsnr.im * tmp_maxsnr.im);
/* set the d_coa_phase_* */
snglsnr_bg_H[output_offset + (3 + write_ifo_mapping[j]) * hist_trials * max_npeak] = atan(tmp_maxsnr.re / tmp_maxsnr.im);
snglsnr_bg_H[output_offset + (3 + write_ifo_mapping[j]) * hist_trials * max_npeak] = atan2(tmp_maxsnr.im, tmp_maxsnr.re);
for (int ishift = srcLane - autochisq_half_len; ishift <= autochisq_half_len; ishift += WARP_SIZE)
{
......@@ -982,7 +982,7 @@ __global__ void ker_coh_max_and_chisq
/* set the d_snglsnr_* */
snglsnr_H[peak_cur + write_ifo_mapping[j] * max_npeak] = sqrt(tmp_maxsnr.re * tmp_maxsnr.re + tmp_maxsnr.im * tmp_maxsnr.im);
/* set the d_coa_phase_* */
snglsnr_H[peak_cur + (3 + write_ifo_mapping[j]) * max_npeak] = atan(tmp_maxsnr.re / tmp_maxsnr.im);
snglsnr_H[peak_cur + (3 + write_ifo_mapping[j]) * max_npeak] = atan2(tmp_maxsnr.im, tmp_maxsnr.re);
for (int ishift = threadIdx.x - autochisq_half_len; ishift <= autochisq_half_len; ishift += blockDim.x)
{
......@@ -1143,7 +1143,7 @@ __global__ void ker_coh_max_and_chisq
/* set the d_snglsnr_* */
snglsnr_bg_H[output_offset + write_ifo_mapping[j] * hist_trials * max_npeak] = sqrt(tmp_maxsnr.re * tmp_maxsnr.re + tmp_maxsnr.im * tmp_maxsnr.im);
/* set the d_coa_phase_* */
snglsnr_bg_H[output_offset + (3 + write_ifo_mapping[j]) * hist_trials * max_npeak] = atan(tmp_maxsnr.re / tmp_maxsnr.im);
snglsnr_bg_H[output_offset + (3 + write_ifo_mapping[j]) * hist_trials * max_npeak] = atan2(tmp_maxsnr.im, tmp_maxsnr.re);
for (int ishift = srcLane - autochisq_half_len; ishift <= autochisq_half_len; ishift += WARP_SIZE)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment