From 8285173fa9c69de72020962506eb080a49be0ce5 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Mon, 4 Nov 2019 23:50:41 +0100 Subject: Adapt to upstream changes --- lid_driven_cavity/opencl/ldc_2d.py | 13 +++++++------ lid_driven_cavity/opencl/simulation.py | 6 +++--- 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'lid_driven_cavity/opencl') diff --git a/lid_driven_cavity/opencl/ldc_2d.py b/lid_driven_cavity/opencl/ldc_2d.py index 755ace0..c080284 100644 --- a/lid_driven_cavity/opencl/ldc_2d.py +++ b/lid_driven_cavity/opencl/ldc_2d.py @@ -48,18 +48,19 @@ generator = Generator( kernel_src = generator.kernel(geometry, functions, extras) kernel_src += generator.custom(geometry, """ -__kernel void equilibrilize(__global ${float_type}* f_next, - __global ${float_type}* f_prev) +__kernel void equilibrilize_all(__global ${float_type}* f_next, + __global ${float_type}* f_prev) { const unsigned int gid = ${index.gid('get_global_id(0)', 'get_global_id(1)')}; - equilibrilize_gid(f_next, f_prev, gid); + equilibrilize(f_next, f_prev, gid); + equilibrilize(f_prev, f_next, gid); } -__kernel void collect_moments(__global ${float_type}* f, - __global ${float_type}* moments) +__kernel void collect_moments_all(__global ${float_type}* f, + __global ${float_type}* moments) { const unsigned int gid = ${index.gid('get_global_id(0)', 'get_global_id(1)')}; - collect_moments_gid(f, moments, gid); + collect_moments(f, gid, moments); } """) diff --git a/lid_driven_cavity/opencl/simulation.py b/lid_driven_cavity/opencl/simulation.py index 7625609..37aab5b 100644 --- a/lid_driven_cavity/opencl/simulation.py +++ b/lid_driven_cavity/opencl/simulation.py @@ -66,7 +66,7 @@ class Lattice: self.build_kernel(kernel_src) - self.program.equilibrilize( + self.program.equilibrilize_all( self.queue, self.geometry.size(), self.layout, self.memory.cl_pop_a, self.memory.cl_pop_b).wait() self.tasks = [] @@ -94,10 +94,10 @@ class Lattice: moments = numpy.ndarray(shape=(self.memory.volume*(self.descriptor.d+1),1), dtype=self.float_type[0]) if self.tick: - self.program.collect_moments( + self.program.collect_moments_all( self.queue, self.geometry.size(), self.layout, self.memory.cl_pop_b, self.memory.cl_moments) else: - self.program.collect_moments( + self.program.collect_moments_all( self.queue, self.geometry.size(), self.layout, self.memory.cl_pop_a, self.memory.cl_moments) cl.enqueue_copy(self.queue, moments, self.memory.cl_moments).wait(); -- cgit v1.2.3