Skip to content

Add AOT running mode#3595

Closed
bnason-nf wants to merge 2 commits intobytecodealliance:mainfrom
bnason-nf:aot-running-mode
Closed

Add AOT running mode#3595
bnason-nf wants to merge 2 commits intobytecodealliance:mainfrom
bnason-nf:aot-running-mode

Conversation

@bnason-nf
Copy link
Contributor

This adds an enum to RunningMode to be able to determine if a module instance is using AOT. I'm not sure this is the best solution for that, if there's a better way please let me know.

@wenyongh
Copy link
Collaborator

wenyongh commented Jul 4, 2024

@bnason-nf The aot file can only be executed with AOT mode, and whether an input buffer is an AOT file can be detected by the API exported in wasm_export.h:

WASM_RUNTIME_API_EXTERN package_type_t
get_package_type(const uint8_t *buf, uint32_t size);

so we didn't add the AOT mode in the enum. Not sure whether it is good to you?

@bnason-nf
Copy link
Contributor Author

so we didn't add the AOT mode in the enum. Not sure whether it is good to you?

Thanks @wenyongh, I hadn't noticed that API, I could use it if needed, but I made a new API in #3600 that is slightly better, since it doesn't require me to have the module data and doesn't do any extra memory comparison to get information it already knows. I hope it's ok with you.

Also, as a side note, the name of get_package_type() seems inconsistent with the rest of the APIs, maybe it would be nice to change in the future (even though that would be a breaking change).

@bnason-nf bnason-nf closed this Jul 5, 2024
wenyongh pushed a commit that referenced this pull request Jul 10, 2024
…package_type() (#3600)

wasm_runtime_get_file_package_type() is the counterpart of get_file_package_type().

See discussion in #3595.
@bnason-nf bnason-nf deleted the aot-running-mode branch September 12, 2024 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants