Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
isuruf committed Jun 12, 2022
1 parent 93169fa commit 312751f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyvkfft/test/test_fft.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,21 +435,21 @@ def test_pyopencl_queues(self):

with cl.CommandQueue(ctx) as cq:
for i in range(n_queues):
vd.append(cla.to_device(cq, np.roll(d, i * 7, axis=1)))
vd.append(cla.to_device(cq, np.roll(d, i * 7, axis=1)).with_queue(None))
vapp.append(clVkFFTApp(d.shape, d.dtype, ndim=2, norm=1, queue=cq))

queues = [cl.CommandQueue(ctx) for _ in range(n_queues)]
for i in range(n_queues):
vapp[i].fft(vd[i], queue=queues[i])
for i in range(n_queues):
dn = fftn(np.roll(d, i * 7, axis=1))
self.assertTrue(np.allclose(dn, vd[i].get(), rtol=rtol, atol=abs(dn).max() * rtol))
self.assertTrue(np.allclose(dn, vd[i].get(queues[i]), rtol=rtol, atol=abs(dn).max() * rtol))

for i in range(n_queues):
vapp[i].ifft(vd[i], queue=queues[i])
for i in range(n_queues):
dn = np.roll(d, i * 7, axis=1)
self.assertTrue(np.allclose(dn, vd[i].get(), rtol=rtol, atol=abs(dn).max() * rtol))
self.assertTrue(np.allclose(dn, vd[i].get(queues[i]), rtol=rtol, atol=abs(dn).max() * rtol))


# The class parameters are written in pyvkfft_test.main()
Expand Down

0 comments on commit 312751f

Please sign in to comment.