Add various utility functions useful for CUDA programming