From 09f45c1d1da37bf4f6fa4094eb2d2ea18e8aaf21 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Tue, 29 Oct 2019 20:33:30 +0100 Subject: Don't try to reuse population layout for moment array indexing --- boltzgen/kernel/template/collect_moments.cl.mako | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/boltzgen/kernel/template/collect_moments.cl.mako b/boltzgen/kernel/template/collect_moments.cl.mako index 06b92c9..ddf5102 100644 --- a/boltzgen/kernel/template/collect_moments.cl.mako +++ b/boltzgen/kernel/template/collect_moments.cl.mako @@ -1,8 +1,9 @@ __kernel void collect_moments_gid(__global ${float_type}* f, - __global ${float_type}* moments, + __global ${float_type}* m, unsigned int gid) { __global ${float_type}* preshifted_f = f + ${layout.cell_preshift('gid')}; + __global ${float_type}* preshifted_m = m + gid*${descriptor.d+1}; % for i in range(0,descriptor.q): const ${float_type} f_curr_${i} = preshifted_f[${layout.pop_offset(i)}]; @@ -13,7 +14,7 @@ __kernel void collect_moments_gid(__global ${float_type}* f, % endfor % for i, expr in enumerate(moments_assignment): - moments[${layout.pop_offset(i)} + gid] = ${ccode(expr.rhs)}; + preshifted_m[${i}] = ${ccode(expr.rhs)}; % endfor } -- cgit v1.2.3