Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <b.mont29@gmail.com>2019-11-25 21:53:17 +0300
committerBastien Montagne <b.mont29@gmail.com>2019-11-25 21:54:40 +0300
commit3f87ac368483f0dcf86a1e3057ce8a6fbbe702ac (patch)
tree41a77f2a782ea2a841c511a4d934b90774e9fef7 /tests/gtests/blenlib/BLI_task_performance_test.cc
parent52f0d685ba9f33c559e1945c0e8c8d50d2447ffe (diff)
Revert "BLI_task: Add pooled threaded index range iterator."
This reverts commit f9028a3be1f77c01edca44a68894e2ba9d9cfb14. This is giving weird heisenbug crash on only Windows release builds... Reverting until we understand to issue.
Diffstat (limited to 'tests/gtests/blenlib/BLI_task_performance_test.cc')
-rw-r--r--tests/gtests/blenlib/BLI_task_performance_test.cc90
1 files changed, 2 insertions, 88 deletions
diff --git a/tests/gtests/blenlib/BLI_task_performance_test.cc b/tests/gtests/blenlib/BLI_task_performance_test.cc
index 84b7b8b6439..dc8981f8064 100644
--- a/tests/gtests/blenlib/BLI_task_performance_test.cc
+++ b/tests/gtests/blenlib/BLI_task_performance_test.cc
@@ -19,6 +19,8 @@ extern "C" {
#include "MEM_guardedalloc.h"
}
+/* *** Parallel iterations over double-linked list items. *** */
+
#define NUM_RUN_AVERAGED 100
static uint gen_pseudo_random_number(uint num)
@@ -36,94 +38,6 @@ static uint gen_pseudo_random_number(uint num)
return ((num & 255) << 6) + 1;
}
-/* *** Parallel iterations over range of indices. *** */
-
-static void task_parallel_range_func(void *UNUSED(userdata),
- int index,
- const TaskParallelTLS *__restrict UNUSED(tls))
-{
- const uint limit = gen_pseudo_random_number((uint)index);
- for (uint i = (uint)index; i < limit;) {
- i += gen_pseudo_random_number(i);
- }
-}
-
-static void task_parallel_range_test_do(const char *id,
- const int num_items,
- const bool use_threads)
-{
- TaskParallelSettings settings;
- BLI_parallel_range_settings_defaults(&settings);
- settings.use_threading = use_threads;
-
- double averaged_timing = 0.0;
- for (int i = 0; i < NUM_RUN_AVERAGED; i++) {
- const double init_time = PIL_check_seconds_timer();
- for (int j = 0; j < 10; j++) {
- BLI_task_parallel_range(i + j, i + j + num_items, NULL, task_parallel_range_func, &settings);
- }
- averaged_timing += PIL_check_seconds_timer() - init_time;
- }
-
- printf("\t%s: non-pooled done in %fs on average over %d runs\n",
- id,
- averaged_timing / NUM_RUN_AVERAGED,
- NUM_RUN_AVERAGED);
-
- averaged_timing = 0.0;
- for (int i = 0; i < NUM_RUN_AVERAGED; i++) {
- const double init_time = PIL_check_seconds_timer();
- TaskParallelRangePool *range_pool = BLI_task_parallel_range_pool_init(&settings);
- for (int j = 0; j < 10; j++) {
- BLI_task_parallel_range_pool_push(
- range_pool, i + j, i + j + num_items, NULL, task_parallel_range_func, &settings);
- }
- BLI_task_parallel_range_pool_work_and_wait(range_pool);
- BLI_task_parallel_range_pool_free(range_pool);
- averaged_timing += PIL_check_seconds_timer() - init_time;
- }
-
- printf("\t%s: pooled done in %fs on average over %d runs\n",
- id,
- averaged_timing / NUM_RUN_AVERAGED,
- NUM_RUN_AVERAGED);
-}
-
-TEST(task, RangeIter10KNoThread)
-{
- task_parallel_range_test_do(
- "Range parallel iteration - Single thread - 10K items", 10000, false);
-}
-
-TEST(task, RangeIter10k)
-{
- task_parallel_range_test_do("Range parallel iteration - Threaded - 10K items", 10000, true);
-}
-
-TEST(task, RangeIter100KNoThread)
-{
- task_parallel_range_test_do(
- "Range parallel iteration - Single thread - 100K items", 100000, false);
-}
-
-TEST(task, RangeIter100k)
-{
- task_parallel_range_test_do("Range parallel iteration - Threaded - 100K items", 100000, true);
-}
-
-TEST(task, RangeIter1000KNoThread)
-{
- task_parallel_range_test_do(
- "Range parallel iteration - Single thread - 1000K items", 1000000, false);
-}
-
-TEST(task, RangeIter1000k)
-{
- task_parallel_range_test_do("Range parallel iteration - Threaded - 1000K items", 1000000, true);
-}
-
-/* *** Parallel iterations over double-linked list items. *** */
-
static void task_listbase_light_iter_func(void *UNUSED(userdata),
void *item,
int index,