Blender V5.0
task_range.cc File Reference
#include <cstdlib>
#include "MEM_guardedalloc.h"
#include "BLI_array.hh"
#include "BLI_lazy_threading.hh"
#include "BLI_offset_indices.hh"
#include "BLI_task.h"
#include "BLI_task.hh"
#include "BLI_threads.h"
#include "BLI_vector.hh"
#include "atomic_ops.h"

Go to the source code of this file.

Namespaces

namespace  blender
namespace  blender::threading
namespace  blender::threading::detail

Functions

void BLI_task_parallel_range (const int start, const int stop, void *userdata, TaskParallelRangeFunc func, const TaskParallelSettings *settings)
int BLI_task_parallel_thread_id (const TaskParallelTLS *)
static void blender::threading::detail::parallel_for_impl_accumulated_size_lookup (const IndexRange range, const int64_t grain_size, const FunctionRef< void(IndexRange)> function, const TaskSizeHints_AccumulatedLookup &size_hints)
void blender::threading::detail::parallel_for_impl (IndexRange range, int64_t grain_size, FunctionRef< void(IndexRange)> function, const TaskSizeHints &size_hints)
void blender::threading::detail::memory_bandwidth_bound_task_impl (FunctionRef< void()> function)

Detailed Description

Task parallel range functions.

Definition in file task_range.cc.

Function Documentation

◆ BLI_task_parallel_range()

void BLI_task_parallel_range ( const int start,
const int stop,
void * userdata,
TaskParallelRangeFunc func,
const TaskParallelSettings * settings )

Definition at line 99 of file task_range.cc.

References BLI_task_scheduler_num_threads(), TaskParallelSettings::func_free, TaskParallelSettings::func_reduce, i, TaskParallelSettings::min_iter_per_thread, parallel_reduce(), blender::lazy_threading::send_hint(), TaskParallelSettings::use_threading, TaskParallelSettings::userdata_chunk, TaskParallelTLS::userdata_chunk, and TaskParallelSettings::userdata_chunk_size.

Referenced by BKE_autotrack_context_step(), BKE_maskrasterize_buffer(), BKE_scopes_update(), BKE_tracking_stabilize_frame(), BLI_bvhtree_overlap_ex(), BLI_covariance_m_vn_ex(), BM_loop_interp_multires_ex(), bm_mesh_calc_tessellation_with_partial__multi_threaded(), brush_add(), cloth_bvh_objcollisions_nearcheck(), cloth_bvh_selfcollisions_nearcheck(), displaceModifier_do(), dynamicPaint_applySurfaceDisplace(), dynamicPaint_brushMeshCalculateVelocity(), dynamicPaint_createUVSurface(), dynamicPaint_doBorderStep(), dynamicPaint_doEffectStep(), dynamicPaint_doStep(), dynamicPaint_doWaveStep(), dynamicPaint_generateBakeData(), dynamicPaint_Modifier_apply(), dynamicPaint_outputSurfaceImage(), dynamicPaint_paintMesh(), dynamicPaint_paintParticles(), dynamicPaint_paintSinglePoint(), dynamicPaint_prepareAdjacencyData(), dynamicPaint_prepareEffectStep(), dynamicPaint_setInitialColor(), dynamics_step(), foreach_grid_coordinate(), foreach_mouse_hit_key(), blender::bke::subdiv::foreach_subdiv_geometry(), get_vert2geom_distance(), lattice_deform_coords_impl(), lineart_build_edge_neighbor(), lineart_geometry_object_load(), lineart_main_transform_and_add_shadow(), blender::ed::sculpt_paint::load_tex(), blender::ed::sculpt_paint::load_tex_cursor(), meshdeformModifier_do(), modify_mesh(), non_recursive_bvh_div_nodes(), paint_2d_op(), PE_apply_lengths(), pe_deflect_emitter(), pe_iterate_lengths(), psys_cache_edit_paths(), shrinkwrap_calc_nearest_surface_point(), shrinkwrap_calc_nearest_vertex(), shrinkwrap_calc_normal_projection(), SimpleDeformModifier_do(), surfacedeformBind(), surfacedeformModifier_do(), surfaceGenerateGrid(), and TEST().

◆ BLI_task_parallel_thread_id()

int BLI_task_parallel_thread_id ( const TaskParallelTLS * tls)

Don't use this, store any thread specific data in tls->userdata_chunk instead. Only here for code to be removed.

Definition at line 139 of file task_range.cc.

References atomic_fetch_and_add_int32(), BLENDER_MAX_THREADS, and BLI_assert_msg.

Referenced by brush_add_count_iter(), blender::ed::sculpt_paint::calc_brush_texture_factors(), blender::ed::sculpt_paint::calc_brush_texture_factors(), and blender::ed::sculpt_paint::load_tex_task_cb_ex().