Reputation: 3056
For a problem I'm working on I need to solve two sub-problems: Sub1 on an NxM grid, and Sub2 on a Kx1 grid. The problem is, these sub-problems should communicate after every step in the solution process so I need to run them simultaneously.
The end result should look like this:
This is then repeated for t+1, using the newly calculated interaction term, and then for t+2, t+3, etc. All the data used is stored in global device memory so there doesn't need to be any copying to and from the device in between the steps.
My problem is, how do I tell OpenCL I want to work on two different sized problems at the same time?
Upvotes: 0
Views: 67
Reputation: 8410
Is it really needed to be "at the same time"?
This is a common missunderstanding of OpenCL and parallel systems. Being more and more parallel and having all running in parallel is not always a good choice. In fact, 99% of the cases do not need to be parallel (unless some time constrain exist), and forcing to be so, slows down the speed.
Depending on the sizes and amount of work of Sub1
and Sub2
:
Sub1
and Sub2
.I would say in your case, you should go for many kernels.
Upvotes: 1