Skip to content

Commit a89e806

Browse files
committed
.
1 parent 4053aae commit a89e806

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

python_bindings/src/halide/halide_/PyGenerator.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -158,19 +158,19 @@ void define_generator(py::module &m) {
158158
});
159159

160160
m.def("_generate_filter_main", [](const std::vector<std::string> &argv) -> void {
161-
std::vector<char *> mutable_argv;
162-
mutable_argv.reserve(argv.size());
163-
for (auto &s : argv) {
164-
mutable_argv.push_back(const_cast<char *>(s.c_str()));
165-
}
166-
int result = Halide::Internal::generate_filter_main((int)mutable_argv.size(), mutable_argv.data(), PyGeneratorFactoryProvider());
167-
if (result != 0) {
168-
// Some paths in generate_filter_main() will fail with user_error or similar (which throws an exception
169-
// due to how libHalide is built for Python), but some paths just return an error code. For consistency,
170-
// handle both by throwing a C++ exception, which PyBind11 turns into a Python exception.
171-
throw std::runtime_error("Generator failed: " + std::to_string(result));
172-
},
173-
&generate_filter_main, py::arg("argv"));
161+
std::vector<char *> mutable_argv;
162+
mutable_argv.reserve(argv.size());
163+
for (auto &s : argv) {
164+
mutable_argv.push_back(const_cast<char *>(s.c_str()));
165+
}
166+
const int result = Halide::Internal::generate_filter_main((int)mutable_argv.size(), mutable_argv.data(), PyGeneratorFactoryProvider());
167+
if (result != 0) {
168+
// Some paths in generate_filter_main() will fail with user_error or similar (which throws an exception
169+
// due to how libHalide is built for Python), but some paths just return an error code. For consistency,
170+
// handle both by throwing a C++ exception, which PyBind11 turns into a Python exception.
171+
throw std::runtime_error("Generator failed: " + std::to_string(result));
172+
} }, py::arg("argv"));
173+
//, py::arg("argv"));
174174

175175
m.def("_unique_name", []() -> std::string {
176176
return ::Halide::Internal::unique_name('p');

0 commit comments

Comments
 (0)