Skip to content

Commit

Permalink
[bug] Fix potential bug in taichi-dev#6362 (taichi-dev#6363)
Browse files Browse the repository at this point in the history
  • Loading branch information
strongoier authored and jim19930609 committed Oct 19, 2022
1 parent bd5c455 commit 82fee98
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion taichi/program/kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ Kernel::Kernel(Program &program,
const std::function<void(Kernel *)> &func,
const std::string &primal_name,
AutodiffMode autodiff_mode) {
// due to #6362, we cannot write [func, this] { return func(this); }
this->init(
program, [func, this] { return func(this); }, primal_name, autodiff_mode);
program, [&] { return func(this); }, primal_name, autodiff_mode);
}

Kernel::Kernel(Program &program,
Expand Down

0 comments on commit 82fee98

Please sign in to comment.