Use arraycontext instead of pyopencl - #128
Conversation
9706e35 to
2271297
Compare
What do you mean? CI seems to be passing... |
Ah, I meant from working seamlessly with that |
It should be possible to replace at least that with fancy indexing. |
I actually went the other way and left everything in |
b47246a to
b0a13f1
Compare
| lists=targets_sorted_by_center).with_queue(None) | ||
|
|
||
| return result | ||
| actx.queue.finish() |
There was a problem hiding this comment.
This seems to be introducing some synchronization issues. Most of the functions in QBXFMMGeometryData were creating their own queues to precompute data and this PR switched them to using the array context from the constructor and freezing the results.
Not sure why that would cause issues (it doesn't seem like anything is returned thawed), but it does 😖
There was a problem hiding this comment.
After some playing around with this: it was only causing failures when using fmmlib where it was using a
with cl.CommandQueue() as queue:
geo_data = ToHostTransferredGeoDataWrapper(queue, geo_data)
Switching that to using the array context inside geo_data seems to fix any failures. It still seems like something is a bit brittle though :(
2e7a4a8 to
a12f013
Compare
|
This was kind of painful to review, but I finally made it through. LGTM, thanks for working on it! |
Sorry about that! Hopefully it will save some future pain with the array contexts :( |
Inspired by inducer/arraycontext#111, this tried to remove some of the direct usage of
pyopencl. It's still a far shot from actually working withTaggedCLArraytransparently, but it's a start! This mostly removes uses ofcl.arrayparts which are inarraycontextary.with_queue(queue)withactx.thaworactx.freezeary.get()withactx.from_numpyA few obvious places where
pyopenclis still used:cl.wait_for_events; not sure how necessary this is?pyopencl.algoritm:copy_ifpyopencl.array:take.ElementwiseKernel,GenericScanKernelThe main roadblock however seems to be that all the
sumpycalls return barecl.array.Arrayand generally don't know anything about array contexts.