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

Enable omp in evalautomorphism #802

Merged
merged 2 commits into from
Jun 14, 2024
Merged

Conversation

dsuponitskiy
Copy link
Collaborator

@dsuponitskiy dsuponitskiy commented Jun 13, 2024

Fixed some errors to enable OMP in EvalAutomorphismKeyGen()

@dsuponitskiy dsuponitskiy added this to the Release 1.2.0 milestone Jun 13, 2024
@dsuponitskiy dsuponitskiy self-assigned this Jun 13, 2024
@dsuponitskiy dsuponitskiy linked an issue Jun 13, 2024 that may be closed by this pull request
(*evalKeys)[indicesToGenerate[i]] = algo->KeySwitchGen(privateKey, privateKeyPermuted);
privateKeyPermuted->SetPrivateElement(s.AutomorphismTransform(index, vec));
#pragma omp critical
{ (*evalKeys)[indicesToGenerate[i]] = algo->KeySwitchGen(privateKey, privateKeyPermuted); }
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have you benchmarked this? probably faster to populate a vector inside the omp loop (no need for critical section) then populate the map from the vector afterwards.

if left as is, move computation outside of the critical section

auto ek = algo->KeySwitchGen(privateKey, privateKeyPermuted);
#pragma omp critical
{ (*evalKeys)[indicesToGenerate[i]] = ek; }

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected

@dsuponitskiy dsuponitskiy force-pushed the 797-enable-omp-in-evalautomorphism branch from 0005882 to 56e008f Compare June 14, 2024 02:40
@pascoec pascoec merged commit 4760cb6 into dev Jun 14, 2024
26 checks passed
@pascoec pascoec deleted the 797-enable-omp-in-evalautomorphism branch June 14, 2024 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable OMP parallelization in EvalAutomorphismKeyGen()
3 participants