[code-reflection] RFR: ONNX FFM Runtime initial work [v3]
Maurizio Cimadamore
mcimadamore at openjdk.org
Mon Feb 10 12:31:24 UTC 2025
On Mon, 10 Feb 2025 12:14:12 GMT, Adam Sotona <asotona at openjdk.org> wrote:
> I also tried jextract and it generated ~45k of source code, which suppose to be wrapped in another API layer. My first attempt was to make the test working with jextracted code and simplify, however I got lost pretty soon.
Jextract allows to filter -- however the main OrtApi class alone is ~30K LoC. That said, you generate it once, and you check it in. Your approach surely leads to more succinct code - but stuff like this:
createEnv = handle( 3, JAVA_INT, ADDRESS, ADDRESS);
Seems questionable, as you have now encoded the offset of the function pointer in your high-level API. If the header changes, you'll need to update these numbers (whereas if `Environment` depends on jextract code, you just re-run jextract, and everything else will probably stay the same).
I'm not sure the size of the generated code should be a concern here? (Also note that jextract will only force loading of classes that are referenced by your main application).
-------------
PR Comment: https://git.openjdk.org/babylon/pull/311#issuecomment-2647846329
More information about the babylon-dev
mailing list