aboutsummaryrefslogtreecommitdiff
path: root/simulation.py
diff options
context:
space:
mode:
authorAdrian Kummerlaender2020-06-19 21:30:34 +0200
committerAdrian Kummerlaender2020-06-19 21:30:34 +0200
commit621dec0f2b7a982c958cce4d7baa4ccd3994606a (patch)
tree70d5e43ee78e118594c61986fa6980e893dc229e /simulation.py
parentbe7de4a18bdfd89fbd1fdc852d170f68cdc65ba4 (diff)
downloadsymlbm_playground-621dec0f2b7a982c958cce4d7baa4ccd3994606a.tar
symlbm_playground-621dec0f2b7a982c958cce4d7baa4ccd3994606a.tar.gz
symlbm_playground-621dec0f2b7a982c958cce4d7baa4ccd3994606a.tar.bz2
symlbm_playground-621dec0f2b7a982c958cce4d7baa4ccd3994606a.tar.lz
symlbm_playground-621dec0f2b7a982c958cce4d7baa4ccd3994606a.tar.xz
symlbm_playground-621dec0f2b7a982c958cce4d7baa4ccd3994606a.tar.zst
symlbm_playground-621dec0f2b7a982c958cce4d7baa4ccd3994606a.zip
Use OpenCL buffer to access moments in streamline impl
Diffstat (limited to 'simulation.py')
-rw-r--r--simulation.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/simulation.py b/simulation.py
index 5ebe9f6..e2174ee 100644
--- a/simulation.py
+++ b/simulation.py
@@ -261,9 +261,7 @@ class Lattice:
def sync(self):
self.queue.finish()
- def get_moments(self):
- moments = numpy.ndarray(shape=(self.descriptor.d+1, self.memory.volume), dtype=self.float_type[0])
-
+ def update_moments(self):
if self.tick:
self.program.collect_moments(
self.queue, self.grid.size(), self.layout, self.memory.cl_pop_b, self.memory.cl_moments)
@@ -271,6 +269,8 @@ class Lattice:
self.program.collect_moments(
self.queue, self.grid.size(), self.layout, self.memory.cl_pop_a, self.memory.cl_moments)
+ def get_moments(self):
+ moments = numpy.ndarray(shape=(self.descriptor.d+1, self.memory.volume), dtype=self.float_type[0])
+ self.update_moments()
cl.enqueue_copy(self.queue, moments, self.memory.cl_moments).wait();
-
return moments