Allows the caller to pass in argv to hl.main()#8937
Conversation
62a5895 to
9bae1f1
Compare
|
Any suggestions on how / where to put tests? A simple test would be to use something like |
|
Hold off on merging - it occurs to me that one can implement |
|
@alexreinking PTAL. Much cleaner I think. |
alexreinking
left a comment
There was a problem hiding this comment.
Looks good with one nitpick
alexreinking
left a comment
There was a problem hiding this comment.
Argv arrays are meant to be NULL-pointer terminated. I don't think we rely on this today, but a very reasonable refactor to generate_filter_main might rely on it later.
| mutable_argv.push_back(const_cast<char *>(s.c_str())); | ||
| } | ||
| int result = Halide::Internal::generate_filter_main((int)argv.size(), argv.data(), PyGeneratorFactoryProvider()); | ||
| int result = Halide::Internal::generate_filter_main((int)mutable_argv.size(), mutable_argv.data(), PyGeneratorFactoryProvider()); |
There was a problem hiding this comment.
| int result = Halide::Internal::generate_filter_main((int)mutable_argv.size(), mutable_argv.data(), PyGeneratorFactoryProvider()); | |
| int result = Halide::Internal::generate_filter_main((int)mutable_argv.size() - 1, mutable_argv.data(), PyGeneratorFactoryProvider()); |
alexreinking
left a comment
There was a problem hiding this comment.
I fixed up the formatting in _generator_filter_main and tweaked names to make it clear that a Python list of arguments is getting translated into a compliant argv array.
8396a7b to
93c9c87
Compare
No description provided.