diff options
author | Stan Seibert <stan@mtrr.org> | 2011-08-08 10:52:53 -0400 |
---|---|---|
committer | Stan Seibert <stan@mtrr.org> | 2011-08-08 10:52:53 -0400 |
commit | 7225ca7f013d770286c470fa71a3038969ef63d5 (patch) | |
tree | 5acf98f9047209246a6b2bcd20655a519baf31a4 | |
parent | 3a8a4c4dd095ff25a1dbe70e387e166f43a5644b (diff) | |
download | chroma-7225ca7f013d770286c470fa71a3038969ef63d5.tar.gz chroma-7225ca7f013d770286c470fa71a3038969ef63d5.tar.bz2 chroma-7225ca7f013d770286c470fa71a3038969ef63d5.zip |
Bug fixes when retrieving and rerunning photon lists through propagate.
-rw-r--r-- | gpu.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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(), |