aboutsummaryrefslogtreecommitdiff
path: root/boltzgen/kernel/template/collect_moments.cl.mako
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-11-12 22:54:11 +0100
committerAdrian Kummerlaender2019-11-12 22:54:11 +0100
commitaa509dd4ebbb9d1d8ad6ebfe05111228fd9ae7c0 (patch)
treee43112bf6a79f2d1a92754391f01110fd335eeef /boltzgen/kernel/template/collect_moments.cl.mako
parenta93535c32231d98ef8d080adac626f88b18f9db5 (diff)
downloadboltzgen-aa509dd4ebbb9d1d8ad6ebfe05111228fd9ae7c0.tar
boltzgen-aa509dd4ebbb9d1d8ad6ebfe05111228fd9ae7c0.tar.gz
boltzgen-aa509dd4ebbb9d1d8ad6ebfe05111228fd9ae7c0.tar.bz2
boltzgen-aa509dd4ebbb9d1d8ad6ebfe05111228fd9ae7c0.tar.xz
boltzgen-aa509dd4ebbb9d1d8ad6ebfe05111228fd9ae7c0.zip
Match OpenCL and CUDA cell list dispatch templates
Diffstat (limited to 'boltzgen/kernel/template/collect_moments.cl.mako')
-rw-r--r--boltzgen/kernel/template/collect_moments.cl.mako12
1 files changed, 12 insertions, 0 deletions
diff --git a/boltzgen/kernel/template/collect_moments.cl.mako b/boltzgen/kernel/template/collect_moments.cl.mako
index 63387b7..e3ce166 100644
--- a/boltzgen/kernel/template/collect_moments.cl.mako
+++ b/boltzgen/kernel/template/collect_moments.cl.mako
@@ -16,6 +16,18 @@ moments_subexpr, moments_assignment = model.moments()
% endfor
</%call>
+<%call expr="pattern.functor_with_domain_dispatch('collect_moments_domain', [('__global %s*' % float_type, 'm')])">
+% for i, expr in enumerate(moments_subexpr):
+ const ${float_type} ${expr[0]} = ${sympy.ccode(expr[1])};
+% endfor
+
+ __global ${float_type}* preshifted_m = m + gid*${descriptor.d+1};
+
+% for i, expr in enumerate(moments_assignment):
+ preshifted_m[${i}] = ${sympy.ccode(expr.rhs)};
+% endfor
+</%call>
+
% if 'opencl_gl_interop' in extras:
<%call expr="pattern.functor_with_domain_dispatch('collect_moments_to_texture', [('__write_only %s' % {2: 'image2d_t', 3: 'image3d_t'}.get(descriptor.d), 'm')])">
% for i, expr in enumerate(moments_subexpr):