Skip to content

Commit

Permalink
Fix linux warning/error: cast literal to unsigned for atomic_fetch_add
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianlizarraga committed Dec 18, 2023
1 parent dfa6b21 commit b749cfd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions onnxruntime/test/acc_test/task_thread_pool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ bool TaskThreadPool::RunNextTask() {
return false;
}

const size_t task_index = std::atomic_fetch_add(&next_task_index_, 1);
const size_t task_index = std::atomic_fetch_add(&next_task_index_, static_cast<size_t>(1));
if (task_index >= tasks_.size()) {
return false;
}

tasks_[task_index].Run();

std::atomic_fetch_add(&tasks_completed_, 1);
std::atomic_fetch_add(&tasks_completed_, static_cast<size_t>(1));
return true;
}

0 comments on commit b749cfd

Please sign in to comment.