Traits with compile-time SIMD size
I can't seem to fulfill a trait that can return different length SIMDs
I can fall back to
next_scalar
. I'd like to be able to use next
e.g. to generate a set of normal deviates, etc.5 Replies
does that fix the issue?
If you want it to be static for all the calls and declared for the struct itself you could altnernatively do
NOTE: There are pros and cons to both of these
With the first approach, W must be specified every time
.next
is called, or given a default value
With the second approach, DummyEngine can't be easily stored in a collection, since DummyEngine[1]
and DummyEngine[2]
are different typesI tried that a bunch of different ways. When I parameterize
PRNG
as PRNG[T: PRNGEngine]
, I can't seem to resolve W.can you give example code?
I'll work something up that is a bit more complete. I am trying to infer W when passing the engine into the
PRNG
. I can see that it will probably work if I write it the dimensions explicitly everywhere.you could also use a global variable for config and just import it and use it everywhere