mitsuba-renderer / drjit

Dr.Jit — A Just-In-Time-Compiler for Differentiable Rendering
BSD 3-Clause "New" or "Revised" License
593 stars 43 forks source link

feat: neon intrinsics packet backend #70

Closed flanggut closed 3 months ago

flanggut commented 2 years ago

Adding overloads for a neon intrinsics backend. The code is a ported version of the backend from the enoki repo. Tested via unit tests on an M1 mac. See also #63.

I had to add some "hacky" changes to make sure all tests compile and run. I'm happy to incorporate better ways to fix those issues:

  1. changing the seed for the random generator in validate_horizontal in test.h This is because assert_close doesn't really work for floats if result_ref is 0 and result is something like 1e-7. I was hitting exactly that case on my system. Changing the seed doesn't fix it it just avoids it.

  2. Adding <ostream> to half.h, and including half in packet_neon.h This is just so half is defined in packet_neon when the conversion is instantiated. half.h also includes an operator overload for ostreams so this needs to be defined as well.

wjakob commented 1 year ago

Hi all -- sorry for the inactivity. The upcoming rewrite (nanobind_v2 branch) will also have an ARM packet backend. Let's leave this PR open until this branch is merged in case others are looking for this.

njroussel commented 3 months ago

The changes on nanobind_v2 have made their way onto master, I think it entirely covers this PR.