Closed bkloppenborg closed 11 years ago
Modifications required:
COILibData
: Remove phasorCOILibData::InitData()
: Remove data rotation functions.COILibData::CopyToOpenCLDevice()
: Reorder data to be an array in this order: [v2, t3amp, t3phi]
when uploaded to the GPU.COILibData::GetT3()
: Fix for new data structure format. Data can be read directly from the mData array.CRoutine_FTtoT3::FTtoT3()
and CRoutine_FTtoT3::FTtoT3_CPU()
: Drop phasor from kernel argument. Supply n_t3
as parameter to kernel.ft_to_t3.cl
: Drop phasor. Modify output storage format to be [v2, t3amp, t3phi]
. Indexing is [0, n_v2, n_v2 + n_t3]
. Drop MultComplex4()
, implement MultComplex3
if it saves computation time.CRoutine_Chi()
: Make chi
, chi2
, GetChi
, GetChi2
functions virtual.CRoutine_Chi_Convex()
routine which inherits from CRoutine_Chi
. Call standard routines for the first n_v2 +n_t3
data points. Use new kernel chi_t3_convex.cl
on the remaining data.chi_t3_convex.cl
kernel which computes the chi on the phase by first projecting bispectra data and model into the Cartesian plane and then computes the standard chi expression. CRoutine_Chi_NonConvex
inheriting from CRoutine_Chi
. Call standard routines for the first n_v2 + n_t3
data points. Use new kernel chi_t3_nonconvex.cl
to do the bispectra.chi_t3_nonconvex.cl
kernel which computes the phase uncertainty as described in the first post.Note, the chi
and chi_t3*
variant kernels should be able to execute simultaneously.
Note, programs that derive from this library may also require changes. For instance in SIMTOI the CMinimizer_Bootstrap::MaskRandom()
function expects the T3 data are formatted in a specific order. We will need to alert authors of other software.
The new chi_bispectra*.cl
kernels presently assume zero indexing for the bispectra portion of mData_cl
. I suggest we partition out mData_cl
into [mV2_cl, mT3_cl]
using clCreateSubBuffer
and pass these around to the individual routines.
In a discussion with Fabien Baron, it appears stars that are well resolved often have underestimated chi2r for the triple products when T3 amplitudes are small. His solution is to implement the non-convex chi2 for the bispectra:
Alternatively, the phase expression can be rewritten as:
In order to implement this formulation we will need to create a new chi2 kernel and (possibly) rearrange how data is stored on the GPU. In particular, it might be worthwhile to split the T3_amp and T3_phi into two separate memory blocks. Profiling will be needed to ensure memory access patterns do not significantly degrade performance.