diff options
-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(), |