Writing a wrapper for the CUDA memory allocation API