Commit 545021d0 authored by Martin Reinecke's avatar Martin Reinecke

experimental changes for debugging

parent 5cf74e57
Pipeline #87839 passed with stages
in 35 minutes and 9 seconds
...@@ -40,6 +40,8 @@ ...@@ -40,6 +40,8 @@
#include "ducc0/infra/timers.h" #include "ducc0/infra/timers.h"
#include "ducc0/math/gridding_kernel.h" #include "ducc0/math/gridding_kernel.h"
#define PARANOIA_MODE
namespace ducc0 { namespace ducc0 {
namespace detail_gridder { namespace detail_gridder {
...@@ -171,6 +173,7 @@ template<typename T> void hartley2_2D(mav<T,2> &arr, size_t vlim, ...@@ -171,6 +173,7 @@ template<typename T> void hartley2_2D(mav<T,2> &arr, size_t vlim,
{ {
size_t nu=arr.shape(0), nv=arr.shape(1); size_t nu=arr.shape(0), nv=arr.shape(1);
fmav<T> farr(arr); fmav<T> farr(arr);
#ifndef PARANOIA_MODE
if (2*vlim<nv) if (2*vlim<nv)
{ {
if (!first_fast) if (!first_fast)
...@@ -183,6 +186,7 @@ template<typename T> void hartley2_2D(mav<T,2> &arr, size_t vlim, ...@@ -183,6 +186,7 @@ template<typename T> void hartley2_2D(mav<T,2> &arr, size_t vlim,
r2r_separable_hartley(farr, farr, {1}, T(1), nthreads); r2r_separable_hartley(farr, farr, {1}, T(1), nthreads);
} }
else else
#endif
r2r_separable_hartley(farr, farr, {0,1}, T(1), nthreads); r2r_separable_hartley(farr, farr, {0,1}, T(1), nthreads);
execParallel((nu+1)/2-1, nthreads, [&](size_t lo, size_t hi) execParallel((nu+1)/2-1, nthreads, [&](size_t lo, size_t hi)
...@@ -440,6 +444,7 @@ template<typename T> class Params ...@@ -440,6 +444,7 @@ template<typename T> class Params
timers.push("FFT"); timers.push("FFT");
checkShape(grid.shape(), {nu,nv}); checkShape(grid.shape(), {nu,nv});
fmav<complex<T>> inout(grid); fmav<complex<T>> inout(grid);
#ifndef PARANOIA_MODE
if (2*vlim<nv) if (2*vlim<nv)
{ {
if (!uv_side_fast) if (!uv_side_fast)
...@@ -452,6 +457,7 @@ template<typename T> class Params ...@@ -452,6 +457,7 @@ template<typename T> class Params
c2c(inout, inout, {1}, BACKWARD, T(1), nthreads); c2c(inout, inout, {1}, BACKWARD, T(1), nthreads);
} }
else else
#endif
c2c(inout, inout, {0,1}, BACKWARD, T(1), nthreads); c2c(inout, inout, {0,1}, BACKWARD, T(1), nthreads);
timers.poppush("wscreen+grid correction"); timers.poppush("wscreen+grid correction");
grid2dirty_post2(grid, dirty, w); grid2dirty_post2(grid, dirty, w);
...@@ -465,10 +471,14 @@ template<typename T> class Params ...@@ -465,10 +471,14 @@ template<typename T> class Params
checkShape(grid.shape(), {nu, nv}); checkShape(grid.shape(), {nu, nv});
auto cfu = krn->corfunc(nxdirty/2+1, 1./nu, nthreads); auto cfu = krn->corfunc(nxdirty/2+1, 1./nu, nthreads);
auto cfv = krn->corfunc(nydirty/2+1, 1./nv, nthreads); auto cfv = krn->corfunc(nydirty/2+1, 1./nv, nthreads);
#ifndef PARANOIA_MODE
// only zero the parts of the grid that are not filled afterwards anyway // only zero the parts of the grid that are not filled afterwards anyway
{ auto a0 = grid.template subarray<2>({0,nydirty/2}, {nxdirty/2, nv-nydirty+1}); quickzero(a0, nthreads); } { auto a0 = grid.template subarray<2>({0,nydirty/2}, {nxdirty/2, nv-nydirty+1}); quickzero(a0, nthreads); }
{ auto a0 = grid.template subarray<2>({nxdirty/2,0}, {nu-nxdirty+1, nv}); quickzero(a0, nthreads); } { auto a0 = grid.template subarray<2>({nxdirty/2,0}, {nu-nxdirty+1, nv}); quickzero(a0, nthreads); }
{ auto a0 = grid.template subarray<2>({nu-nxdirty/2+1, nydirty/2}, {nxdirty/2-1, nv-nydirty+1}); quickzero(a0, nthreads); } { auto a0 = grid.template subarray<2>({nu-nxdirty/2+1, nydirty/2}, {nxdirty/2-1, nv-nydirty+1}); quickzero(a0, nthreads); }
#else
quickzero(grid, nthreads);
#endif
timers.poppush("grid correction"); timers.poppush("grid correction");
execParallel(nxdirty, nthreads, [&](size_t lo, size_t hi) execParallel(nxdirty, nthreads, [&](size_t lo, size_t hi)
{ {
...@@ -493,10 +503,14 @@ template<typename T> class Params ...@@ -493,10 +503,14 @@ template<typename T> class Params
timers.push("zeroing grid"); timers.push("zeroing grid");
checkShape(dirty.shape(), {nxdirty, nydirty}); checkShape(dirty.shape(), {nxdirty, nydirty});
checkShape(grid.shape(), {nu, nv}); checkShape(grid.shape(), {nu, nv});
#ifndef PARANOIA_MODE
// only zero the parts of the grid that are not filled afterwards anyway // only zero the parts of the grid that are not filled afterwards anyway
{ auto a0 = grid.template subarray<2>({0,nydirty/2}, {nxdirty/2, nv-nydirty+1}); quickzero(a0, nthreads); } { auto a0 = grid.template subarray<2>({0,nydirty/2}, {nxdirty/2, nv-nydirty+1}); quickzero(a0, nthreads); }
{ auto a0 = grid.template subarray<2>({nxdirty/2,0}, {nu-nxdirty+1, nv}); quickzero(a0, nthreads); } { auto a0 = grid.template subarray<2>({nxdirty/2,0}, {nu-nxdirty+1, nv}); quickzero(a0, nthreads); }
{ auto a0 = grid.template subarray<2>({nu-nxdirty/2+1, nydirty/2}, {nxdirty/2-1, nv-nydirty+1}); quickzero(a0, nthreads); } { auto a0 = grid.template subarray<2>({nu-nxdirty/2+1, nydirty/2}, {nxdirty/2-1, nv-nydirty+1}); quickzero(a0, nthreads); }
#else
quickzero(grid, nthreads);
#endif
timers.poppush("wscreen+grid correction"); timers.poppush("wscreen+grid correction");
double x0 = -0.5*nxdirty*pixsize_x, double x0 = -0.5*nxdirty*pixsize_x,
y0 = -0.5*nydirty*pixsize_y; y0 = -0.5*nydirty*pixsize_y;
...@@ -560,6 +574,7 @@ template<typename T> class Params ...@@ -560,6 +574,7 @@ template<typename T> class Params
dirty2grid_pre2(dirty, grid, w); dirty2grid_pre2(dirty, grid, w);
timers.push("FFT"); timers.push("FFT");
fmav<complex<T>> inout(grid); fmav<complex<T>> inout(grid);
#ifndef PARANOIA_MODE
if (2*vlim<nv) if (2*vlim<nv)
{ {
if (uv_side_fast) if (uv_side_fast)
...@@ -572,6 +587,7 @@ template<typename T> class Params ...@@ -572,6 +587,7 @@ template<typename T> class Params
c2c(inout, inout, {1}, FORWARD, T(1), nthreads); c2c(inout, inout, {1}, FORWARD, T(1), nthreads);
} }
else else
#endif
c2c(inout, inout, {0,1}, FORWARD, T(1), nthreads); c2c(inout, inout, {0,1}, FORWARD, T(1), nthreads);
timers.pop(); timers.pop();
} }
......
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