Separate canDetectGpus and findGpus futher, and fix tests
authorMark Abraham <mark.j.abraham@gmail.com>
Thu, 21 Dec 2017 10:56:59 +0000 (21:56 +1100)
committerErik Lindahl <erik.lindahl@gmail.com>
Fri, 29 Dec 2017 11:08:51 +0000 (12:08 +0100)
commit6803c6583682616e7e9018e38dac834bbc0f2c6f
treed116f957077dfac6a96f36113a6b5c44721868f6
parent43a0002e84ecbf060dc87559891cf9e70b69cb0e
Separate canDetectGpus and findGpus futher, and fix tests

Renamed detect_gpus to findGpus so that no code can silently call
detect_gpus while forgetting to call the required canDetectGpus first.
Some test code is updated accordingly, which should have happened
earlier. The function with the new name now needs no return value, so
the formerly confusing return value of zero for success is no longer
present.

Shifted some more responsibilities from findGpus to canDetectGpus, so
that the latter now has responsibility for ensuring that when it
returns true, the former will always succeed.

Fixed tests that compile with CUDA, but cannot run unless there
are visible comatible devices and a valid context.

Refs #2347, #2322, #2321

Change-Id: I34acf8be4c0f0dcc29e931d83c970ba945865ca7
src/gromacs/gpu_utils/gpu_utils.cu
src/gromacs/gpu_utils/gpu_utils.h
src/gromacs/gpu_utils/gpu_utils_ocl.cpp
src/gromacs/gpu_utils/tests/gputest.cpp
src/gromacs/gpu_utils/tests/hostallocator.cpp
src/gromacs/gpu_utils/tests/pinnedmemorychecker.cpp
src/gromacs/hardware/detecthardware.cpp
src/programs/mdrun/tests/pmetest.cpp