From 9cf82f641b8982df526107b99d883545ee02fe20 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Wed, 12 Jun 2019 21:01:42 +0200 Subject: Restructuring --- D2Q9.py | 78 +++ codegen_lbm.py | 132 ---- implosion.py | 242 +------ inspect_opencl_layout.ipynb | 612 ------------------ lbm_codegen.ipynb | 828 ------------------------ lbm_codegen_d3q19.ipynb | 1160 ---------------------------------- lbm_d2q9.py | 37 -- notebook/inspect_opencl_layout.ipynb | 612 ++++++++++++++++++ notebook/lbm_codegen.ipynb | 828 ++++++++++++++++++++++++ notebook/lbm_codegen_d3q19.ipynb | 1160 ++++++++++++++++++++++++++++++++++ symbolic/D2Q9.py | 37 ++ 11 files changed, 2750 insertions(+), 2976 deletions(-) create mode 100644 D2Q9.py delete mode 100644 codegen_lbm.py delete mode 100644 inspect_opencl_layout.ipynb delete mode 100644 lbm_codegen.ipynb delete mode 100644 lbm_codegen_d3q19.ipynb delete mode 100644 lbm_d2q9.py create mode 100644 notebook/inspect_opencl_layout.ipynb create mode 100644 notebook/lbm_codegen.ipynb create mode 100644 notebook/lbm_codegen_d3q19.ipynb create mode 100644 symbolic/D2Q9.py diff --git a/D2Q9.py b/D2Q9.py new file mode 100644 index 0000000..173f1b7 --- /dev/null +++ b/D2Q9.py @@ -0,0 +1,78 @@ +import pyopencl as cl +mf = cl.mem_flags + +import numpy + +import sympy +import symbolic.D2Q9 as D2Q9 + +from mako.template import Template + +class Lattice: + def idx(self, x, y): + return y * self.nX + x; + + def __init__(self, nX, nY, tau, geometry): + self.nX = nX + self.nY = nY + self.nCells = nX * nY + self.tau = tau + self.tick = True + + self.platform = cl.get_platforms()[0] + self.context = cl.Context(properties=[(cl.context_properties.PLATFORM, self.platform)]) + self.queue = cl.CommandQueue(self.context) + + self.np_material = numpy.ndarray(shape=(self.nCells, 1), dtype=numpy.int32) + self.setup_geometry(geometry) + + self.cl_pop_a = cl.Buffer(self.context, mf.READ_WRITE, size=9*self.nCells*numpy.float32(0).nbytes) + self.cl_pop_b = cl.Buffer(self.context, mf.READ_WRITE, size=9*self.nCells*numpy.float32(0).nbytes) + + self.cl_moments = cl.Buffer(self.context, mf.WRITE_ONLY, size=3*self.nCells*numpy.float32(0).nbytes) + self.cl_material = cl.Buffer(self.context, mf.READ_ONLY | mf.USE_HOST_PTR, hostbuf=self.np_material) + + self.build_kernel() + + self.program.equilibrilize(self.queue, (self.nX,self.nY), (32,1), self.cl_pop_a, self.cl_pop_b).wait() + + def setup_geometry(self, geometry): + for y in range(1,self.nY-1): + for x in range(1,self.nX-1): + self.np_material[self.idx(x,y)] = geometry(self.nX,self.nY,x,y) + + def build_kernel(self): + program_src = Template(filename = './template/kernel.mako').render( + nX = self.nX, + nY = self.nY, + nCells = self.nCells, + tau = self.tau, + moments_helper = D2Q9.moments_opt[0], + moments_assignment = D2Q9.moments_opt[1], + collide_helper = D2Q9.collide_opt[0], + collide_assignment = D2Q9.collide_opt[1], + c = D2Q9.c, + w = D2Q9.w, + ccode = sympy.ccode + ) + self.program = cl.Program(self.context, program_src).build() + + def evolve(self): + if self.tick: + self.tick = False + self.program.collide_and_stream(self.queue, (self.nX,self.nY), (32,1), self.cl_pop_a, self.cl_pop_b, self.cl_material) + else: + self.tick = True + self.program.collide_and_stream(self.queue, (self.nX,self.nY), (32,1), self.cl_pop_b, self.cl_pop_a, self.cl_material) + + def sync(self): + self.queue.finish() + + def get_moments(self): + moments = numpy.ndarray(shape=(3, self.nCells), dtype=numpy.float32) + if self.tick: + self.program.collect_moments(self.queue, (self.nX,self.nY), (32,1), self.cl_pop_b, self.cl_moments) + else: + self.program.collect_moments(self.queue, (self.nX,self.nY), (32,1), self.cl_pop_a, self.cl_moments) + cl.enqueue_copy(self.queue, moments, self.cl_moments).wait(); + return moments diff --git a/codegen_lbm.py b/codegen_lbm.py deleted file mode 100644 index a71fc15..0000000 --- a/codegen_lbm.py +++ /dev/null @@ -1,132 +0,0 @@ -import pyopencl as cl -mf = cl.mem_flags - -import numpy -import time - -import matplotlib -import matplotlib.pyplot as plt -matplotlib.use('AGG') - -import sympy -import lbm_d2q9 as D2Q9 - -from mako.template import Template - -class D2Q9_BGK_Lattice: - def idx(self, x, y): - return y * self.nX + x; - - def __init__(self, nX, nY, tau, geometry): - self.nX = nX - self.nY = nY - self.nCells = nX * nY - self.tau = tau - self.tick = True - - self.platform = cl.get_platforms()[0] - self.context = cl.Context(properties=[(cl.context_properties.PLATFORM, self.platform)]) - self.queue = cl.CommandQueue(self.context) - - self.np_material = numpy.ndarray(shape=(self.nCells, 1), dtype=numpy.int32) - self.setup_geometry(geometry) - - self.cl_pop_a = cl.Buffer(self.context, mf.READ_WRITE, size=9*self.nCells*numpy.float32(0).nbytes) - self.cl_pop_b = cl.Buffer(self.context, mf.READ_WRITE, size=9*self.nCells*numpy.float32(0).nbytes) - - self.cl_moments = cl.Buffer(self.context, mf.WRITE_ONLY, size=3*self.nCells*numpy.float32(0).nbytes) - self.cl_material = cl.Buffer(self.context, mf.READ_ONLY | mf.USE_HOST_PTR, hostbuf=self.np_material) - - self.build_kernel() - - self.program.equilibrilize(self.queue, (self.nX,self.nY), (32,1), self.cl_pop_a, self.cl_pop_b).wait() - - def setup_geometry(self, geometry): - for y in range(1,self.nY-1): - for x in range(1,self.nX-1): - self.np_material[self.idx(x,y)] = geometry(self.nX,self.nY,x,y) - - def build_kernel(self): - program_src = Template(filename = './template/kernel.mako').render( - nX = self.nX, - nY = self.nY, - nCells = self.nCells, - tau = self.tau, - moments_helper = D2Q9.moments_opt[0], - moments_assignment = D2Q9.moments_opt[1], - collide_helper = D2Q9.collide_opt[0], - collide_assignment = D2Q9.collide_opt[1], - c = D2Q9.c, - w = D2Q9.w, - ccode = sympy.ccode - ) - self.program = cl.Program(self.context, program_src).build() - - def evolve(self): - if self.tick: - self.tick = False - self.program.collide_and_stream(self.queue, (self.nX,self.nY), (32,1), self.cl_pop_a, self.cl_pop_b, self.cl_material) - else: - self.tick = True - self.program.collide_and_stream(self.queue, (self.nX,self.nY), (32,1), self.cl_pop_b, self.cl_pop_a, self.cl_material) - - def sync(self): - self.queue.finish() - - def get_moments(self): - moments = numpy.ndarray(shape=(3, self.nCells), dtype=numpy.float32) - if self.tick: - self.program.collect_moments(self.queue, (self.nX,self.nY), (32,1), self.cl_pop_b, self.cl_moments) - else: - self.program.collect_moments(self.queue, (self.nX,self.nY), (32,1), self.cl_pop_a, self.cl_moments) - cl.enqueue_copy(LBM.queue, moments, LBM.cl_moments).wait(); - return moments - - -def MLUPS(cells, steps, time): - return cells * steps / time * 1e-6 - -def generate_moment_plots(lattice, moments): - for i, m in enumerate(moments): - print("Generating plot %d of %d." % (i+1, len(moments))) - - density = numpy.ndarray(shape=(lattice.nY-2, lattice.nX-2)) - for y in range(1,lattice.nY-1): - for x in range(1,lattice.nX-1): - density[y-1,x-1] = m[0,lattice.idx(x,y)] - - plt.figure(figsize=(10, 10)) - plt.imshow(density, origin='lower', vmin=0.2, vmax=2.0, cmap=plt.get_cmap('seismic')) - plt.savefig("result/density_" + str(i) + ".png", bbox_inches='tight', pad_inches=0) - -def box(nX, nY, x, y): - if x == 1 or y == 1 or x == nX-2 or y == nY-2: - return 2 - else: - return 1 - -nUpdates = 1000 -nStat = 100 - -moments = [] - -print("Initializing simulation...\n") - -LBM = D2Q9_BGK_Lattice(nX = 1024, nY = 1024, tau = 0.8, geometry = box) - -print("Starting simulation using %d cells...\n" % LBM.nCells) - -lastStat = time.time() - -for i in range(1,nUpdates+1): - LBM.evolve() - - if i % nStat == 0: - LBM.sync() - print("i = %4d; %3.0f MLUPS" % (i, MLUPS(LBM.nCells, nStat, time.time() - lastStat))) - moments.append(LBM.get_moments()) - lastStat = time.time() - -print("\nConcluded simulation.\n") - -generate_moment_plots(LBM, moments) diff --git a/implosion.py b/implosion.py index c70f21a..75e9640 100644 --- a/implosion.py +++ b/implosion.py @@ -1,228 +1,56 @@ -import pyopencl as cl -mf = cl.mem_flags - -from string import Template - import numpy -import matplotlib.pyplot as plt - import time -kernel = """ -float constant w[9] = { - 1./36., 1./9., 1./36., - 1./9. , 4./9., 1./9. , - 1./36 , 1./9., 1./36. -}; - -unsigned int indexOfDirection(int i, int j) { - return (i+1) + 3*(1-j); -} - -unsigned int indexOfCell(int x, int y) -{ - return y * $nX + x; -} - -unsigned int idx(int x, int y, int i, int j) { - return indexOfDirection(i,j)*$nCells + indexOfCell(x,y); -} - -__global float f_i(__global __read_only float* f, int x, int y, int i, int j) { - return f[idx(x,y,i,j)]; -} - -float comp(int i, int j, float2 v) { - return i*v.x + j*v.y; -} - -float sq(float x) { - return x*x; -} - -float f_eq(float w, float d, float2 v, int i, int j, float dotv) { - return w * d * (1.f + 3.f*comp(i,j,v) + 4.5f*sq(comp(i,j,v)) - 1.5f*dotv); -} - -__kernel void collide_and_stream(__global __write_only float* f_a, - __global __read_only float* f_b, - __global __write_only float* moments, - __global __read_only int* material) -{ - const unsigned int gid = indexOfCell(get_global_id(0), get_global_id(1)); - - const uint2 cell = (uint2)(get_global_id(0), get_global_id(1)); - - const int m = material[gid]; - - if ( m == 0 ) { - return; - } - - float f0 = f_i(f_b, cell.x+1, cell.y-1, -1, 1); - float f1 = f_i(f_b, cell.x , cell.y-1, 0, 1); - float f2 = f_i(f_b, cell.x-1, cell.y-1, 1, 1); - float f3 = f_i(f_b, cell.x+1, cell.y , -1, 0); - float f4 = f_i(f_b, cell.x , cell.y , 0, 0); - float f5 = f_i(f_b, cell.x-1, cell.y , 1, 0); - float f6 = f_i(f_b, cell.x+1, cell.y+1, -1,-1); - float f7 = f_i(f_b, cell.x , cell.y+1, 0,-1); - float f8 = f_i(f_b, cell.x-1, cell.y+1, 1,-1); - - const float d = f0 + f1 + f2 + f3 + f4 + f5 + f6 + f7 + f8; - - float2 v = (float2)( - (f5 - f3 + f2 - f6 + f8 - f0) / d, - (f1 - f7 + f2 - f6 - f8 + f0) / d - ); - - if ( m == 2 ) { - v = (float2)(0.0f, 0.0f); - } - - const float dotv = dot(v,v); - - f0 += $omega * (f_eq(w[0], d,v,-1, 1, dotv) - f0); - f1 += $omega * (f_eq(w[1], d,v, 0, 1, dotv) - f1); - f2 += $omega * (f_eq(w[2], d,v, 1, 1, dotv) - f2); - f3 += $omega * (f_eq(w[3], d,v,-1, 0, dotv) - f3); - f4 += $omega * (f_eq(w[4], d,v, 0, 0, dotv) - f4); - f5 += $omega * (f_eq(w[5], d,v, 1, 0, dotv) - f5); - f6 += $omega * (f_eq(w[6], d,v,-1,-1, dotv) - f6); - f7 += $omega * (f_eq(w[7], d,v, 0,-1, dotv) - f7); - f8 += $omega * (f_eq(w[8], d,v, 1,-1, dotv) - f8); - - f_a[0*$nCells + gid] = f0; - f_a[1*$nCells + gid] = f1; - f_a[2*$nCells + gid] = f2; - f_a[3*$nCells + gid] = f3; - f_a[4*$nCells + gid] = f4; - f_a[5*$nCells + gid] = f5; - f_a[6*$nCells + gid] = f6; - f_a[7*$nCells + gid] = f7; - f_a[8*$nCells + gid] = f8; - - moments[1*gid] = d; - moments[2*gid] = v.x; - moments[3*gid] = v.y; -}""" - -class D2Q9_BGK_Lattice: - def idx(self, x, y): - return y * self.nX + x; - - def __init__(self, nX, nY): - self.nX = nX - self.nY = nY - self.nCells = nX * nY - self.tick = True - - self.platform = cl.get_platforms()[0] - self.context = cl.Context(properties=[(cl.context_properties.PLATFORM, self.platform)]) - self.queue = cl.CommandQueue(self.context) - - self.np_pop_a = numpy.ndarray(shape=(9, self.nCells), dtype=numpy.float32) - self.np_pop_b = numpy.ndarray(shape=(9, self.nCells), dtype=numpy.float32) - - self.np_moments = numpy.ndarray(shape=(3, self.nCells), dtype=numpy.float32) - self.np_material = numpy.ndarray(shape=(self.nCells, 1), dtype=numpy.int32) - - self.setup_geometry() - - self.equilibrilize() - self.setup_anomaly() - - self.cl_pop_a = cl.Buffer(self.context, mf.READ_WRITE | mf.USE_HOST_PTR, hostbuf=self.np_pop_a) - self.cl_pop_b = cl.Buffer(self.context, mf.READ_WRITE | mf.USE_HOST_PTR, hostbuf=self.np_pop_b) - - self.cl_material = cl.Buffer(self.context, mf.READ_ONLY | mf.USE_HOST_PTR, hostbuf=self.np_material) - self.cl_moments = cl.Buffer(self.context, mf.READ_WRITE | mf.USE_HOST_PTR, hostbuf=self.np_moments) - - self.build_kernel() - - def setup_geometry(self): - self.np_material[:] = 0 - for x in range(1,self.nX-1): - for y in range(1,self.nY-1): - if x == 1 or y == 1 or x == self.nX-2 or y == self.nY-2: - self.np_material[self.idx(x,y)] = 2 - else: - self.np_material[self.idx(x,y)] = 1 - - def equilibrilize(self): - self.np_pop_a[(0,2,6,8),:] = 1./36. - self.np_pop_a[(1,3,5,7),:] = 1./9. - self.np_pop_a[4,:] = 4./9. - - self.np_pop_b[(0,2,6,8),:] = 1./36. - self.np_pop_b[(1,3,5,7),:] = 1./9. - self.np_pop_b[4,:] = 4./9. - - def setup_anomaly(self): - bubbles = [ [ self.nX//4, self.nY//4], - [ self.nX//4,self.nY-self.nY//4], - [self.nX-self.nX//4, self.nY//4], - [self.nX-self.nX//4,self.nY-self.nY//4] ] - - for x in range(0,self.nX-1): - for y in range(0,self.nY-1): - for [a,b] in bubbles: - if numpy.sqrt((x-a)*(x-a)+(y-b)*(y-b)) < self.nX//10: - self.np_pop_a[:,self.idx(x,y)] = 1./24. - self.np_pop_b[:,self.idx(x,y)] = 1./24. - - def build_kernel(self): - self.program = cl.Program(self.context, Template(kernel).substitute({ - 'nX' : self.nX, - 'nY' : self.nY, - 'nCells': self.nCells, - 'omega': 1.0/0.8 - })).build() #'-cl-single-precision-constant -cl-fast-relaxed-math') - - def evolve(self): - if self.tick: - self.tick = False - self.program.collide_and_stream(self.queue, (self.nX,self.nY), (64,1), self.cl_pop_a, self.cl_pop_b, self.cl_moments, self.cl_material) - else: - self.tick = True - self.program.collide_and_stream(self.queue, (self.nX,self.nY), (64,1), self.cl_pop_b, self.cl_pop_a, self.cl_moments, self.cl_material) - - def sync(self): - self.queue.finish() - - def show(self, i): - cl.enqueue_copy(LBM.queue, LBM.np_moments, LBM.cl_moments).wait(); - - density = numpy.ndarray(shape=(self.nX-2, self.nY-2)) - for y in range(1,self.nY-1): - for x in range(1,self.nX-1): - density[x-1,y-1] = self.np_moments[0,self.idx(x,y)] - - plt.imshow(density, vmin=0.2, vmax=2.0, cmap=plt.get_cmap("seismic")) - plt.savefig("result/density_" + str(i) + ".png") +import matplotlib +import matplotlib.pyplot as plt +matplotlib.use('AGG') +from D2Q9 import Lattice def MLUPS(cells, steps, time): return cells * steps / time * 1e-6 +def generate_moment_plots(lattice, moments): + for i, m in enumerate(moments): + print("Generating plot %d of %d." % (i+1, len(moments))) + + density = numpy.ndarray(shape=(lattice.nY-2, lattice.nX-2)) + for y in range(1,lattice.nY-1): + for x in range(1,lattice.nX-1): + density[y-1,x-1] = m[0,lattice.idx(x,y)] + + plt.figure(figsize=(10, 10)) + plt.imshow(density, origin='lower', vmin=0.2, vmax=2.0, cmap=plt.get_cmap('seismic')) + plt.savefig("result/density_" + str(i) + ".png", bbox_inches='tight', pad_inches=0) + +def box(nX, nY, x, y): + if x == 1 or y == 1 or x == nX-2 or y == nY-2: + return 2 + else: + return 1 + nUpdates = 1000 -nStat = 100 +nStat = 100 + +moments = [] print("Initializing simulation...\n") -LBM = D2Q9_BGK_Lattice(1024, 1024) +lattice = Lattice(nX = 1024, nY = 1024, tau = 0.8, geometry = box) -print("Starting simulation using %d cells...\n" % LBM.nCells) +print("Starting simulation using %d cells...\n" % lattice.nCells) lastStat = time.time() for i in range(1,nUpdates+1): + lattice.evolve() + if i % nStat == 0: - LBM.sync() - #LBM.show(i) - print("i = %4d; %3.0f MLUPS" % (i, MLUPS(LBM.nCells, nStat, time.time() - lastStat))) + lattice.sync() + print("i = %4d; %3.0f MLUPS" % (i, MLUPS(lattice.nCells, nStat, time.time() - lastStat))) + moments.append(lattice.get_moments()) lastStat = time.time() - LBM.evolve() +print("\nConcluded simulation.\n") -LBM.show(nUpdates) +generate_moment_plots(lattice, moments) diff --git a/inspect_opencl_layout.ipynb b/inspect_opencl_layout.ipynb deleted file mode 100644 index 521f93a..0000000 --- a/inspect_opencl_layout.ipynb +++ /dev/null @@ -1,612 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Thread layouting in OpenCL\n", - "## Setup PyOpenCL" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [], - "source": [ - "import pyopencl as cl\n", - "import numpy" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [], - "source": [ - "platform = cl.get_platforms()[0]\n", - "context = cl.Context(properties=[(cl.context_properties.PLATFORM, platform)])\n", - "queue = cl.CommandQueue(context)" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "" - ] - }, - "execution_count": 3, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "platform" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Initialize array for storing group and local IDs" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": {}, - "outputs": [], - "source": [ - "nX = 16\n", - "nY = 16" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": {}, - "outputs": [], - "source": [ - "np_data = numpy.ndarray(shape=(nX*nY, 4), dtype=numpy.int32)" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": {}, - "outputs": [], - "source": [ - "np_data[:,:] = 0" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([[0, 0, 0, 0],\n", - " [0, 0, 0, 0],\n", - " [0, 0, 0, 0],\n", - " ...,\n", - " [0, 0, 0, 0],\n", - " [0, 0, 0, 0],\n", - " [0, 0, 0, 0]], dtype=int32)" - ] - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "np_data" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "metadata": {}, - "outputs": [], - "source": [ - "cl_data = cl.Buffer(context, cl.mem_flags.READ_WRITE | cl.mem_flags.USE_HOST_PTR, hostbuf=np_data)" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "" - ] - }, - "execution_count": 9, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "cl_data" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Define OpenCL kernel\n", - "\n", - "Simply writes out group and local indices to the given data array." - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": {}, - "outputs": [], - "source": [ - "program = cl.Program(context, \"\"\"\n", - "__kernel void test(__global int* data)\n", - "{\n", - " const unsigned int gid = 4*(get_global_id(1)*get_global_size(1) + get_global_id(0));\n", - " data[gid + 0] = get_group_id(0);\n", - " data[gid + 1] = get_group_id(1);\n", - " data[gid + 2] = get_local_id(0);\n", - " data[gid + 3] = get_local_id(1);\n", - "}\"\"\").build()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Test output for a 1x1 work group size:" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([[ 0, 0, 0, 0],\n", - " [ 1, 0, 0, 0],\n", - " [ 2, 0, 0, 0],\n", - " ...,\n", - " [13, 15, 0, 0],\n", - " [14, 15, 0, 0],\n", - " [15, 15, 0, 0]], dtype=int32)" - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "program.test(queue, (nX,nY), (1,1), cl_data)\n", - "queue.finish()\n", - "cl.enqueue_copy(queue, np_data, cl_data).wait();\n", - "np_data" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Test various work group sizes" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "metadata": {}, - "outputs": [], - "source": [ - "def computeWorkgroup(i, j):\n", - " program.test(queue, (nX,nY), (i,j), cl_data)\n", - " queue.finish()\n", - " cl.enqueue_copy(queue, np_data, cl_data).wait();" - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([[0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3],\n", - " [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3],\n", - " [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3],\n", - " [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3],\n", - " [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3],\n", - " [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3],\n", - " [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3],\n", - " [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3],\n", - " [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3],\n", - " [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3],\n", - " [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3],\n", - " [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3],\n", - " [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3],\n", - " [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3],\n", - " [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3],\n", - " [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3]], dtype=int32)" - ] - }, - "execution_count": 13, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "computeWorkgroup(4,4)\n", - "np_data.reshape((nX, nY, 4))[:,:,0] # x-index of work group" - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n", - " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n", - " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n", - " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n", - " [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],\n", - " [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],\n", - " [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],\n", - " [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],\n", - " [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2],\n", - " [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2],\n", - " [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2],\n", - " [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2],\n", - " [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3],\n", - " [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3],\n", - " [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3],\n", - " [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]], dtype=int32)" - ] - }, - "execution_count": 14, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "np_data.reshape((nX, nY, 4))[:,:,1] # y-index of work group" - ] - }, - { - "cell_type": "code", - "execution_count": 15, - "metadata": {}, - "outputs": [], - "source": [ - "computeWorkgroup(8,2)" - ] - }, - { - "cell_type": "code", - "execution_count": 16, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([[0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],\n", - " [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],\n", - " [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],\n", - " [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],\n", - " [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],\n", - " [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],\n", - " [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],\n", - " [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],\n", - " [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],\n", - " [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],\n", - " [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],\n", - " [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],\n", - " [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],\n", - " [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],\n", - " [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],\n", - " [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1]], dtype=int32)" - ] - }, - "execution_count": 16, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "np_data.reshape((nX, nY, 4))[:,:,0]" - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n", - " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n", - " [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],\n", - " [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],\n", - " [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2],\n", - " [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2],\n", - " [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3],\n", - " [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3],\n", - " [4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4],\n", - " [4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4],\n", - " [5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5],\n", - " [5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5],\n", - " [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6],\n", - " [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6],\n", - " [7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7],\n", - " [7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7]], dtype=int32)" - ] - }, - "execution_count": 17, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "np_data.reshape((nX, nY, 4))[:,:,1]" - ] - }, - { - "cell_type": "code", - "execution_count": 18, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([[0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7],\n", - " [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7],\n", - " [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7],\n", - " [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7],\n", - " [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7],\n", - " [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7],\n", - " [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7],\n", - " [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7],\n", - " [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7],\n", - " [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7],\n", - " [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7],\n", - " [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7],\n", - " [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7],\n", - " [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7],\n", - " [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7],\n", - " [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7]], dtype=int32)" - ] - }, - "execution_count": 18, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "np_data.reshape((nX, nY, 4))[:,:,2]" - ] - }, - { - "cell_type": "code", - "execution_count": 19, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n", - " [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],\n", - " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n", - " [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],\n", - " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n", - " [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],\n", - " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n", - " [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],\n", - " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n", - " [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],\n", - " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n", - " [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],\n", - " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n", - " [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],\n", - " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n", - " [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]], dtype=int32)" - ] - }, - "execution_count": 19, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "np_data.reshape((nX, nY, 4))[:,:,3]" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Generate some visuals" - ] - }, - { - "cell_type": "code", - "execution_count": 20, - "metadata": {}, - "outputs": [], - "source": [ - "import matplotlib.pyplot as plt" - ] - }, - { - "cell_type": "code", - "execution_count": 21, - "metadata": {}, - "outputs": [], - "source": [ - "def plotWorkgroupConfig(i,j):\n", - " computeWorkgroup(i,j)\n", - " data = np_data.reshape((nX, nY, 4))\n", - " for k in range(0,4):\n", - " plt.subplot(1,4,k+1)\n", - " plt.imshow(np_data.reshape((nX, nY, 4))[:,:,k])" - ] - }, - { - "cell_type": "code", - "execution_count": 22, - "metadata": {}, - "outputs": [ - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAABrCAYAAABnlHmpAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAACAxJREFUeJzt3U1oXNcZxvHn1YwlTZPKkj+jJnGahbNI7EKKiAktbSAtuN04m5Y4Gy0MLoFsuigVdBG6ateF0tYLY0NJQmkLcamhTQRNCi3GLoU2KSRWHCdWrVpRrUBiog9bbxeaiPlSR5q59545Z/4/CHfOyVHum0fXrw73zljm7gIAxG8gdAEAgGzQ0AEgETR0AEgEDR0AEkFDB4BE0NABIBE0dABIBA0dABLRVUM3s6Nm9paZzZjZVFZFYR355ods80O24VinnxQ1s5KktyV9XdKspIuSjrv7vzb7mkEb8mHdVf/f2VGuX1RuGEtaK9f/3PGyNa8pqWFN8/m9cU2pxf97i7lyea1uPDhwu2nNcKl+rjKw0rSmYqsN4+afp3/7x/KCu+/dbr6tskW9j7TYUbYS+bazpFta8WUj23x8eu22W9ei7W3ZY5Jm3P2KJJnZS5KOSdr0Gzesu3TEnqwvYM/+uvHavrGmr1vZU//NXtrdXPbSWH1zXB5rbvoro/XNenX0TtOa8s7mRrx79OO68YGRxaY1D909Xzc+VJltWnN46Hrd+JHBStOa0vjMe9WX28q3Vbao96r/uqNsJfJt54JPf/qSb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": [ - "
" - ] - }, - "metadata": { - "needs_background": "light" - }, - "output_type": "display_data" - } - ], - "source": [ - "plotWorkgroupConfig(1,1)" - ] - }, - { - "cell_type": "code", - "execution_count": 23, - "metadata": {}, - "outputs": [ - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAABrCAYAAABnlHmpAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAB6NJREFUeJzt3U+IXeUZx/Hf00mMSWhL4vhn6p9WJIKiRcqQ4kYEkcRuRiiVRApZBETBTVcOdOHGRVYuBBFDCclGpbhJoAGxgdZFKWRKS0gLJqOJmakxcUz8A5V0Rh4Xcw03Jzfek3POe859n/v9QLj3nNx5z8NvXh4O58y5r7m7AAD5+0HXBQAAmkFDB4AgaOgAEAQNHQCCoKEDQBA0dAAIgoYOAEHQ0AEgiFoN3cy2m9n7ZjZvZrNNFYVV5JsO2aZDtt2xqk+KmtmEpBOSHpe0KOmopJ3u/p9r/cwNts5v1MZKx+u3Mll/DEmyTSuNjCNJ962/2Mg4/zh2acndb77efJvKNrKvdLFSttLgfIvzcNB8Ks6LE8c2XPWZVOMMGmvQPC2OVWWc0wvLWrrwjXXZFyL7bu4O+9yaGsfYKmne3T+UJDN7S9KMpGv+4m7URv3SHqtxyFVLv3649hiStPbJTxsZR5L+/tDbjYwzMTX/Ue/tdeXbVLaR/dnfrpStNDjf4jwcNJ+K82LbTx666jOpxhk01qB5Whyryjhbty1cfquO+kJkfXP3e9W55HK7pIW+7cXeviuY2TNmNmdmc8u6VONwY2dovmRbGXM3HbLtUJ2GbgP2XXX9xt33uvu0u0+v1boahxs7Q/Ml28qYu+mQbYfqNPRFSXf2bd8h6eN65aAP+aZDtumQbYfqXEM/KmmLmd0t6b+Sdkh6upGqIJFvSmSbznVnuzK5sbH7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UMHgCC4KQqgU6xYVELiFYsAACOGhg4AQdDQASAIrqED6BRfLDdc2S+W4wwdAIKgoQNAEDR0AAiChg4AQZi7t3cws08lfaTV1deXWjtwc9qo+6fufvP1/hDZllIpWyn7fMk2rZHJt9WGfvmgZnPuPt36gWvKoe4cahwkl7pzqbNfLjXnUmfRKNXNJRcACIKGDgBBdNXQ93Z03LpyqDuHGgfJpe5c6uyXS8251Fk0MnV3cg0dANA8LrkAQBCtN3Qz225m75vZvJnNtn38Msxsn5mdN7Pjffs2m9m7Znay97qpyxoHySFbKc98yTatHPLNIdtWG7qZTUh6VdITku6XtNPM7m+zhpL2S9pe2Dcr6Yi7b5F0pLc9MjLKVsosX7JNK6N892vEs237DH2rpHl3/9Dd/y/pLUkzLdcwlLu/J+lCYfeMpAO99wckPdlqUcNlka2UZb5km1YW+eaQbdsN/XZJC33bi719ObjV3c9KUu/1lo7rKco5W2m08yXbtHLOd6Sybbuh24B9/JlNM8g2HbJNi3wb0nZDX5R0Z9/2HZI+brmGqs6Z2ZQk9V7Pd1xPUc7ZSqOdL9mmlXO+I5Vt2w39qKQtZna3md0gaYekQy3XUNUhSbt673dJOthhLYPknK002vmSbVo55zta2bp7q/8k/UrSCUkfSPp928cvWeObks5KWtbq2cNuSTdp9S72yd7r5q7rzDHbXPMlW/LNIVueFAWAIHhSFACCoKEDQBA0dAAIgoYOAEHQ0AEgCBo6AARBQweAIGjoABDEt1uHTloE0FJaAAAAAElFTkSuQmCC\n", - "text/plain": [ - "
" - ] - }, - "metadata": { - "needs_background": "light" - }, - "output_type": "display_data" - } - ], - "source": [ - "plotWorkgroupConfig(4,4)" - ] - }, - { - "cell_type": "code", - "execution_count": 24, - "metadata": {}, - "outputs": [ - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAABrCAYAAABnlHmpAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJ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lzl6xZI4lZ1Zjcge5hg4AKB+XXAAgEbUPdDM7YmYfmdmSmZ2u+/jDMLOzZnbbzD7s2TZpZu+a2dXu8vGQGfPE0K0UZ790W60Y+o2h21oHupm1JP1W0o8kzUo6bmazdWYY0jlJRzLbTku65O4HJF3qrjdGRN1KkfVLt9WKqN9zani3dZ+hH5K05O4fu/t/Jb0l6WjNGbbl7u9JupPZfFTS+e7j85J+Umuo7UXRrRRlv3RbrSj6jaHbugf605KWe9ZXutti8KS735Sk7vKJwHmyYu5Wana/dFutmPttVLd1D3TL2cbbbMpBt9Wh22rRb0nqHugrkp7tWX9G0o2aMxR1y8xmJKm7vB04T1bM3UrN7pduqxVzv43qtu6BviDpgJk9Z2aPSnpF0oWaMxR1QdLJ7uOTkt4OmCVPzN1Kze6XbqsVc7/N6tbda/0j6ceSrkj6h6Rf1X38ITO+KemmpDVtnj2ckjSlzbvYV7vLydA5Y+w21n7pln5j6JZPigJAIvikKAAkgoEOAIlgoANAIhjoAJAIBjoAJIKBDgCJYKADQCIY6ACQiP8BpLw4oSzcg78AAAAASUVORK5CYII=\n", - "text/plain": [ - "
" - ] - }, - "metadata": { - "needs_background": "light" - }, - "output_type": "display_data" - } - ], - "source": [ - "plotWorkgroupConfig(8,8)" - ] - }, - { - "cell_type": "code", - "execution_count": 25, - "metadata": {}, - "outputs": [ - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAABrCAYAAABnlHmpAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAACCdJREFUeJzt3V+IXGcZx/Hfk5nsn7bGbP6nf1NKiqxtqbqkCEULRRK9iRdaml4YSiAg9EYQDHpRBC+8FESEICG5aYvkphFTYxuxFRRJxKCt0GRtk+5202zXxKptk90kjxc7LnNmZp3ZM+ff+873A+HM++b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R9WdK4pD1mNl5kDT06LGlXy9wBSSfdfbukk41xZQSUrRRYvmSbr4DyPayKZ1v0FfoOSZPu/pa7z0t6QdLugmvoyt1fk3S5ZXq3pCON10ckfbXQoroLIlspyHzJNl9B5BtCtkU39DskTTWNpxtzIdjs7hclqbHdVHI9rULOVqp2vmSbr5DzrVS2RTd06zDH22yyQbb5Idt8kW9Gim7o05LuahrfKWmm4BrSumRmWyWpsZ0tuZ5WIWcrVTtfss1XyPlWKtuiG/opSdvN7F4zG5L0pKRjBdeQ1jFJexuv90p6scRaOgk5W6na+ZJtvkLOt1rZunuhvyR9RdJZSX+X9L2ij99jjc9LuihpQYtXD/skrdfiU+xzje26susMMdtQ8yVb8g0hW1aKAkAkWCkKAJGgoQNAJGjoABAJGjoARIKGDgCRoKEDQCRo6AAQCRo6AETiv+qQRIYl3vsZAAAAAElFTkSuQmCC\n", - "text/plain": [ - "
" - ] - }, - "metadata": { - "needs_background": "light" - }, - "output_type": "display_data" - } - ], - "source": [ - "plotWorkgroupConfig(16,2)" - ] - }, - { - "cell_type": "code", - "execution_count": 26, - "metadata": {}, - "outputs": [ - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAABrCAYAAABnlHmpAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAB8RJREFUeJzt3c9rHOcdx/HPV7vWj6Qoln8rv0NwKGoS2iIcCqUEQrHbi3tpiHOoDwZDoZeeauih1/4DpeCDsS9JKLnEpQY3MTQptBS5UNKkEFt1nEiNY0e1W5I0tlb2twdtzGq98oxmZ+bZ59n3C8zsPH525+uPhq8ez+xK5u4CAMRvJHQBAIBy0NABIBE0dABIBA0dABJBQweARNDQASARNHQASAQNHQAS0VdDN7N9Zvaemc2b2ZGyisIq8q0O2VaHbMOxop8UNbOGp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5mylwc6XbKsVc74DlW3dDX1O0m4ze8zMRiW9IOlkzTUUdVLSwfbjg5JeC1hLLzFnKw12vmRbrZjzHaxs3b3WP5K+L+mcpH9K+nndx89Z48uSLklqaXX1cEjSVq3exT7f3m4JXWeM2caaL9mSbwzZ8klRAEgEnxQFgETQ0AEgETR0AEgEDR0AEkFDB4BE0NABIBE0dABIBA0dABLxf0GZN9fdsbfGAAAAAElFTkSuQmCC\n", - "text/plain": [ - "
" - ] - }, - "metadata": { - "needs_background": "light" - }, - "output_type": "display_data" - } - ], - "source": [ - "plotWorkgroupConfig(2,16)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.7.3" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/lbm_codegen.ipynb b/lbm_codegen.ipynb deleted file mode 100644 index e1593c0..0000000 --- a/lbm_codegen.ipynb +++ /dev/null @@ -1,828 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [], - "source": [ - "from sympy import *\n", - "init_printing()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Characteristic constants" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [], - "source": [ - "q = 9\n", - "d = 2" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [], - "source": [ - "c = [Matrix(x) for x in [(-1, 1), ( 0, 1), ( 1, 1), (-1, 0), ( 0, 0), ( 1, 0), (-1,-1), ( 0, -1), ( 1, -1)]]" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": {}, - "outputs": [ - { - "data": { - "text/latex": [ - "$$\\left [ \\left[\\begin{matrix}-1\\\\1\\end{matrix}\\right], \\quad \\left[\\begin{matrix}0\\\\1\\end{matrix}\\right], \\quad \\left[\\begin{matrix}1\\\\1\\end{matrix}\\right], \\quad \\left[\\begin{matrix}-1\\\\0\\end{matrix}\\right], \\quad \\left[\\begin{matrix}0\\\\0\\end{matrix}\\right], \\quad \\left[\\begin{matrix}1\\\\0\\end{matrix}\\right], \\quad \\left[\\begin{matrix}-1\\\\-1\\end{matrix}\\right], \\quad \\left[\\begin{matrix}0\\\\-1\\end{matrix}\\right], \\quad \\left[\\begin{matrix}1\\\\-1\\end{matrix}\\right]\\right ]$$" - ], - "text/plain": [ - "⎡⎡-1⎤ ⎡0⎤ ⎡1⎤ ⎡-1⎤ ⎡0⎤ ⎡1⎤ ⎡-1⎤ ⎡0 ⎤ ⎡1 ⎤⎤\n", - "⎢⎢ ⎥, ⎢ ⎥, ⎢ ⎥, ⎢ ⎥, ⎢ ⎥, ⎢ ⎥, ⎢ ⎥, ⎢ ⎥, ⎢ ⎥⎥\n", - "⎣⎣1 ⎦ ⎣1⎦ ⎣1⎦ ⎣0 ⎦ ⎣0⎦ ⎣0⎦ ⎣-1⎦ ⎣-1⎦ ⎣-1⎦⎦" - ] - }, - "execution_count": 4, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "c" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": {}, - "outputs": [], - "source": [ - "w = [Rational(*x) for x in [(1,36), (1,9), (1,36), (1,9), (4,9), (1,9), (1,36), (1,9), (1,36)]]" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": {}, - "outputs": [ - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAlMAAAAVCAYAAABi32uwAAAABHNCSVQICAgIfAhkiAAABzlJREFUeJztnWuoFVUUx3++wqKHWZEEkhZC4Y1I0jJMt0VShqFSXwIhpPoSFIhF9KBjlFlRaFpEVJr5IeghfQgrE063J0pZUWkvtR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nnLGDPy0gek10hAlVDPVBhD8mG+Ziy094rbOKxdDENalkX6Z5ZxuPZVWe3Ogg++ysNPandx0fdB5yirr3ywuwj6iFKlSWMq+Gxu4Us2IS3ETjID2RY+bhy1SLj2VVntzoIPvsrDT2p3cdH3Qecoq698sLsI+gBZDRjtPQNks6qAUdROPusDluVfNkVRFEVRlMJzHHBHJK3SgXIoiqIoiqIoiqIoiqIoiuV/+NxET1RKZ7IAAAAASUVORK5CYII=\n", - "text/latex": [ - "$$\\left [ \\frac{1}{36}, \\quad \\frac{1}{9}, \\quad \\frac{1}{36}, \\quad \\frac{1}{9}, \\quad \\frac{4}{9}, \\quad \\frac{1}{9}, \\quad \\frac{1}{36}, \\quad \\frac{1}{9}, \\quad \\frac{1}{36}\\right ]$$" - ], - "text/plain": [ - "[1/36, 1/9, 1/36, 1/9, 4/9, 1/9, 1/36, 1/9, 1/36]" - ] - }, - "execution_count": 6, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "w" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": {}, - "outputs": [ - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAA0AAAASCAYAAACAa1QyAAAABHNCSVQICAgIfAhkiAAAAHZJREFUKJFjYKACCGFgYJjMwMBwmIGB4RMDA8N/BgaGJYQ0XYAq/MzAwHCdWE2ODAwMqgwMDIwMDAwOuDSxoPH3EzKVgYGBgYkYRaOaBlwTeuQGQDEDAwODBJS2ZGBgWABlv2FgYChBN6SBAZJ0cOEH5LiMzgAA6XoX52TB9a4AAAAASUVORK5CYII=\n", - "text/latex": [ - "$$1$$" - ], - "text/plain": [ - "1" - ] - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "sum(w)" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "metadata": {}, - "outputs": [ - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAADEAAAAdCAYAAAAD8oRRAAAABHNCSVQICAgIfAhkiAAAAi9JREFUWIXt1t2LTVEYx/GPGTTFNJkhk5SoKeRCopAkaoSkhD/BtXArLrwkF8pbjQvuKcqUuZIkbpTxFlFKTSF5yUthzMTF2jNzzmnvffY5Z585Ls63dmu113p+63n2evazFk3+D6ZUOL8d3xq4fi7swuZGLJwn5zC90U6U0lLB3NboGa6TL1VTSRBrcb9ejkwWJ9DVaCfiqGQnuvCpXo7UQtYgevAyYewkbmEIP/EZgzgs+87NxSjOVKObtU4fQD9exYwN4yGe4wNmYDVW4m3UHyqjvxd92IjbOeoW0Zcy1pbw/hj+4kIG/QF8FKpfxbqF6dSCo9hSYtQp/V/4lfD+StT2pNhCh7AD/UJKVaxbGEQv1mB3idFW3CzjSBzbo/ZJmXnbhAP0Wl66y4X8KwzuvGwF4CCO4DTuClv+GHPK2F3FD8npU5XuG6yL+tMUV4w03kcLjD0DQtVJow3fhUCq1o37wjewI+pvwJ0yjozRLVS7buzEIqEkrkix6cVMXM9Z1yYTpfRUtEg1LMBvPEuZczma05Gzrqn4giWylcc0BoUUmB0z1iqU1YFadePSaUSoRofwtIoFCpkXtaMxY+uFkzctlarRHWePEOn8MmKLhVwtpcXEoXQvwfZs5ETcz1+L7jjtsl279+GPcMe5KNx0L+F1tNA7LE2wHRJKZt66RczKMGeZcI48EvJ7BF/xQKjtnQl2qyJn9uesO6kcF4JY2GhHauGF8JWbNGlSB/4BwBaSc+fGZlwAAAAASUVORK5CYII=\n", - "text/latex": [ - "$$\\frac{\\sqrt{3}}{3}$$" - ], - "text/plain": [ - "√3\n", - "──\n", - "3 " - ] - }, - "execution_count": 8, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "c_s = sqrt(Rational(1,3))\n", - "c_s" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Moments" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "metadata": {}, - "outputs": [], - "source": [ - "rho, tau = symbols('rho tau')" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([f_next_0, f_next_1, f_next_2, f_next_3, f_next_4, f_next_5,\n", - " f_next_6, f_next_7, f_next_8], dtype=object)" - ] - }, - "execution_count": 10, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "f_next = symarray('f_next', q)\n", - "f_next" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([f_curr_0, f_curr_1, f_curr_2, f_curr_3, f_curr_4, f_curr_5,\n", - " f_curr_6, f_curr_7, f_curr_8], dtype=object)" - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "f_curr = symarray('f_curr', q)\n", - "f_curr" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "metadata": {}, - "outputs": [ - { - "data": { - "text/latex": [ - "$$\\left[\\begin{matrix}u_{0}\\\\u_{1}\\end{matrix}\\right]$$" - ], - "text/plain": [ - "⎡u₀⎤\n", - "⎢ ⎥\n", - "⎣u₁⎦" - ] - }, - "execution_count": 12, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "u = Matrix(symarray('u', d))\n", - "u" - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "metadata": {}, - "outputs": [], - "source": [ - "from sympy.codegen.ast import Assignment" - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "metadata": {}, - "outputs": [ - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAA2oAAAAXCAYAAAB6f7yJAAAABHNCSVQICAgIfAhkiAAAERBJREFUeJztnXmUHEUdxz8QSAJJICreRyJiEiKBcIkHgRUiyCWoqE/Ul0bFg2A8nlfwWhUJCPIARUVFF8SASFAEHhIRFkWUgEISBAIKG1QIIaACShJD1j++VW96e6qvmtntnp36vDdvd6p+1V31nZrp/tWvqhoCgUAgEAgEAoFAIFBbeoDB2OvuSmuTz8dRPd9RdUVGCRcAa4EJHmXtZ3FMW2vkz3bA2cAAs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