Skip to content

Conversation

@jw3126
Copy link
Contributor

@jw3126 jw3126 commented Jul 16, 2022

In some contexts, mutable structs are problematic (for instance on GPU). This adds a low-level purely functional way to use threefry.
If there is interest in this, I will add functional variants of the other rngs as well.
I can also add a convenience function for functional counter increment if desired.

@jw3126
Copy link
Contributor Author

jw3126 commented Jul 20, 2022

@sunoru any thoughts on having a side effect-free low-level API?

@sunoru
Copy link
Member

sunoru commented Jul 21, 2022

Sorry for replying late! Having such low-level APIs sounds useful. Can you also help add them to other RNGs?

@jw3126
Copy link
Contributor Author

jw3126 commented Jul 27, 2022

@sunoru I added the other rngs. Currently aesni and ars operate on __m128i which I am not sure we want to expose? Should I sandwich aesni and ars in conversion functions that let them operate on UInt128 instead?

@sunoru
Copy link
Member

sunoru commented Jul 27, 2022

Sure I guess we can just also have a version of aesni and ars to operate on UInt128 values.

@jw3126
Copy link
Contributor Author

jw3126 commented Jul 28, 2022

I added such aesni and ars could you run CI?

@sunoru
Copy link
Member

sunoru commented Jul 28, 2022

OK! BTW, I think it's OK to export these functions.

@codecov-commenter
Copy link

codecov-commenter commented Jul 28, 2022

Codecov Report

Merging #15 (c9c5f3d) into master (73adf98) will increase coverage by 0.05%.
The diff coverage is 100.00%.

❗ Current head c9c5f3d differs from pull request most recent head f49cdfc. Consider uploading reports for the commit f49cdfc to get more accurate results

@@            Coverage Diff             @@
##           master      #15      +/-   ##
==========================================
+ Coverage   98.57%   98.63%   +0.05%     
==========================================
  Files           7        7              
  Lines         842      879      +37     
==========================================
+ Hits          830      867      +37     
  Misses         12       12              
Impacted Files Coverage Δ
src/aesni.jl 99.09% <100.00%> (+0.13%) ⬆️
src/ars.jl 98.66% <100.00%> (+0.30%) ⬆️
src/philox.jl 98.63% <100.00%> (+0.08%) ⬆️
src/threefry.jl 99.54% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us.

@sunoru sunoru merged commit e00900b into JuliaRandom:master Jul 28, 2022
@sunoru
Copy link
Member

sunoru commented Jul 28, 2022

Looks good to me. Thanks very much!

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.

3 participants