You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Host-side prefetch fails to compile for targets with the hvx feature #9496
Prefetches in host code fail to compile when the target has the hvx feature (e.g. host-hvx), even if nothing is offloaded with .hexagon().
Reproducer:
#include"Halide.h"usingnamespaceHalide;intmain() {
Var x, y;
ImageParam input(Int(32), 2, "input");
Func f("f");
f(x, y) = input(x, y) * 2;
f.prefetch(input, y, y, 2);
Buffer<int> in(4, 4);
in.fill(3);
input.set(in);
Buffer<int> r = f.realize({4, 4});
printf("ok %d\n", r(0, 0));
}
With HL_JIT_TARGET=host this prints ok 6. With HL_JIT_TARGET=host-hvx it fails with:
Error: Only prefetch of 1 cache line is supported.
reduce_prefetch_dimension (Prefetch.cpp) chooses Hexagon's 2D prefetch form whenever t.has_feature(Target::HVX). It runs in lower() before inject_hexagon_rpc splits off the .hexagon() loops, so prefetches that stay in host code also get the 2D form, which CodeGen_LLVM rejects. It should probably only use the 2D form when t.arch == Target::Hexagon or the prefetch is inside a DeviceAPI::Hexagon loop.
Activity
Skip the ImageParam prefetch serialization test on HVX targets
Fix deserialization of prefetches of external parameters (#9493)