We can call the function through python because we first call the _galario_reduce_chi2 version that messes with pointers and doesn't care about const qualifiers. It fails from C/C++ because in galario.h it is correctly declared as
On the GPU we have to copy data anyways but on the CPU we overwrite. We should not. It maybe slightly less efficient or more inconvenient for us to program but it's better for the user. And it is unlikely the slow part of a calculation.
We can call the function through python because we first call the
_galario_reduce_chi2
version that messes with pointers and doesn't care aboutconst
qualifiers. It fails from C/C++ because ingalario.h
it is correctly declared asbut in the actual code we overwrite
fint
indiff_weighted_core
so it cannot be declaredconst
.On the GPU we have to copy data anyways but on the CPU we overwrite. We should not. It maybe slightly less efficient or more inconvenient for us to program but it's better for the user. And it is unlikely the slow part of a calculation.