Conversation
|
@inducer I added a loopy kernel fallback for eager (code), and it's working when the array being multiplied is 1D, but I'm running into some trouble with array strides for higher dimensions. I set up the input array like this: u1 = actx.np.where(actx.np.less_equal(x, (a+b)/2), 0*x + 1, 0*x)
u2 = actx.np.where(actx.np.greater_equal(x, (a+b)/2), 0*x + 1, 0*x)
# u = actx.freeze_thaw(u1) # 1D
u = actx.freeze_thaw(actx.np.stack([u1, u2]).T) # 2DThe strides are no longer C-like after transposing. Lazy doesn't seem to care about this, but eager doesn't like it; it makes my 1D diffusion solver blow up instantly. If I add Edit: I guess the strides of |
|
FWIW, using a dense matrix + |
|
Upon closer inspection, it looks like the kernels may actually be OK. The problem occurs later in the test driver, when I do this: u = actx.freeze_thaw(u + dt*compiled_rhs(t, u))(here |
|
I added some limited support for applying sparse matrices to array containers. Currently it's restricted to the cases of
@inducer I think this is ready for a first look. I still have some FIXMEs scattered throughout the changes for things I could use some input on. |
Adds a generic interface for operations involving sparse CSR matrices.
cc @lukeolson