Skip to content

Commit

Permalink
[bug] Fix potential bug in #6362 (#6363)
Browse files Browse the repository at this point in the history
Issue: #6362
  • Loading branch information
strongoier authored Oct 19, 2022
1 parent 4646105 commit ad9bb5d
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 ad9bb5d

Please sign in to comment.