aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-09-05 21:10:13 +0200
committerAdrian Kummerlaender2019-09-05 21:10:13 +0200
commit703810267472cd4e4e936e37d36250dd6c7ad8ca (patch)
treec4f755ba89b5329456b03e28dc7c22fc2fe6c8fb
parent4974c2ccc7f640d6a657c22cc1a3dfa9d114b8f0 (diff)
downloadsymlbm_playground-703810267472cd4e4e936e37d36250dd6c7ad8ca.tar
symlbm_playground-703810267472cd4e4e936e37d36250dd6c7ad8ca.tar.gz
symlbm_playground-703810267472cd4e4e936e37d36250dd6c7ad8ca.tar.bz2
symlbm_playground-703810267472cd4e4e936e37d36250dd6c7ad8ca.tar.lz
symlbm_playground-703810267472cd4e4e936e37d36250dd6c7ad8ca.tar.xz
symlbm_playground-703810267472cd4e4e936e37d36250dd6c7ad8ca.tar.zst
symlbm_playground-703810267472cd4e4e936e37d36250dd6c7ad8ca.zip
Try out deferred particle streaming
i.e. apply direct Euler multiple times for each moment collection
-rw-r--r--channel_2d_gl_interop.py4
-rw-r--r--simulation.py9
2 files changed, 5 insertions, 8 deletions
diff --git a/channel_2d_gl_interop.py b/channel_2d_gl_interop.py
index 69af67b..a47d6c0 100644
--- a/channel_2d_gl_interop.py
+++ b/channel_2d_gl_interop.py
@@ -180,6 +180,10 @@ particles = Particles(
def on_display():
for i in range(0,updates_per_frame):
lattice.evolve()
+
+ lattice.collect_gl_moments()
+
+ for i in range(0,updates_per_frame):
lattice.update_gl_particles(particles)
lattice.sync()
diff --git a/simulation.py b/simulation.py
index b9df3f0..f8ce4eb 100644
--- a/simulation.py
+++ b/simulation.py
@@ -235,14 +235,7 @@ class Lattice:
self.queue, self.grid.size(), self.layout, self.memory.cl_pop_a, self.memory.cl_material, self.memory.cl_gl_moments)
def update_gl_particles(self, particles):
- cl.enqueue_acquire_gl_objects(self.queue, [self.memory.cl_gl_moments, particles.cl_gl_particles])
-
- if self.tick:
- self.program.collect_gl_moments(
- self.queue, self.grid.size(), self.layout, self.memory.cl_pop_b, self.memory.cl_material, self.memory.cl_gl_moments)
- else:
- self.program.collect_gl_moments(
- self.queue, self.grid.size(), self.layout, self.memory.cl_pop_a, self.memory.cl_material, self.memory.cl_gl_moments)
+ cl.enqueue_acquire_gl_objects(self.queue, [particles.cl_gl_particles])
self.program.update_particles(
self.queue, (particles.count,1), None, self.memory.cl_gl_moments, self.memory.cl_material, particles.cl_gl_particles)