Commit ffdffe77d3d6522621ffb0ed15f30d54c7da5d07

Con Kolivas 2011-07-02T12:12:35

Make sure the work gets attributed to the correct gpu. Add an fflush to stderr to minimise garbled output when multiple threads write at once.