Opencl/CUDA processes that keep gpu percentage busy

I am looking for opencl or cuda programms that will use specific amount of gpu resources.
I want somehow to configure a priori the gpu resources (for example 30% or 15 SMs) that my programs will use.
I need it for some experiments that need some of the gpu resources busy.

Can I find programs/processes like those?

Thanks for your reply.
But from the links you recommended me I found out that I can only limit the gpu resources with some ‘hacks’ that might not give the desirable results.

But in my case I do not want exactly this.

I want gpu processes that will capture some standard resources of the gpu for a long time.

Can I find ready processes like this, or I need to create them by my self?

That’s correct, there is currently no way to limit the number of SMs a priori. You will have to calculate the number of threads and blocks in a way that when the kernel is launched, the total usage is 30% of the SMs depending on the card.

You will have to check cudaDeviceProperties in runtime, which stores the needed information, since 30% of the SMs in a GT650M is not the same for the K40, which is not the same for a 1060…