nbody: eliminate _threaded and _openmp variants, make stock variants OpenMP

If we build without OpenMP or use OMP_NUM_THREADS=1, you can see what
performance is like with a single thread.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody.cu: remove outdated build instructions from header

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody: introduce CPU_SOA_tiled implementation

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody_CPU_AOS_tiled: add SIMD vectorization support to DoDiagonalTile

DoNonDiagonalTile is a more complicated story...

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody_CPU_SOA: make not suck

I don't know why this was doing it the way it was, but the atomic updates were
really slowing everything down.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody_CPU_SOA.cpp: add SIMD vectorization support

The inner loop can be explicitly called out for vectorization.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody_CPU_SIMD: correct declaration of 'pos'

It's an array of 3 float pointers, not 4. This is mostly a cosmetic change, as
we weren't doing any out-of-bounds accesses, but it makes it more clear.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody: in #pragma simd, use 'vectorlengthfor' rather than 'vectorlength'

This allows the compiler to choose based on 128-bit/256-bit register
availability, etc.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody: make ICC builds less chatty

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody: silence warning about implicit conversion from size_t to int

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody_CPU_AOS: drop 'shared' specifier on OpenMP stanza

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody: change tile size for CPU_*_tiled to be greatest common factor

We do multiples of 1024 bodies, so it makes sense to set our tiles to that
size. In some quick testing, this reduced the time cost for the _tiled
variants.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody: if OpenMP is enabled, find and add libiomp5 to libraries

libiomp5 is much better than libgomp, so we try to always link it explicitly
when it's available.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>