Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parallel_for when grain_size > 0 #179

Merged
merged 1 commit into from
Nov 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion csrc/include/adam_cpu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ inline void parallel_for(int64_t begin, int64_t end, int64_t grain_size, const F
int64_t num_threads = 1; // Default to serial execution

if (grain_size > 0) {
num_threads = std::max((numiter+num_threads-1) / grain_size, static_cast<int64_t>(1));
num_threads = std::max((numiter+grain_size-1) / grain_size, static_cast<int64_t>(1));
}
else{
cpu_set_t cpu_set;
Expand Down