Added automatic checking for cuda support. Reverts to CPU if GPU mode not supported.