further development of cuda

refactors cuda project into multiple demos, extracts exit condition
evaluation