apache / tvm

Open deep learning compiler stack for cpu, gpu and specialized accelerators
https://tvm.apache.org/
Apache License 2.0
11.41k stars 3.4k forks source link

[Bugfix][CRT] Return error code on error from ModuleGetFunction #17097

Closed Lunderberg closed 2 weeks ago

Lunderberg commented 3 weeks ago

Prior to this commit, ModuleGetFunction returned zero if called with an incorrect number of arguments, or with incorrect type codes. This incorrectly indicated that the module was inspected, and did not contain the requested function.

This commit corrects the implementation of ModuleGetFunction to instead call set an error message with TVMAPISetLastError, then to return an appropriate error code.

Lunderberg commented 3 weeks ago

This change is split out from https://github.com/apache/tvm/pull/16183 as an independent change for ease of review.