Simplify CUDA helper function.
Remove loop and throw OpenANNException.
Fix bug in logger.
Allow step-wise CG optimization.