Fix timing reporting, and report single-threaded performance
nbody: generate code for sm_10, sm_20, sm_30, and sm_35

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody.cu: correct 'nosse' -> 'nosimd'

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody_CPU*: clean up code a bit

Adding some 'const's and fixing some whitespace.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody_CPU_SOA: eliminate impossible 'if' clause

Given that the condition for the loop is 'j < i', it's not possible to have
a case where 'j == i'.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody: use size_t for nTile in templates

This makes its type identical to the types of the iterator variables.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
chLib: make line endings consistent

Standardizing on UNIX (\n) line endings, as that's what the rest of the sources
use.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody: use -ffast-math on all target platforms

This is particularly critical for the rsqrtf() function:

    snoonan@dispater ~
    $ cat test.c
    #include <math.h>
    float rsqrtf(float x)
    {
	    return 1.0f / sqrtf(x);
    }

    $ gcc --version
    gcc (GCC) 4.8.1 20130725 (prerelease)

Without -ffast-math:

    snoonan@dispater ~
    $ gcc -O3 -S test.c; cat test.s | grep -v -E '\s+?[.][^L]'
    rsqrtf:
    .LFB3:
	    sqrtss	%xmm0, %xmm1
	    ucomiss	%xmm1, %xmm1
	    jp	.L7
	    movss	.LC0(%rip), %xmm0
	    divss	%xmm1, %xmm0
	    ret
    .L7:
	    pushq	%rax
	    call	sqrtf
	    movaps	%xmm0, %xmm1
	    movss	.LC0(%rip), %xmm0
	    divss	%xmm1, %xmm0
	    popq	%rdx
	    ret
    .LFE3:
    .LC0:

With -ffast-math:

    snoonan@dispater ~
    $ gcc -O3 -ffast-math -S test.c; cat test.s | grep -v -E '\s+?[.][^L]'
    rsqrtf:
    .LFB12:
	    rsqrtss	%xmm0, %xmm1
	    mulss	%xmm1, %xmm0
	    mulss	%xmm1, %xmm0
	    mulss	.LC1(%rip), %xmm1
	    addss	.LC0(%rip), %xmm0
	    mulss	%xmm1, %xmm0
	    ret
    .LFE12:
    .LC0:
    .LC1:

Note that it doesn't use 'rsqrtss' without -ffast-math.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody: make CPU_AOS OpenMP-parallelized

This one's really straightforward since there's no chance of threads stomping
on each other.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody_CPU_AOS: add condition to avoid calculating against self

The 'i == j' condition was impossible in nbody_CPU_SOA, but not here -- it's
definitely possible for us to compare an element against itself, which makes no
sense to do.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody.cu: respect 'nosimd' argument even without crosscheck

It affects other things (such as which algorithms to cycle through when hitting
the spacebar). There's no reason to disrespect it when crosscheck is off.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody: eliminate redundant xmmintrin.h include for CPU_SSE_openmp

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody: GPU_AOS_tiled_const should be conditional on __CUDA_ARCH__ >= 300

This makes it match Shuffle, et. al.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
whitespace: clean up trailing whitespace, convert tabs to spaces

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody: add vim modelines

Tired of whitespace damage.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody: when built without CUDA, invoke NVCC substitute the same as CXX

Also by default make NVCC=CXX, rather than g++.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Revert "drop USE_OPENMP flag, use _OPENMP instead, since it indicates compiler support"

This reverts commit 40ce6e8a977aeb185116419910e2c1fce17c450f.

Since 'nvcc' is the compiler for nbody.cu, it doesn't see the _OPENMP define
which was present in the source compilation of the OpenMP implementation. We
can't depend on the _OPENMP macro's existence to determine how the non-CUDA
portions were compiled.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody: make template function ComputeGravitation_AOS_tiled static

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody: simplify ComputeGravitation_AOS_tiled inner non-diagonal loop

It did an extra iteration where it wasn't necessary, since we specifically
exclude that iteration from running.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody_CPU_AOS_tiled: bump tile size to 128x128

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