Skip to content

Commit 58edaf6

Browse files
[bug] Fix potential bug in #6362 (#6363) (#6371)
Issue: #6362 Issue: # ### Brief Summary Co-authored-by: Yi Xu <[email protected]>
1 parent bd5c455 commit 58edaf6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

taichi/program/kernel.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ Kernel::Kernel(Program &program,
3030
const std::function<void(Kernel *)> &func,
3131
const std::string &primal_name,
3232
AutodiffMode autodiff_mode) {
33+
// due to #6362, we cannot write [func, this] { return func(this); }
3334
this->init(
34-
program, [func, this] { return func(this); }, primal_name, autodiff_mode);
35+
program, [&] { return func(this); }, primal_name, autodiff_mode);
3536
}
3637

3738
Kernel::Kernel(Program &program,

0 commit comments

Comments
 (0)