Skip to content

Commit

Permalink
Use explicit types.
Browse files Browse the repository at this point in the history
  • Loading branch information
xissburg committed Dec 8, 2024
1 parent 4a3193f commit 401118f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/edyn/context/task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ void enqueue_task_default(task_delegate_t task, unsigned size, task_completion_d
auto num_workers = dispatcher.num_workers();

// Size of chunk that will be processed per job iteration.
auto count_per_worker_ceil = size / num_workers + (size % num_workers != 0);
auto chunk_size = std::max(count_per_worker_ceil, 1ul);
unsigned count_per_worker_ceil = size / num_workers + (size % num_workers != 0);
auto chunk_size = std::max(count_per_worker_ceil, 1u);

// Number of jobs that will be dispatched. Must not be greater than number
// of workers.
Expand All @@ -186,9 +186,9 @@ void enqueue_task_default(task_delegate_t task, unsigned size, task_completion_d

void enqueue_task_wait_default(task_delegate_t task, unsigned size) {
auto &dispatcher = job_dispatcher::global();
auto num_workers = dispatcher.num_workers();
auto chunk_size = std::max(size / (num_workers + 1), 1ul);
auto num_jobs = std::min(num_workers, size - 1ul);
unsigned num_workers = dispatcher.num_workers();
unsigned chunk_size = std::max(size / (num_workers + 1), 1u);
unsigned num_jobs = std::min(num_workers, size - 1u);
auto context = parallel_for_context{0u, size, 1u, chunk_size, num_jobs, task};

auto child_job = job();
Expand Down

0 comments on commit 401118f

Please sign in to comment.