Helpers and utilities for CUDA