[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [56929] trunk/blender/source/blender: code cleanup: replace PARALLEL define with _OPENMP
Campbell Barton
ideasman42 at gmail.com
Mon May 20 18:15:17 CEST 2013
Revision: 56929
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56929
Author: campbellbarton
Date: 2013-05-20 16:15:16 +0000 (Mon, 20 May 2013)
Log Message:
-----------
code cleanup: replace PARALLEL define with _OPENMP
Modified Paths:
--------------
trunk/blender/source/blender/blenkernel/CMakeLists.txt
trunk/blender/source/blender/blenkernel/SConscript
trunk/blender/source/blender/blenlib/CMakeLists.txt
trunk/blender/source/blender/blenlib/SConscript
trunk/blender/source/blender/blenlib/intern/threads.c
trunk/blender/source/blender/editors/physics/CMakeLists.txt
trunk/blender/source/blender/editors/physics/SConscript
trunk/blender/source/blender/editors/render/CMakeLists.txt
trunk/blender/source/blender/editors/render/SConscript
trunk/blender/source/blender/modifiers/CMakeLists.txt
Modified: trunk/blender/source/blender/blenkernel/CMakeLists.txt
===================================================================
--- trunk/blender/source/blender/blenkernel/CMakeLists.txt 2013-05-20 15:58:37 UTC (rev 56928)
+++ trunk/blender/source/blender/blenkernel/CMakeLists.txt 2013-05-20 16:15:16 UTC (rev 56929)
@@ -357,10 +357,6 @@
endif()
endif()
-if(WITH_OPENMP)
- add_definitions(-DPARALLEL=1)
-endif()
-
if(WITH_MOD_FLUID)
list(APPEND INC
../../../intern/elbeem/extern
Modified: trunk/blender/source/blender/blenkernel/SConscript
===================================================================
--- trunk/blender/source/blender/blenkernel/SConscript 2013-05-20 15:58:37 UTC (rev 56928)
+++ trunk/blender/source/blender/blenkernel/SConscript 2013-05-20 16:15:16 UTC (rev 56929)
@@ -114,10 +114,6 @@
if env['WITH_BF_BULLET']:
defs.append('WITH_BULLET')
-if env['OURPLATFORM'] == 'darwin':
- if env['WITH_BF_OPENMP']:
- defs.append('PARALLEL=1')
-
if env['WITH_BF_FLUID']:
defs.append('WITH_MOD_FLUID')
Modified: trunk/blender/source/blender/blenlib/CMakeLists.txt
===================================================================
--- trunk/blender/source/blender/blenlib/CMakeLists.txt 2013-05-20 15:58:37 UTC (rev 56928)
+++ trunk/blender/source/blender/blenlib/CMakeLists.txt 2013-05-20 16:15:16 UTC (rev 56929)
@@ -167,10 +167,6 @@
add_definitions(-DWITH_BINRELOC)
endif()
-if(WITH_OPENMP)
- add_definitions(-DPARALLEL=1)
-endif()
-
if(WIN32)
list(APPEND INC
../../../intern/utfconv
Modified: trunk/blender/source/blender/blenlib/SConscript
===================================================================
--- trunk/blender/source/blender/blenlib/SConscript 2013-05-20 15:58:37 UTC (rev 56928)
+++ trunk/blender/source/blender/blenlib/SConscript 2013-05-20 16:15:16 UTC (rev 56929)
@@ -50,8 +50,4 @@
if env['WITH_BF_OPENMP']:
incs += ' ' + env['BF_OPENMP_INC']
-if env['OURPLATFORM'] == 'darwin':
- if env['WITH_BF_OPENMP']:
- env.Append(CFLAGS=['-DPARALLEL=1'])
-
env.BlenderLib ( 'bf_blenlib', sources, Split(incs), Split(defs), libtype=['core','player'], priority = [370,230], compileflags =cflags )
Modified: trunk/blender/source/blender/blenlib/intern/threads.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/threads.c 2013-05-20 15:58:37 UTC (rev 56928)
+++ trunk/blender/source/blender/blenlib/intern/threads.c 2013-05-20 16:15:16 UTC (rev 56929)
@@ -53,7 +53,11 @@
# include <sys/time.h>
#endif
-#if defined(__APPLE__) && (PARALLEL == 1) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 2)
+#if defined(__APPLE__) && defined(_OPENMP) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 2)
+# define USE_APPLE_OMP_FIX
+#endif
+
+#ifdef USE_APPLE_OMP_FIX
/* ************** libgomp (Apple gcc 4.2.1) TLS bug workaround *************** */
extern pthread_key_t gomp_tls_key;
static void *thread_tls_data;
@@ -168,7 +172,7 @@
if (thread_levels == 0) {
MEM_set_lock_callback(BLI_lock_malloc_thread, BLI_unlock_malloc_thread);
-#if defined(__APPLE__) && (PARALLEL == 1) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 2)
+#ifdef USE_APPLE_OMP_FIX
/* workaround for Apple gcc 4.2.1 omp vs background thread bug,
* we copy gomp thread local storage pointer to setting it again
* inside the thread that we start */
@@ -209,7 +213,7 @@
{
ThreadSlot *tslot = (ThreadSlot *)tslot_p;
-#if defined(__APPLE__) && (PARALLEL == 1) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 2)
+#ifdef USE_APPLE_OMP_FIX
/* workaround for Apple gcc 4.2.1 omp vs background thread bug,
* set gomp thread local storage pointer which was copied beforehand */
pthread_setspecific(gomp_tls_key, thread_tls_data);
Modified: trunk/blender/source/blender/editors/physics/CMakeLists.txt
===================================================================
--- trunk/blender/source/blender/editors/physics/CMakeLists.txt 2013-05-20 15:58:37 UTC (rev 56928)
+++ trunk/blender/source/blender/editors/physics/CMakeLists.txt 2013-05-20 16:15:16 UTC (rev 56929)
@@ -54,10 +54,6 @@
add_definitions(-DWITH_MOD_FLUID)
endif()
-if(WITH_OPENMP)
- add_definitions(-DPARALLEL=1)
-endif()
-
if(WITH_INTERNATIONAL)
add_definitions(-DWITH_INTERNATIONAL)
endif()
Modified: trunk/blender/source/blender/editors/physics/SConscript
===================================================================
--- trunk/blender/source/blender/editors/physics/SConscript 2013-05-20 15:58:37 UTC (rev 56928)
+++ trunk/blender/source/blender/editors/physics/SConscript 2013-05-20 16:15:16 UTC (rev 56929)
@@ -44,10 +44,6 @@
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ' + env['BF_PTHREADS_INC']
-if env['OURPLATFORM'] == 'darwin':
- if env['WITH_BF_OPENMP']:
- defs.append('PARALLEL=1')
-
if env['WITH_BF_INTERNATIONAL']:
defs.append('WITH_INTERNATIONAL')
Modified: trunk/blender/source/blender/editors/render/CMakeLists.txt
===================================================================
--- trunk/blender/source/blender/editors/render/CMakeLists.txt 2013-05-20 15:58:37 UTC (rev 56928)
+++ trunk/blender/source/blender/editors/render/CMakeLists.txt 2013-05-20 16:15:16 UTC (rev 56929)
@@ -60,10 +60,6 @@
add_definitions(-DWITH_QUICKTIME)
endif()
-if(WITH_OPENMP)
- add_definitions(-DPARALLEL=1)
-endif()
-
if(WITH_HEADLESS)
add_definitions(-DWITH_HEADLESS)
endif()
Modified: trunk/blender/source/blender/editors/render/SConscript
===================================================================
--- trunk/blender/source/blender/editors/render/SConscript 2013-05-20 15:58:37 UTC (rev 56928)
+++ trunk/blender/source/blender/editors/render/SConscript 2013-05-20 16:15:16 UTC (rev 56929)
@@ -55,10 +55,6 @@
if env['USE_QTKIT']:
env.Append(CFLAGS=['-DUSE_QTKIT'])
-if env['OURPLATFORM'] == 'darwin':
- if env['WITH_BF_OPENMP']:
- env.Append(CFLAGS=['-DPARALLEL=1'])
-
if env['WITH_BF_INTERNATIONAL']:
defs.append('WITH_INTERNATIONAL')
Modified: trunk/blender/source/blender/modifiers/CMakeLists.txt
===================================================================
--- trunk/blender/source/blender/modifiers/CMakeLists.txt 2013-05-20 15:58:37 UTC (rev 56928)
+++ trunk/blender/source/blender/modifiers/CMakeLists.txt 2013-05-20 16:15:16 UTC (rev 56929)
@@ -146,8 +146,4 @@
add_definitions(-DWITH_INTERNATIONAL)
endif()
-if(WITH_OPENMP)
- add_definitions(-DPARALLEL=1)
-endif()
-
blender_add_lib(bf_modifiers "${SRC}" "${INC}" "${INC_SYS}")
More information about the Bf-blender-cvs
mailing list