vtk-m2/vtkm/rendering
Kenneth Moreland 28ecf3636d Change interface of atomic compare and swap
The old atomic compare and swap operations (`vtkm::AtomicCompareAndSwap`
and `vtkm::exec::AtomicArrayExecutionObject::CompareAndSwap`) had an
order of arguments that was confusing. The order of the arguments was
shared pointer (or index), desired value, expected value. Most people
probably assume expected value comes before desired value. And this
order conflicts with the order in the `std` methods, GCC atomics, and
Kokkos.

Change the interface of atomic operations to be patterned off the
`std::atomic_compare_exchange` and `std::atomic<T>::compare_exchange`
methods. First, these methods have a more intuitive order of parameters
(shared pointer, expected, desired). Second, rather than take a value
for the expected and return the actual old value, they take a pointer to
the expected value (or reference in `AtomicArrayExecutionObject`) and
modify this value in the case that it does not match the actual value.
This makes it harder to mix up the expected and desired parameters.
Also, because the methods return a bool indicating whether the value was
changed, there is an additional benefit that compare-exchange loops are
implemented easier.

For example, consider you want to apply the function `MyOp` on a
`sharedValue` atomically. With the old interface, you would have to do
something like this.

```cpp
T oldValue;
T newValue;
do
{
  oldValue = *sharedValue;
  newValue = MyOp(oldValue);
} while (vtkm::AtomicCompareAndSwap(sharedValue, newValue, oldValue) != oldValue);
```

With the new interface, this is simplfied to this.

