Improvements on integration with cuda