From a184d0dd023cc0b6fee5e02510addb91d66f8e01 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 18 Oct 2021 18:19:01 +0200 Subject: Cleanup: fix outdated comment and use of atomics This is only used by a single device, not need for thread safety. --- intern/cycles/integrator/work_tile_scheduler.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'intern/cycles/integrator/work_tile_scheduler.cpp') diff --git a/intern/cycles/integrator/work_tile_scheduler.cpp b/intern/cycles/integrator/work_tile_scheduler.cpp index e6ada2f46ee..234b1fae915 100644 --- a/intern/cycles/integrator/work_tile_scheduler.cpp +++ b/intern/cycles/integrator/work_tile_scheduler.cpp @@ -88,7 +88,7 @@ bool WorkTileScheduler::get_work(KernelWorkTile *work_tile_, const int max_work_ DCHECK_NE(max_num_path_states_, 0); - const int work_index = atomic_fetch_and_add_int32(&next_work_index_, 1); + const int work_index = next_work_index_++; if (work_index >= total_work_size_) { return false; } @@ -121,12 +121,8 @@ bool WorkTileScheduler::get_work(KernelWorkTile *work_tile_, const int max_work_ if (max_work_size && tile_work_size > max_work_size) { /* The work did not fit into the requested limit of the work size. Unschedule the tile, - * allowing others (or ourselves later one) to pick it up. - * - * TODO: Such temporary decrement is not ideal, since it might lead to situation when another - * device sees there is nothing to be done, finishing its work and leaving all work to be - * done by us. */ - atomic_fetch_and_add_int32(&next_work_index_, -1); + * so it can be picked up again later. */ + next_work_index_--; return false; } -- cgit v1.2.3