Commit 921931ed authored by Martin Uecker's avatar Martin Uecker

use low-mem flag for basis computation

parent 6edc7b13
......@@ -221,7 +221,8 @@ static void compute_kern(unsigned int N, unsigned int flags, const long pos[N],
complex float* compute_psf(unsigned int N, const long img_dims[N], const long trj_dims[N], const complex float* traj,
const long bas_dims[N], const complex float* basis,
const long wgh_dims[N], const complex float* weights, bool periodic)
const long wgh_dims[N], const complex float* weights,
bool periodic, bool lowmem)
{
long img2_dims[N + 1];
md_copy_dims(N, img2_dims, img_dims);
......@@ -277,7 +278,7 @@ complex float* compute_psf(unsigned int N, const long img_dims[N], const long tr
long B = md_calc_size(N - 1, ksp2_dims) + md_calc_size(N - 1, img2_dims);
long C = md_calc_size(N, img2_dims);
if (A <= B) {
if ((A <= B) || !lowmem) {
debug_printf(DP_DEBUG1, "Allocating %ld (vs. %ld) + %ld\n", A, B, C);
......@@ -338,7 +339,8 @@ complex float* compute_psf(unsigned int N, const long img_dims[N], const long tr
static complex float* compute_psf2(int N, const long psf_dims[N + 1], unsigned long flags, const long trj_dims[N + 1], const complex float* traj,
const long bas_dims[N + 1], const complex float* basis, const long wgh_dims[N + 1], const complex float* weights, bool periodic)
const long bas_dims[N + 1], const complex float* basis, const long wgh_dims[N + 1], const complex float* weights,
bool periodic, bool lowmem)
{
int ND = N + 1;
......@@ -364,7 +366,7 @@ static complex float* compute_psf2(int N, const long psf_dims[N + 1], unsigned l
complex float* traj2 = md_alloc(ND, trj_dims, CFL_SIZE);
md_zsmul(ND, trj_dims, traj2, traj, 2.);
complex float* psft = compute_psf(ND, img2_dims, trj_dims, traj2, bas_dims, basis, wgh_dims, weights, periodic);
complex float* psft = compute_psf(ND, img2_dims, trj_dims, traj2, bas_dims, basis, wgh_dims, weights, periodic, lowmem);
md_free(traj2);
fftuc(ND, img2_dims, flags, psft, psft);
......@@ -595,7 +597,9 @@ struct linop_s* nufft_create2(unsigned int N,
md_calc_strides(ND, data->psf_strs, data->psf_dims, CFL_SIZE);
data->psf = compute_psf2(N, data->psf_dims, data->flags, data->trj_dims, data->traj, data->bas_dims, data->basis, data->wgh_dims, data->weights, true /*conf.periodic*/);
data->psf = compute_psf2(N, data->psf_dims, data->flags, data->trj_dims, data->traj,
data->bas_dims, data->basis, data->wgh_dims, data->weights,
true /*conf.periodic*/, conf.lowmem);
}
......
......@@ -49,7 +49,8 @@ extern _Complex float* compute_psf(unsigned int N,
const complex float* basis,
const long wgh_dims[__VLA(N)],
const complex float* weights,
_Bool periodic);
_Bool periodic,
_Bool lowmem);
extern void estimate_im_dims(int N, unsigned long flags, long dims[__VLA(N)], const long tdims[__VLA(N)], const complex float* traj);
......
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