JuliaSIMD / VectorizedRNG.jl

Vectorized uniform and normal random samplers.
MIT License
33 stars 7 forks source link

corrected rand! for mutable static arrays and moved them to an extension #28

Closed schrimpf closed 11 months ago

schrimpf commented 11 months ago

Fixes #27

A couple things of note:

chriselrod commented 11 months ago

The point of the PtrArray is to potentially avoid allocations. Julia does not have proper escape analysis, so it conservatively heap allocates unnecessarily. PtrArray with GC.@preserve is a workaround.

MArray <: StaticArray and SArray <: StaticArray. MArray is mutable, but SArray is not. Other hypothetical StaticArrays are mutable.

I don't really use this with StaticArrays, though, and we can blame current limitations of Julia's compiler for the allocations, so I'm okay merging this.

codecov[bot] commented 11 months ago

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (c34cf44) 74.10% compared to head (bfe3c8f) 73.82%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #28 +/- ## ========================================== - Coverage 74.10% 73.82% -0.28% ========================================== Files 5 6 +1 Lines 695 680 -15 ========================================== - Hits 515 502 -13 + Misses 180 178 -2 ``` | [Files](https://app.codecov.io/gh/JuliaSIMD/VectorizedRNG.jl/pull/28?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaSIMD) | Coverage Δ | | |---|---|---| | [ext/VectorizedRNGStaticArraysExt.jl](https://app.codecov.io/gh/JuliaSIMD/VectorizedRNG.jl/pull/28?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaSIMD#diff-ZXh0L1ZlY3Rvcml6ZWRSTkdTdGF0aWNBcnJheXNFeHQuamw=) | `100.00% <100.00%> (ø)` | | | [src/api.jl](https://app.codecov.io/gh/JuliaSIMD/VectorizedRNG.jl/pull/28?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaSIMD#diff-c3JjL2FwaS5qbA==) | `71.31% <100.00%> (+6.86%)` | :arrow_up: | | [src/VectorizedRNG.jl](https://app.codecov.io/gh/JuliaSIMD/VectorizedRNG.jl/pull/28?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaSIMD#diff-c3JjL1ZlY3Rvcml6ZWRSTkcuamw=) | `82.14% <0.00%> (-3.05%)` | :arrow_down: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/JuliaSIMD/VectorizedRNG.jl/pull/28/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaSIMD)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

schrimpf commented 11 months ago

This last change is about the best I can do. I do not understand the failed Aqua tests on version 1.6, and cannot fix them. They do not seem to matter anyway.

chriselrod commented 11 months ago

This last change is about the best I can do. I do not understand the failed Aqua tests on version 1.6, and cannot fix them. They do not seem to matter anyway.

I wouldn't worry about them either.