WIP: Game of Life example#3208
Conversation
jan-wassenberg
left a comment
There was a problem hiding this comment.
Looks like a good framework :)
If you'd like to start vectorizing already, I think SlideUpLanesOr is a good way to get right neighbors, for up/down it's just loading previous row, and for left we can use LoadU(d, ptr-1).
| const size_t nx = 60; | ||
| const size_t ny = 60; | ||
| const size_t iterations = 100; | ||
| bool* a = (bool*)malloc(nx*ny*sizeof(bool)); |
There was a problem hiding this comment.
Prefer AlignedFreeUniquePtr<uint8_t[]> ptr = AllocateAligned<uint8_t>(num); - this avoids leaks, and is vector-aligned.
|
A straight forward SIMD implementation is described at: However, bit operations seem to be the way to go: This maybe a good extended example, but might not be quite so helpful for demonstrating stencil computations. |
Game of life example to demonstrate stencil computations and computations using arrays of bits.
std::vector(bool) cannot be used and so hw::AlignedVector(bool) cannot also be used.
Could possibly output results as uncompressed animated gif or animated Lottie json files