From d58914164adc5876a5911edec85e2ebd43288ec9 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sun, 2 Feb 2020 21:52:05 +0100 Subject: Rename 'collide_and_stream' to 'collide' Streaming is only implicit depending on the selected propagation pattern. --- README.md | 6 +++--- boltzgen.py | 2 +- boltzgen/kernel/template/collide.cl.mako | 15 +++++++++++++++ boltzgen/kernel/template/collide.cpp.mako | 15 +++++++++++++++ boltzgen/kernel/template/collide.cuda.mako | 17 +++++++++++++++++ boltzgen/kernel/template/collide_and_stream.cl.mako | 15 --------------- boltzgen/kernel/template/collide_and_stream.cpp.mako | 15 --------------- boltzgen/kernel/template/collide_and_stream.cuda.mako | 17 ----------------- 8 files changed, 51 insertions(+), 51 deletions(-) create mode 100644 boltzgen/kernel/template/collide.cl.mako create mode 100644 boltzgen/kernel/template/collide.cpp.mako create mode 100644 boltzgen/kernel/template/collide.cuda.mako delete mode 100644 boltzgen/kernel/template/collide_and_stream.cl.mako delete mode 100644 boltzgen/kernel/template/collide_and_stream.cpp.mako delete mode 100644 boltzgen/kernel/template/collide_and_stream.cuda.mako diff --git a/README.md b/README.md index ed2c1bd..f102201 100644 --- a/README.md +++ b/README.md @@ -62,9 +62,9 @@ optional arguments: \ --layout AOS \ --tau 0.52 \ --functions default bounce_back_boundary | tee kernel.h -void collide_and_stream( double* f_next, - const double* f_prev, - std::size_t gid) +void collide(double* f_next, + const double* f_prev, + std::size_t gid) { double* preshifted_f_next = f_next + gid*9; const double* preshifted_f_prev = f_prev + gid*9; diff --git a/boltzgen.py b/boltzgen.py index c2eb297..aebd1fb 100755 --- a/boltzgen.py +++ b/boltzgen.py @@ -53,7 +53,7 @@ functions = sum(args.functions, []) if len(functions) == 0: functions += ['default'] if 'default' in functions: - for f in ['collide_and_stream', 'equilibrilize', 'collect_moments', 'momenta_boundary']: + for f in ['collide', 'equilibrilize', 'collect_moments', 'momenta_boundary']: functions.insert(functions.index('default'), f) functions.remove('default') diff --git a/boltzgen/kernel/template/collide.cl.mako b/boltzgen/kernel/template/collide.cl.mako new file mode 100644 index 0000000..51b591a --- /dev/null +++ b/boltzgen/kernel/template/collide.cl.mako @@ -0,0 +1,15 @@ +<%namespace name="pattern" file="${'/pattern/%s.cl.mako' % context['streaming']}"/> +<% +import sympy +subexpr, assignment = model.collision(f_eq = model.equilibrium(resolve_moments = True)) +%> + +<%call expr="pattern.operator('collide')"> +% for i, expr in enumerate(subexpr): + const ${float_type} ${expr[0]} = ${sympy.ccode(expr[1])}; +% endfor + +% for i, expr in enumerate(assignment): + const ${float_type} ${sympy.ccode(expr)} +% endfor + diff --git a/boltzgen/kernel/template/collide.cpp.mako b/boltzgen/kernel/template/collide.cpp.mako new file mode 100644 index 0000000..0ad7123 --- /dev/null +++ b/boltzgen/kernel/template/collide.cpp.mako @@ -0,0 +1,15 @@ +<%namespace name="pattern" file="${'/pattern/%s.cpp.mako' % context['streaming']}"/> +<% +import sympy +subexpr, assignment = model.collision(f_eq = model.equilibrium(resolve_moments = True)) +%> + +<%call expr="pattern.operator('collide')"> +% for i, expr in enumerate(subexpr): + const ${float_type} ${expr[0]} = ${sympy.ccode(expr[1])}; +% endfor + +% for i, expr in enumerate(assignment): + const ${float_type} ${sympy.ccode(expr)} +% endfor + diff --git a/boltzgen/kernel/template/collide.cuda.mako b/boltzgen/kernel/template/collide.cuda.mako new file mode 100644 index 0000000..081beaa --- /dev/null +++ b/boltzgen/kernel/template/collide.cuda.mako @@ -0,0 +1,17 @@ +<%namespace name="pattern" file="${'/pattern/%s.cuda.mako' % context['streaming']}"/> +<% +from boltzgen.utility.printer import CudaCodePrinter +ccode = CudaCodePrinter(float_type).doprint +subexpr, assignment = model.collision(f_eq = model.equilibrium(resolve_moments = True)) + +%> + +<%call expr="pattern.operator('collide')"> +% for i, expr in enumerate(subexpr): + const ${float_type} ${expr[0]} = ${ccode(expr[1])}; +% endfor + +% for i, expr in enumerate(assignment): + const ${float_type} ${ccode(expr)} +% endfor + diff --git a/boltzgen/kernel/template/collide_and_stream.cl.mako b/boltzgen/kernel/template/collide_and_stream.cl.mako deleted file mode 100644 index 3718ae7..0000000 --- a/boltzgen/kernel/template/collide_and_stream.cl.mako +++ /dev/null @@ -1,15 +0,0 @@ -<%namespace name="pattern" file="${'/pattern/%s.cl.mako' % context['streaming']}"/> -<% -import sympy -subexpr, assignment = model.collision(f_eq = model.equilibrium(resolve_moments = True)) -%> - -<%call expr="pattern.operator('collide_and_stream')"> -% for i, expr in enumerate(subexpr): - const ${float_type} ${expr[0]} = ${sympy.ccode(expr[1])}; -% endfor - -% for i, expr in enumerate(assignment): - const ${float_type} ${sympy.ccode(expr)} -% endfor - diff --git a/boltzgen/kernel/template/collide_and_stream.cpp.mako b/boltzgen/kernel/template/collide_and_stream.cpp.mako deleted file mode 100644 index 9f4c1e6..0000000 --- a/boltzgen/kernel/template/collide_and_stream.cpp.mako +++ /dev/null @@ -1,15 +0,0 @@ -<%namespace name="pattern" file="${'/pattern/%s.cpp.mako' % context['streaming']}"/> -<% -import sympy -subexpr, assignment = model.collision(f_eq = model.equilibrium(resolve_moments = True)) -%> - -<%call expr="pattern.operator('collide_and_stream')"> -% for i, expr in enumerate(subexpr): - const ${float_type} ${expr[0]} = ${sympy.ccode(expr[1])}; -% endfor - -% for i, expr in enumerate(assignment): - const ${float_type} ${sympy.ccode(expr)} -% endfor - diff --git a/boltzgen/kernel/template/collide_and_stream.cuda.mako b/boltzgen/kernel/template/collide_and_stream.cuda.mako deleted file mode 100644 index b46cf0f..0000000 --- a/boltzgen/kernel/template/collide_and_stream.cuda.mako +++ /dev/null @@ -1,17 +0,0 @@ -<%namespace name="pattern" file="${'/pattern/%s.cuda.mako' % context['streaming']}"/> -<% -from boltzgen.utility.printer import CudaCodePrinter -ccode = CudaCodePrinter(float_type).doprint -subexpr, assignment = model.collision(f_eq = model.equilibrium(resolve_moments = True)) - -%> - -<%call expr="pattern.operator('collide_and_stream')"> -% for i, expr in enumerate(subexpr): - const ${float_type} ${expr[0]} = ${ccode(expr[1])}; -% endfor - -% for i, expr in enumerate(assignment): - const ${float_type} ${ccode(expr)} -% endfor - -- cgit v1.2.3