From 7225ca7f013d770286c470fa71a3038969ef63d5 Mon Sep 17 00:00:00 2001 From: Stan Seibert Date: Mon, 8 Aug 2011 10:52:53 -0400 Subject: Bug fixes when retrieving and rerunning photon lists through propagate. --- gpu.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gpu.py') diff --git a/gpu.py b/gpu.py index e5040a8..0c20006 100644 --- a/gpu.py +++ b/gpu.py @@ -201,12 +201,12 @@ class GPU(object): self.wavelengths_gpu = gpuarray.to_gpu(wavelength.astype(np.float32)) self.times_gpu = gpuarray.to_gpu(t0.astype(np.float32)) - if histories: + if histories is not None: self.histories_gpu = gpuarray.to_gpu(histories.astype(np.uint32)) else: self.histories_gpu = gpuarray.zeros(self.nphotons, dtype=np.uint32) - if last_hit_triangles: + if last_hit_triangles is not None: self.last_hit_triangles_gpu = gpuarray.to_gpu(last_hit_triangles.astype(np.int32)) else: self.last_hit_triangles_gpu = gpuarray.empty(self.nphotons, dtype=np.int32) @@ -237,7 +237,7 @@ class GPU(object): ''' return { 'pos' : self.positions_gpu.get().view(np.float32).reshape(self.positions_gpu.size, 3), 'dir' : self.directions_gpu.get().view(np.float32).reshape(self.directions_gpu.size, 3), - 'pol' : self.polarizations_gpu.get().view(np.float32).reshape(self.polarization_gpu.size, 3), + 'pol' : self.polarizations_gpu.get().view(np.float32).reshape(self.polarizations_gpu.size, 3), 'wavelength' : self.wavelengths_gpu.get(), 't0' : self.times_gpu.get(), 'histories' : self.histories_gpu.get(), -- cgit