Interrupting a CUDA call

I’d like to give the user the capability to abort the current process, which includes calls to CUDA from c++. I can interrupt the normal c++ code, but is there a way to interrupt the calls to:

  • cudaMalloc
  • cudaMemcpy (to/from host)
  • cudaFree

If you abort the current process, i.e. kill it, you will also kill anything happening on the GPU that originated from that process.