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

Faster initialisation on a gpu #296

Open
richfitz opened this issue Oct 22, 2021 · 0 comments
Open

Faster initialisation on a gpu #296

richfitz opened this issue Oct 22, 2021 · 0 comments

Comments

@richfitz
Copy link
Member

richfitz commented Oct 22, 2021

If we had jump coefficients for 2^128, 2^129, ... (up to some reasonable number 128 + m - 1) then we can create up to 2^m starting points very quickly by jumping (or not) through each of these coefficients:

  • let i be the thread index on 0..k-1 for k threads
  • encode i in binary with ceiling(log2(k)), e.g. 0110 for i=6, k=8
  • for each bit in our series advance using a decreasing series of our jump coefficients (2^131, 2^130, 2^129, 2^128 with k =8 so that the thread 6 jumps with 2^130 and 2^131)

This gives in log(k) steps (walltime) a set of evenly spaced starting points exactly as if we'd jumped in series.

To pull this off we need to precompute some number of coefficients. Getting 20 of them would be nice as that gets us up to a million particles.

Resources:

Other:

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

No branches or pull requests

1 participant