def test_gpu(self): # just makes sure that CPU and GPU match if not GPU: raise SkipTest gpu_I = _gpuscatter.simulate(self.num_molecules, self.q_grid, self.xyzlist, self.atomic_numbers, rfloats=self.rfloats) cpu_I = _cpuscatter.simulate(self.num_molecules, self.q_grid, self.xyzlist, self.atomic_numbers, rfloats=self.rfloats)
def test_gpu_scatter(self): if not GPU: raise SkipTest gpu_I = _gpuscatter.simulate(self.num_molecules, self.q_grid, self.xyzlist, self.atomic_numbers, rfloats=self.rfloats) print "GPU", gpu_I print "REF", self.ref_I assert_allclose(gpu_I, self.ref_I, rtol=1e-03, err_msg='scatter: gpu/cpu reference mismatch') assert not np.all( gpu_I == 0.0 ) assert not np.sum( gpu_I == np.nan )