How to check if an Application is running on GPU

Is there any way to know that GPU has an application running already or it is processing something before I Launch my application on it? I goggled but couldn’t find any API for that. I need something for CUDA Framework using C/C++.

You are looking for the NVIDIA Management Library (NVML)

nvidia-smi uses it to query the gpu. So there must be a function in the api
which is capable to list all currently running processes on the graphics card