From 625381509f7e71483ba9dc0eda9c88153cf7b245 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 29 Dec 2015 10:22:11 +1100 Subject: Building w/o OpenMP now works again rename define since its no longer OpenMP specific. --- source/blender/blenlib/intern/BLI_kdopbvh.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'source') diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index fb808ca32b5..d2fc5c7b72b 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -51,24 +51,18 @@ #include "BLI_strict_flags.h" #include "BLI_task.h" -#ifdef _OPENMP -#include -#endif - /* used for iterative_raycast */ // #define USE_SKIP_LINKS #define MAX_TREETYPE 32 -/* Setting zero so we can catch bugs in OpenMP/KDOPBVH. +/* Setting zero so we can catch bugs in BLI_task/KDOPBVH. * TODO(sergey): Deduplicate the limits with PBVH from BKE. */ -#ifdef _OPENMP -# ifdef DEBUG -# define KDOPBVH_OMP_LIMIT 0 -# else -# define KDOPBVH_OMP_LIMIT 1024 -# endif +#ifdef DEBUG +# define KDOPBVH_THREAD_LEAF_THRESHOLD 0 +#else +# define KDOPBVH_THREAD_LEAF_THRESHOLD 1024 #endif typedef unsigned char axis_t; @@ -880,7 +874,7 @@ static void non_recursive_bvh_div_nodes(BVHTree *tree, BVHNode *branches_array, cb_data.i = i; cb_data.depth = depth; - if (num_leafs > KDOPBVH_OMP_LIMIT) { + if (num_leafs > KDOPBVH_THREAD_LEAF_THRESHOLD) { BLI_task_parallel_range_ex(i, end_j, &cb_data, NULL, 0, non_recursive_bvh_div_nodes_task_cb, 0, false); } else { @@ -1272,7 +1266,7 @@ BVHTreeOverlap *BLI_bvhtree_overlap( data[j].thread = j; } - if (tree1->totleaf > KDOPBVH_OMP_LIMIT) { + if (tree1->totleaf > KDOPBVH_THREAD_LEAF_THRESHOLD) { BLI_task_parallel_range_ex(0, thread_num, data, NULL, 0, bvhtree_overlap_task_cb, 0, false); } else { @@ -1403,7 +1397,7 @@ POP_HEAP_BODY(NodeDistance, NodeDistance_priority, heap, heap_size) * It may make sense to use this function if the callback queries are very slow.. or if its impossible * to get a nice heuristic * - * this function uses "malloc/free" instead of the MEM_* because it intends to be openmp safe */ + * this function uses "malloc/free" instead of the MEM_* because it intends to be thread safe */ static void bfs_find_nearest(BVHNearestData *data, BVHNode *node) { int i; -- cgit v1.2.3