def test_chunk_iname(ctx_factory): ctx = ctx_factory() knl = lp.make_kernel( "{ [i]: 0<=i<n }", "out[i] = 2*a[i]", [lp.GlobalArg("out,a", np.float32, shape=lp.auto), "..."], assumptions="n>0") ref_knl = knl knl = lp.chunk_iname(knl, "i", 3, inner_tag="l.0") knl = lp.prioritize_loops(knl, "i_outer, i_inner") lp.auto_test_vs_ref(ref_knl, ctx, knl, parameters=dict(n=130))
def test_chunk_iname(ctx_factory): ctx = ctx_factory() knl = lp.make_kernel( "{ [i]: 0<=i<n }", "out[i] = 2*a[i]", [ lp.GlobalArg("out,a", np.float32, shape=lp.auto), "..." ], assumptions="n>0") ref_knl = knl knl = lp.chunk_iname(knl, "i", 3, inner_tag="l.0") knl = lp.set_loop_priority(knl, "i_outer, i_inner") lp.auto_test_vs_ref(ref_knl, ctx, knl, parameters=dict(n=130))
def test_chunk_iname(self): "Chunk useful to split work for e.g. omp par for" knl = lp.chunk_iname(self.knl, 'i', 8) print(self._dtype_and_code(knl))