Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimization of the proj for the case of some of det_weights == 0.0 #165

Merged
merged 2 commits into from
Jan 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions src/Projection.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1387,9 +1387,11 @@ void to_map_single_thread(Pointer<C> &pointer,
int n_det = pointer.DetCount();
for (int i_det = 0; i_det < n_det; ++i_det) {
FSIGNAL det_wt = 1.;
if (_det_weights->obj != NULL)
if (_det_weights->obj != NULL){
det_wt = *(FSIGNAL*)((char*)_det_weights->buf +
_det_weights->strides[0]*i_det);
if (det_wt == 0.) continue;
}
double dofs[4];
double coords[4];
FSIGNAL pf[S::comp_count];
Expand Down Expand Up @@ -1423,9 +1425,11 @@ void to_weight_map_single_thread(Pointer<C> &pointer,
int n_det = pointer.DetCount();
for (int i_det = 0; i_det < n_det; ++i_det) {
FSIGNAL det_wt = 1.;
if (_det_weights->obj != NULL)
if (_det_weights->obj != NULL){
det_wt = *(FSIGNAL*)((char*)_det_weights->buf +
_det_weights->strides[0]*i_det);
if (det_wt == 0.) continue;
}
double dofs[4];
double coords[4];
FSIGNAL pf[S::comp_count];
Expand Down Expand Up @@ -1694,9 +1698,10 @@ void precomp_to_map_single_thread(Pixelizor2_Flat<TilingSys> &tiling,

for (int i_det = 0; i_det < n_det; ++i_det) {
FSIGNAL det_wt = 1.;
if (_det_weights->obj != NULL)
if (_det_weights->obj != NULL){
det_wt = *(FSIGNAL*)((char*)_det_weights->buf + _det_weights->strides[0]*i_det);

if (det_wt == 0.) continue;
}
for (auto const &rng: ivals[i_det].segments) {
for (int i_time = rng.first; i_time < rng.second; ++i_time) {
const int *pixel_offset = pixel_buf_man.data_ptr[i_det] +
Expand Down Expand Up @@ -1728,9 +1733,10 @@ void precomp_to_weight_map_single_thread(Pixelizor2_Flat<TilingSys> &tiling,
assert(spin_proj_man.steps[1] == 1); // assumed below
for (int i_det = 0; i_det < n_det; ++i_det) {
FSIGNAL det_wt = 1.;
if (_det_weights->obj != NULL)
if (_det_weights->obj != NULL){
det_wt = *(FSIGNAL*)((char*)_det_weights->buf + _det_weights->strides[0]*i_det);

if (det_wt == 0.) continue;
}
for (auto const &rng: ivals[i_det].segments) {
for (int i_time = rng.first; i_time < rng.second; ++i_time) {
const int *pixel_offset = pixel_buf_man.data_ptr[i_det] +
Expand Down
Loading