diff --git a/src/kernels.cu b/src/kernels.cu index 56fdc18..b58fca9 100644 --- a/src/kernels.cu +++ b/src/kernels.cu @@ -164,11 +164,10 @@ __global__ void cu_sim(const simulation_parameters *param, const float *pFieldMa } // update old position with the new one - if(param->enRecordTrajectory && current_timepoint != 0 && dummy_scan != 0) - xyz1 += 3; + if(param->enRecordTrajectory && (current_timepoint != 0 || dummy_scan != 0)) + xyz1 += 3; for (uint8_t i=0; i < 3; i++) xyz1[i] = xyz_new[i]; - // increase timepoint current_timepoint++; } @@ -180,6 +179,7 @@ __global__ void cu_sim(const simulation_parameters *param, const float *pFieldMa for(uint8_t i=0; i<3; i++) m0[i] = m1[i]; } + } diff --git a/src/spinwalk.cu b/src/spinwalk.cu index 86c54e2..1be82ba 100644 --- a/src/spinwalk.cu +++ b/src/spinwalk.cu @@ -48,7 +48,7 @@ bool simulate(simulation_parameters param, std::map fieldmap(param.matrix_length, 0.f); std::vector mask(param.matrix_length, 0); std::vector XYZ0(len0, 0.f); // memory layout(column-wise): [3 x n_spins] - std::vector XYZ1(len1, 0.f); // memory layout(column-wise): [3 x timepoints x n_spins x n_sample_length_scales] or [3 x n_spins x n_sample_length_scales] + std::vector XYZ1(len1, 0.f); // memory layout(column-wise): [3 x timepoints x n_spins x n_sample_length_scales] or [3 x 1 x n_spins x n_sample_length_scales] std::vector M0(len0, 0.f); // memory layout(column-wise): [3 x n_spins] std::vector M1(len2, 0.f); // memory layout(column-wise): [3 x n_TE x n_spins x n_sample_length_scales] BOOST_LOG_TRIVIAL(info) << "Memory allocation (CPU) took " << std::chrono::duration_cast(std::chrono::steady_clock::now() - st).count() << " ms"; @@ -177,7 +177,7 @@ bool simulate(simulation_parameters param, std::map