aboutsummaryrefslogtreecommitdiff
path: root/lid_driven_cavity/opencl_gl_interop/AA.py
blob: 1322856abc2a72b17e3080ed99818362c6cc352a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import pyopencl as cl

from common import MomentsTextureBase

from lattice.AA import Lattice

class MomentsTexture(MomentsTextureBase):
    pass

    def collect(self):
        cl.enqueue_acquire_gl_objects(self.lattice.queue, [self.cl_gl_moments])

        if self.lattice.tick:
            self.lattice.program.collect_moments_to_texture_tick(
                self.lattice.queue,
                self.lattice.geometry.size(),
                self.lattice.layout,
                self.lattice.memory.cl_pop,
                self.cl_gl_moments)
        else:
            self.lattice.program.collect_moments_to_texture_tock(
                self.lattice.queue,
                self.lattice.geometry.size(),
                self.lattice.layout,
                self.lattice.memory.cl_pop,
                self.cl_gl_moments)