arm64neonhalide

Does halide support ARMv8(aarch64) with neon?


I'd like to use Halide for ARM A53(aarch64) target with neon vectorization.

But I cannot figure out how to create Target object. Also I cannot find aarch64 target with neon feature in Target.h.

The below code I've tested runs on A53 target but the generated code does not contain neon instructions.

Target target("arm-64-linux"); // is it right?
Buffer<uint16_t> input(640,480);

Var x,y;
Func brighter("brighter");
brighter(x,y) = input(x,y) + 100;
brighter.estimate(x, 0, 640).
         estimate(y, 0, 480);

Pipeline p(brighter);
p.auto_schedule(target);
p.compile_to_static_library("./lib_dummy", {input}, "", target);

Solution

  • arm-64 is what Halide uses for aarch64, so your target is fine. To use neon instructions, you need to be vectorizing something. Not sure if the autoscheduler is doing that or not (it should be!). Try not autoscheduling and instead just saying:

    brighter.vectorize(x, 8);