```cpp
T oldValue = *sharedValue;
while (!vtkm::AtomicCompareExchange(sharedValue, &oldValue, MyOp(oldValue));
```
2020-10-20 08:39:22 -06:00
..
internal Update VTK-m code to use new Vec aliases 2019-07-31 12:55:40 -06:00
raytracing clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
testing Simplify getting test file names 2020-08-25 06:17:59 -06:00
Actor.cxx Remove virtual methods from ColorTable 2020-09-14 13:26:16 -06:00
Actor.h conslidate the license statement 2019-04-17 10:57:13 -06:00
AxisAnnotation2D.cxx clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
AxisAnnotation2D.h conslidate the license statement 2019-04-17 10:57:13 -06:00
AxisAnnotation3D.cxx clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
AxisAnnotation3D.h Update VTK-m code to use new Vec aliases 2019-07-31 12:55:40 -06:00
AxisAnnotation.cxx clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
AxisAnnotation.h For VTK-m libs all includes of DeviceAdapterTagCuda happen from cuda files 2019-04-22 10:39:54 -04:00
BitmapFont.cxx conslidate the license statement 2019-04-17 10:57:13 -06:00
BitmapFont.h conslidate the license statement 2019-04-17 10:57:13 -06:00
BitmapFontFactory.cxx conslidate the license statement 2019-04-17 10:57:13 -06:00
BitmapFontFactory.h conslidate the license statement 2019-04-17 10:57:13 -06:00
BoundingBoxAnnotation.cxx clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
BoundingBoxAnnotation.h conslidate the license statement 2019-04-17 10:57:13 -06:00
Camera.cxx Update VTK-m code to use new Vec aliases 2019-07-31 12:55:40 -06:00
Camera.h Update VTK-m code to use new Vec aliases 2019-07-31 12:55:40 -06:00
Canvas.cxx Move ColorTable::Sample methods to vtkm_cont 2020-09-14 16:40:26 -06:00
Canvas.h Deprecate Camera::Activate() and Camera::Finish() 2020-06-14 11:04:06 -04:00
CanvasRayTracer.cxx clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
CanvasRayTracer.h conslidate the license statement 2019-04-17 10:57:13 -06:00
CMakeLists.txt removed classes related to OpenGL/OSMESA/EGL 2020-04-30 18:24:01 -04:00
Color.cxx conslidate the license statement 2019-04-17 10:57:13 -06:00
Color.h Update VTK-m code to use new Vec aliases 2019-07-31 12:55:40 -06:00
ColorBarAnnotation.cxx Remove virtual methods from ColorTable 2020-09-14 13:26:16 -06:00
ColorBarAnnotation.h conslidate the license statement 2019-04-17 10:57:13 -06:00
ColorLegendAnnotation.cxx clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
ColorLegendAnnotation.h conslidate the license statement 2019-04-17 10:57:13 -06:00
ConnectivityProxy.cxx clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
ConnectivityProxy.h Longer fixed message 2020-03-06 09:25:50 -08:00
Cylinderizer.h Fix gaps in type support 2020-03-19 17:07:11 -06:00
DecodePNG.h Deprecate writer/ directory. 2020-04-29 11:11:02 -04:00
EncodePNG.h Deprecate writer/ directory. 2020-04-29 11:11:02 -04:00
LineRenderer.cxx Use new ways to get array portal in control environment 2020-02-26 13:10:46 -07:00
LineRenderer.h Update VTK-m code to use new Vec aliases 2019-07-31 12:55:40 -06:00
Mapper.cxx Move ColorTable::Sample methods to vtkm_cont 2020-09-14 16:40:26 -06:00
Mapper.h Fix warnings about overriding deprecated methods 2020-06-17 17:58:07 -06:00
MapperConnectivity.cxx clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
MapperConnectivity.h Fix warnings about overriding deprecated methods 2020-06-17 17:58:07 -06:00
MapperCylinder.cxx clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
MapperCylinder.h Fix warnings about overriding deprecated methods 2020-06-17 17:58:07 -06:00
MapperPoint.cxx clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
MapperPoint.h Fix warnings about overriding deprecated methods 2020-06-17 17:58:07 -06:00
MapperQuad.cxx clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
MapperQuad.h Fix warnings about overriding deprecated methods 2020-06-17 17:58:07 -06:00
MapperRayTracer.cxx clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
MapperRayTracer.h Fix warnings about overriding deprecated methods 2020-06-17 17:58:07 -06:00
MapperVolume.cxx clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
MapperVolume.h Fix warnings about overriding deprecated methods 2020-06-17 17:58:07 -06:00
MapperWireframer.cxx clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
MapperWireframer.h Fix warnings about overriding deprecated methods 2020-06-17 17:58:07 -06:00
MatrixHelpers.h Update VTK-m code to use new Vec aliases 2019-07-31 12:55:40 -06:00
Quadralizer.h Fix gaps in type support 2020-03-19 17:07:11 -06:00
ScalarRenderer.cxx clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
ScalarRenderer.h alter interface of scalar renderer result 2020-02-18 09:45:31 -08:00
Scene.cxx Deprecate StartScene() and EndScene() 2020-06-14 11:27:45 -04:00
Scene.h conslidate the license statement 2019-04-17 10:57:13 -06:00
TextAnnotation.cxx clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
TextAnnotation.h Update VTK-m code to use new Vec aliases 2019-07-31 12:55:40 -06:00
TextAnnotationBillboard.cxx clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
TextAnnotationBillboard.h Update VTK-m code to use new Vec aliases 2019-07-31 12:55:40 -06:00
TextAnnotationScreen.cxx clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
TextAnnotationScreen.h Update VTK-m code to use new Vec aliases 2019-07-31 12:55:40 -06:00
TextRenderer.cxx Fix deadlock in rendering 2020-02-26 13:10:49 -07:00
TextRenderer.h Update VTK-m code to use new Vec aliases 2019-07-31 12:55:40 -06:00
Texture2D.h clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
Triangulator.h Trivial typo fix. 2020-05-08 10:59:09 -04:00
View1D.cxx clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
View1D.h conslidate the license statement 2019-04-17 10:57:13 -06:00
View2D.cxx clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
View2D.h conslidate the license statement 2019-04-17 10:57:13 -06:00
View3D.cxx clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
View3D.h conslidate the license statement 2019-04-17 10:57:13 -06:00
View.cxx clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
View.h Add option to enable/disable world annotations. 2020-07-09 14:38:39 -04:00
Wireframer.h Change interface of atomic compare and swap 2020-10-20 08:39:22 -06:00
WorldAnnotator.cxx clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
WorldAnnotator.h Update VTK-m code to use new Vec aliases 2019-07-31 12:55:40 -06:00