DarkSharpness commented on code in PR #213:
URL: https://github.com/apache/tvm-ffi/pull/213#discussion_r2483498965
##########
python/tvm_ffi/cpp/extension.py:
##########
@@ -360,7 +417,16 @@ def _decorate_with_tvm_ffi(source: str, functions:
Mapping[str, str]) -> str:
return "\n".join(sources)
-def build_inline( # noqa: PLR0915, PLR0912
+def _str_seq2list(seq: Sequence[str] | str | None) -> list[str]:
+ if seq is None:
+ return []
+ elif isinstance(seq, str):
+ return [seq]
+ else:
+ return list(seq)
+
+
+def build_inline(
Review Comment:
I'm not sure how to implement this. The old `build_inline` placed the
C++/CUDA source files directly in the build directory. If we want to reuse the
existing `build` function, we’d need to write the source code to disk before we
even know the final build directory.
My suggestion would be to store the sources in a temporary file whose name
is derived from a hash of its content, which works well with ninja cache
compile.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]