cudaMemcpy return code when some other kernel (of some other process) is already running

cudaMemcpy doesn’t copy unless the kernel submitted before, finish its execution in symmetric constraints. For this particular situation, what does the cudaMemcpy return? The cudaMemcpy function usually waits and as and when the device becomes free, it copies. Between, just when the cudaMemcpy realizes that the device is not free and starts waiting, is it not possible to make it return a value and exit from there (saying, the device is busy)? I want something like this to happen. My purpose is to check if a device is free or busy? Are there any APIs through which I can achieve this?