Open GoogleCodeExporter opened 9 years ago
At present we can only interact with OpenCL devices during a Kernel.execute()
dispatch call. So to be able to query outside of a dispatch will require use
to expose devices somehow.
I could imagine a helper (OpenCLHelper class) which we could use to query
devices, capabilities and parameters. This could even return a notion of
a device which we could use during execution time to override our current
notion of mode.
So something like
Device d = null
for (Device possibleDevice: OpenCLHelper.getDevices()){
if (possibleDevice.isGPU() && possibleDevice.getSomeParameter()>someCriteria){
d = possibleDevice;
break;
}
}
Kernel.setDevice(d);
Range range = Range.create(global, /* some local groups size value based on
device characteristics */);
kernel.execute(range);
Alternatively I think jocl has the notion of getBestDevice(), which I like a
lot.
So
Device d = OpenCLHelper.getBestDevice();
Kernel.setDevice(d);
Range range = Range.create(global, /* some local groups size value based on
device characteristics */);
kernel.execute(range);
So if we set a Device it overrides any mode (what should fallback do?)
This might also allow us to construct 'pseudo devices' to span physical
devices. So group all GPU devices into device entity so we can dispatch across
devices.
>But this will require some more thought/work ;)
Original comment by frost.g...@gmail.com
on 14 Feb 2012 at 9:34
Those are very good suggestions and definitely seems to lead down the road to
multi-GPU development.
After discussing this idea more, we could even use this list of devices concept
to investigate more complicated patterns, such as deciding if an application
should use one card for OpenCL and another card for OpenGL (to try and maximize
both cards).
Original comment by ryan.lam...@gmail.com
on 14 Feb 2012 at 10:27
Original issue reported on code.google.com by
ryan.lam...@gmail.com
on 14 Feb 2012 at 8:50