Consider a simple bit of code that does multi-component iteration:
registry.view<position, velocity>().each([dt](auto &pos, auto &vel){
pos += vel * dt;
});
Now I want to make it SIMD. It has to be done in chunks that are known to be continuous in memory. For example, this can be done via an API like this:
registry.view<position, velocity>().each([dt](auto *pos, auto *vel, size_t count){
for(size_t offset = 0; offset < count; offset += 4)
{
MulAdd4(pos + offset, vel + offset, dt);
}
for(; offset < count; offset++)
{
pos[i] += vel[i] * dt;
}
});
Is it possible to do something like this already? If no, how complicated would it be to implement?
Consider a simple bit of code that does multi-component iteration:
Now I want to make it SIMD. It has to be done in chunks that are known to be continuous in memory. For example, this can be done via an API like this:
Is it possible to do something like this already? If no, how complicated would it be to implement?