hwcontext: add a CUDA implementation