Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Lucas Gandel
VTK
Commits
95aea46c
Commit
95aea46c
authored
Mar 02, 2015
by
Dave DeMarle
Browse files
Merge branch 'fix-smp-examples-atomics-new' into release
Change-Id: I385e9b1295eced295b8d2839259f902fd2714f9b
parents
8ef02395
485d1744
Changes
3
Hide whitespace changes
Inline
Side-by-side
Examples/ParallelProcessing/SMP/Cxx/vtkSMPMinMaxTree.cxx
View file @
95aea46c
#include
"vtkSMPMinMaxTree.h"
#include
"vtkConfigure.h"
#include
"vtkObjectFactory.h"
#include
"vtkIdList.h"
#include
"vtkGenericCell.h"
...
...
@@ -9,6 +10,49 @@
#include
"vtkSMPThreadLocal.h"
#include
"vtkSMPThreadLocalObject.h"
#if defined(__APPLE__)
# include <libkern/OSAtomic.h>
# define VTK_APPLE_ATOMIC
#endif
#if defined(_WIN32) && !defined(__MINGW32__)
# include "vtkWindows.h"
# define VTK_WINDOWS_ATOMIC
#endif
#if !defined(VTK_APPLE_ATOMIC) && !defined(VTK_WINDOWS_ATOMIC) &&\
!defined(VTK_HAVE_SYNC_BUILTINS)
# error "No built in support for atomic increment found."
#endif
#if defined(VTK_USE_64BIT_IDS) && !(VTK_SIZEOF_VOID_P == 8)
# error "No support for atomic increment on 64-bits vtkIdType."
#endif
inline
vtkIdType
AtomicIncrementAndFetch
(
vtkIdType
&
var
)
{
#if defined(VTK_HAVE_SYNC_BUILTINS)
return
__sync_add_and_fetch
(
&
var
,
1
);
#elif defined(VTK_APPLE_ATOMIC)
# ifdef VTK_USE_64BIT_IDS
return
OSAtomicIncrement64Barrier
(
&
var
);
# else
return
OSAtomicIncrement32Barrier
(
&
var
);
# endif
#elif defined(VTK_WINDOWS_ATOMIC)
# ifdef VTK_USE_64BIT_IDS
return
InterlockedIncrement64
(
&
var
);
# else
return
InterlockedIncrement32
(
&
var
);
# endif
#endif
}
namespace
{
...
...
@@ -78,7 +122,7 @@ namespace
while
(
index
)
{
index
=
(
index
-
1
)
/
this
->
BF
;
if
(
__sync_add_and_f
etch
(
&
(
this
->
Locks
[
index
])
,
1
)
!=
this
->
BF
)
if
(
AtomicIncrementAndF
etch
(
this
->
Locks
[
index
])
!=
this
->
BF
)
break
;
for
(
vtkIdType
i
=
index
*
this
->
BF
+
1
;
i
<
(
index
+
1
)
*
this
->
BF
&&
i
<
this
->
Max
;
++
i
)
{
...
...
Examples/ParallelProcessing/SMP/Cxx/vtkStreamedCompositeDataPipeline.h
View file @
95aea46c
...
...
@@ -8,7 +8,7 @@
class
vtkTimerLog
;
class
VTK
COMMONEXECUTIONMODEL
_EXPORT
vtkStreamedCompositeDataPipeline
:
class
VTK_EXPORT
vtkStreamedCompositeDataPipeline
:
public
vtkCompositeDataPipeline
{
//BTX
...
...
Examples/ParallelProcessing/SMP/Cxx/vtkStreamedCompositeSources.h
View file @
95aea46c
...
...
@@ -4,7 +4,7 @@
#include
"vtkCommonExecutionModelModule.h"
// For export macro
#include
"vtkStreamedCompositeDataPipeline.h"
class
VTK
COMMONEXECUTIONMODEL
_EXPORT
vtkStreamedCompositeSources
:
class
VTK_EXPORT
vtkStreamedCompositeSources
:
public
vtkStreamedCompositeDataPipeline
{
vtkStreamedCompositeSources
(
const
vtkStreamedCompositeSources
&
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment