nbody.cu: fix breakage on case-sensitive filesystems

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody: add GNUmakefile for Linux builds

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody: check for 'nocpu' argument earlier

If we don't check for it earlier, then the 'g_bNoCPU' check will never be true,
and thus is effectively dead code.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
chThread_Win32: fix memory leak if workerThread pointer is null

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
chCommandLine: add stdlib.h for atoi(3)

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody: implement CUDA-less build variant

Adds a dummy wrapper API for most of the CUDA calls when built with -DNO_CUDA.
This can be enabled via 'make NO_CUDA=1'.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody_CPU_SSE_threaded: make sseWorkerThread a static function

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody: implement OpenMP variant

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody: eliminate 'N % g_numCPUCores' check

This causes the app to not function if the system's CPU count is not a power of
two. I have a 24-thread Westmere box which it decided to not function on.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody: clean up printout format if/when user hits a hotkey

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody: refactor Makefile to support combined CUDA/OpenMP builds

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody: support alternate CUDA install path, specifiable by CUDA_ROOT on make command line

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody: track all relevant build flags in the .cflags file

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody: specify static,1 scheduling for OpenMP

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody: statically link special Intel compiler libraries, give better optimization reports

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
implementing gitignore directives for nbody

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
nbody: add Windows build support via MinGW64

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
chThread: support Mac OS X

Mac OS X strangely has the POSIX semaphore API but doesn't implement it
correctly. I really love seeing funky and hard-to-debug return values instead
of compile errors. Thanks, Apple!

We basically need to use named semaphores instead of the unnamed semaphores
that every other POSIX-compliant platform supports.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
chTimer: add Mac OS X support via mach_absolute_time

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

Since clang++ doesn't have OpenMP support, it makes some sense to have an
ability to exclude OpenMP from the build.

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