def test_wiener(self, num_samps): cpu_sig = np.random.rand(num_samps) gpu_sig = cp.asarray(cpu_sig) cpu_wfilt = signal.wiener(cpu_sig) gpu_wfilt = cp.asnumpy(cusignal.wiener(gpu_sig)) assert array_equal(cpu_wfilt, gpu_wfilt)
def gpu_version(self, sig): with cp.cuda.Stream.null: out = cusignal.wiener(sig) cp.cuda.Stream.null.synchronize() return out