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

Add a parallel_for wrapper #168

Merged
merged 1 commit into from
Dec 1, 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
5 changes: 5 additions & 0 deletions yacl/utils/parallel.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ body of your function, only data pointers.
inline void parallel_for(int64_t begin, int64_t end, int64_t grain_size,
const std::function<void(int64_t, int64_t)>& f);

inline void parallel_for(int64_t begin, int64_t end,
const std::function<void(int64_t, int64_t)>& f) {
parallel_for(begin, end, 1, f);
}

/*
parallel_reduce

Expand Down
Loading