Skip to content

Commit

Permalink
acquire GIL
Browse files Browse the repository at this point in the history
  • Loading branch information
MayDomine authored Jul 11, 2023
1 parent 680f13c commit 0937eac
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions csrc/include/adam_cpu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ inline void parallel_for(int64_t begin, int64_t end, int64_t grain_size, const F
for (auto& thread : threads) {
thread.join();
}
py::gil_scoped_acquire acquire; //acquire the GIL
} else {
// If not feasible or grain_size is 0, perform the operation serially
f(begin, end);
Expand Down

0 comments on commit 0937eac

Please sign in to comment.