control code changes from Tealeaf version
Cuda changes from tealeaf repo
removed remnants of Tealeaf specific code