Surrounded the clGetDeviceIDs block with a try block to catch CLExceptions so that if one particular platform does not have a CPU device and clGetDeviceIDs throws an exception, the program moves on and checks the next platform rather than crashing.