inducer / pyopencl

OpenCL integration for Python, plus shiny features
http://mathema.tician.de/software/pyopencl
Other
1.04k stars 237 forks source link

Maximum number of events in an array #317

Open tverho opened 4 years ago

tverho commented 4 years ago

Currently the add_event() method in cl.array has a hard coded limit of 12 for the number of queued events. I think it would be better if this was a configurable property. I'm trying to use gpyfft while using the build-in event management in cl.array. However, gpyfft has a hard-coded limit DEF MAX_WAITFOR_EVENTS = 10 which is lower than in add_event() (and leads to an assertion error), basically forcing me to periodically call cl.array.finish() which is nonideal. I would like to be able to do

arr.set_max_events(10)
inducer commented 4 years ago

I sympathize with this. Do you think this should be a global or per-array setting?

tverho commented 4 years ago

Good point, maybe global. At least I cannot easily imagine a case where one would need to control it on a per array basis. Ultimately, I think it can be either way, it probably wouldn't be too cumbersome to set it for each array either, at least not in my case (I have only 2 arrays that are passed to gpyfft).