Commit Graph

8040 Commits

Author SHA1 Message Date
Kenneth Moreland
4a7aae86f9 Allow Variant to be trivial
Although `vtkm::internal::Variant` respected the trivially copyable
attribute of the types it contains, it was never totally trivial (i.e.
`std::is_trivial<Variant<...>>` was never true). The reason was that
`Variant` was initializing its `Index` parameter to signify that it was
not initialized. However, the fact that `Index` was initialized meant
that it was not trivially constructed.

Now, `Variant` type checks its types to see if they are all trivially
constructible. If so, it makes itself trivially constructible.

This means that `Index` may or may not be valid if `Variant` is
constructed without an argument. This in turn means that the result of
`Variant::IsValid` becomes undefined. That should be OK in practice.
`Index` will "point" to an uninitialized object, but that object is
trivially constructed anyway. However, that could cause problems if
developers used `IsValid` to determine if something is selected.
2020-09-22 16:22:37 -06:00
Kenneth Moreland
819d5f043b Merge topic 'refactor/exterminate-row-col-slice'
1074c0172 Commented out incomplete code creating a warning
ce0aa1cf9 Fix compile errors
edd71539c Fix compile error due to renamed includes
33a7f5610 Added missing this-> for data members
b443fb500 Added note for future reference during API refactoring
b6343c049 Applied Ken Moreland's suggested fix to avoid copy
af697e452 Use std::swap instead of manual swap
8489a69c3 Fixed missing invoker compile error
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !2263
2020-09-22 11:16:54 -04:00
Gunther H. Weber
1074c0172b Commented out incomplete code creating a warning 2020-09-18 06:33:09 -07:00
Gunther H. Weber
ce0aa1cf94 Fix compile errors 2020-09-17 05:42:41 -07:00
Gunther H. Weber
edd71539c9 Fix compile error due to renamed includes 2020-09-17 05:39:14 -07:00
Gunther H. Weber
33a7f5610d Added missing this-> for data members 2020-09-16 12:42:30 -07:00
Gunther H. Weber
b443fb500e Added note for future reference during API refactoring 2020-09-16 12:36:14 -07:00
Gunther H. Weber
b6343c049c Applied Ken Moreland's suggested fix to avoid copy 2020-09-16 12:36:08 -07:00
Gunther H. Weber
af697e4527 Use std::swap instead of manual swap 2020-09-15 13:46:11 -07:00
Gunther H. Weber
8489a69c39 Fixed missing invoker compile error 2020-09-15 12:55:24 -07:00
Gunther H. Weber
991f7a85ad Refactor mesh classes: switch from row/col/slice to vtkm::Id2/Id3 2020-09-15 11:15:27 -07:00
Kenneth Moreland
d00071b4e1 Merge topic 'no-colortable-hxx'
2e918c58d Move ColorTable mapping to its own header
38bdfec40 Move ColorTable::Sample methods to vtkm_cont

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2262
2020-09-15 08:39:53 -04:00
Kenneth Moreland
2e918c58dc Move ColorTable mapping to its own header
We would really like to be able to include `vtkm::cont::ColorTable` in
such a way that you don't have to compile device code (unless you are
actually compiling functions for the device). Thus, the `Map` functions
of `ColorTable` were in a special `ColorTable.hxx` that contains the
"implementation" for `ColorTable`.

That is confusing to many users. It is more clear to simply have `.h`
headers that do a specific thing. To achieve these two goals, the `Map`
functionality of `ColorTable` is separated out into its own header file.
So you don't need to be using a device compiler just to use `ColorTable`
(including `ColorTable.h`), but you do need to use a device compiler if
mapping values to colors (including `ColorTableMap.h`).
2020-09-14 16:40:26 -06:00
Kenneth Moreland
38bdfec40a Move ColorTable::Sample methods to vtkm_cont
There is little value to declare them `inline`. Instead, just have them
compiled once in the `vtkm_cont` library.
2020-09-14 16:40:26 -06:00
Kenneth Moreland
0457427ed7 Merge topic 'color-table-no-virtual'
6a3ba4291 Fix warning about unused function
c6a4f9b79 Fix warning about return value
9465d2611 Adjust TransferFunction worklet to get color table as ExecObj argument
11996f133 Remove virtual methods from ColorTable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2261
2020-09-14 17:56:51 -04:00
Kenneth Moreland
6a3ba4291b Fix warning about unused function 2020-09-14 15:26:43 -06:00
Kenneth Moreland
c6a4f9b79c Fix warning about return value 2020-09-14 15:04:03 -06:00
Kenneth Moreland
9465d26110 Adjust TransferFunction worklet to get color table as ExecObj argument
Previously, the `TransferFunction` worklet required you to call
`PrepareForExecution` on the `ColorTable` and give that to the
constructor. Bad things can happen if the `ColorTable` used in the
constructor does not match the device the worklet actually gets invoked
on. Change this to make the `ColorTable` a worklet argument of type
`ExecObj`. The dispatcher will automatically call
`ColorTable::PrepareForInput` and guarantee that the devices match.
2020-09-14 13:38:25 -06:00
Kenneth Moreland
11996f133f Remove virtual methods from ColorTable
Virtual methods are being deprecated, so remove their use from the
ColorTable classes. Instead of using a virtual method to look up a value
in the ColorTable, we essentially use a switch statement. This change
also simplified the code quite a bit.

The execution object used to use pointers to handle the virtual objects.
That is no longer necessary, so a simple `vtkm::exec::ColorTable` is
returned for execution objects. (Note that this `ColorTable` contains
pointers that are specific for the particular device.) This is a non-
backward compabible change. However, the only place (outside of the
`ColorTable` implementation itself) was a single worklet for converting
scalars to colors (`vtkm::worklet::colorconversion::TransferFunction`).
This is unlikely to affect anyone.

I also "fixed" some names in enum structs. There has been some
inconsistencies in VTK-m on whether items in an enum struct are
capitolized or camel case. We seem to moving toward camel case, so
deprecate some old names.
2020-09-14 13:26:16 -06:00
Ben Boeckel
c0caf4fa95 Merge topic 'warnings-from-vtk'
482266b44 Particle: explicitly make the copy ctor and assignment op
1037aa756 AssignerPartitionedDataSet: mark dtor as override

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2259
2020-09-14 13:16:18 -04:00
Kenneth Moreland
0e6529eb34 Merge topic 'unknownarray-variable-vec'
9b62c9eef Enable storing variable-sized Vecs in UnknownArrayHandle

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2260
2020-09-14 13:06:17 -04:00
Ben Boeckel
482266b442 Particle: explicitly make the copy ctor and assignment op
They are disabled because we have a custom destructor.
2020-09-14 10:47:42 -04:00
Kenneth Moreland
9b62c9eef1 Enable storing variable-sized Vecs in UnknownArrayHandle
One of the features of `UnknownArrayHandle` is that it allows you to
query how many `Vec` components each value has without resolve the type
of the array. The functionality to implement this failed if you tried to
store an `ArrayHandle` that stored `Vec`-like objects with `Vec` sizes
that varied from value to value (i.e. an `ArrayHandleGroupVecVariable`).

Storing such an array in `UnknownArrayHandle` might not be the best
idea, but it should probably work. This change allows you to store such
an array. If you try to query the number of components, you will get 0.
2020-09-14 08:39:27 -06:00
Kenneth Moreland
fbb69b7655 Merge topic 'deprecate-arrayhandlevirtual'
e706880d7 Fix unnecessary deprecation warnings in visual studio
f7cc03107 Fix deprecated warnings
b27e4c7ea Ignore files for deprecated virtual classes for SourceInInstall test
284774cf4 Turn on "no virtual" option on some CI builds
cd08fd499 Add changelog for removing virtual methods
63ef84ed7 Optionally remove all use of ArrayHandleVirtual
e11f612ad Deprecate ArrayHandleVirtual

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2256
2020-09-10 14:32:40 -04:00
Kenneth Moreland
6c383b0a73 Merge topic 'unknown-array-dynamic-transfer'
78c7909c8 Enable automatic transformation of Unknown/UncertainArrayHandle

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2258
2020-09-10 12:41:50 -04:00
Ben Boeckel
1037aa756e AssignerPartitionedDataSet: mark dtor as override 2020-09-10 10:03:18 -04:00
Nickolas Davis
02db46b20f Merge topic 'ipx-iris-fix-warnings'
843307bcf fix floating point casting warning in worklet test
18263a37a update float casting to not have warnings on iris
89cf93a66 fix OpenMP PRAGMA warnings for auto-associated looping variable types

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2245
2020-09-09 11:34:28 -04:00
Kenneth Moreland
78c7909c84 Enable automatic transformation of Unknown/UncertainArrayHandle 2020-09-09 07:03:34 -06:00
Kenneth Moreland
e706880d7b Fix unnecessary deprecation warnings in visual studio
When using a deprecated `ArrayHandle`, you should get the warning when
you declare it, not when it's used in a templated class or method.
2020-09-09 06:13:08 -06:00
Kenneth Moreland
f7cc03107d Fix deprecated warnings
Supress the deprecated class warnings for the implementation of
deprecated features.
2020-09-09 06:13:07 -06:00
Kenneth Moreland
b27e4c7ea6 Ignore files for deprecated virtual classes for SourceInInstall test
If `VTKm_NO_DEPRECATED_VIRTUAL` is on, then these classes are not
installed. Thus, add exceptions for these files to avoid test failures.

We could get fancier by only checking if `VTKm_NO_DEPRECATED_VIRTUAL` is
off, but that seems heavy-handed to make a regression test for something
that will go away.

These exceptions should be removed once the files are removed.
2020-09-09 06:13:07 -06:00
Kenneth Moreland
284774cf43 Turn on "no virtual" option on some CI builds
Make sure that the `VTKm_NO_DEPRECATED_VIRTUAL` CMake option is building
correctly by adding it to some of the CI builds.
2020-09-09 06:12:58 -06:00
nadavi
843307bcf7 fix floating point casting warning in worklet test 2020-09-08 17:47:53 +00:00
nadavi
18263a37ac update float casting to not have warnings on iris 2020-09-08 17:47:53 +00:00
nadavi
89cf93a66b fix OpenMP PRAGMA warnings for auto-associated looping variable types 2020-09-08 17:47:53 +00:00
Kenneth Moreland
cd08fd4995 Add changelog for removing virtual methods
The changelog is not quite accurate because it is claiming that all
virtual methods are removed when that is not quite the case.
Hopefully soon the changelog text will be accurate.
2020-09-04 22:52:45 -06:00
Kenneth Moreland
63ef84ed78 Optionally remove all use of ArrayHandleVirtual
As we remove more and more virtual methods from VTK-m, I expect several
users will be interested in completely removing them from the build for
several reasons.

1. They may be compiling for hardware that does not support virtual
methods.
2. They may need to compile for CUDA but need shared libraries.
3. It should go a bit faster.

To enable this, a CMake option named `VTKm_NO_DEPRECATED_VIRTUAL` is
added. It defaults to `OFF`. But when it is `ON`, none of the code that
both uses virtuals and is deprecated will be built.

Currently, only `ArrayHandleVirtual` is deprecated, so the rest of the
virtual classes will still be built. As we move forward, more will be
removed until all virtual method functionality is removed.
2020-09-04 22:52:45 -06:00
Kenneth Moreland
e11f612add Deprecate ArrayHandleVirtual
Virtual methods in the execution environment are going away the next
major release of VTK-m, so deprecate their use in preparation for that.
2020-09-04 22:52:45 -06:00
Kenneth Moreland
06579aac8c Merge topic 'replace-variantarrayhandle-impl'
386301719 Test UnknownArrayHandle behavior on special arrays
872da1f8e Suppress unnecessary deprecation warnings on VS
bb443bbc2 Replace the implementation of VariantArrayHandle

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2255
2020-09-05 00:32:16 -04:00
Vicente Bolea
8c5fca6d2c Merge topic 'adding-vtkm-vec'
fb919e048 vtkm::Vec: added unrolled arithmetic operators overload

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2252
2020-09-04 12:21:45 -04:00
Vicente Adolfo Bolea Sanchez
fb919e048e vtkm::Vec: added unrolled arithmetic operators overload
Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2020-09-03 16:10:15 -04:00
Kenneth Moreland
3863017190 Test UnknownArrayHandle behavior on special arrays
`UnknownArrayHandle` has special behavior when putting in or getting out
an `ArrayHandleMultiplexer` or an `ArrayHandleCast`. When putting in
either of these, `UnknownArrayHandle` gets the actual array stored in
the multiplexer and cast so that you can later retrieve the base array.
Likewise, when you get the array out with `AsArrayHandle`, you can give
it an `ArrayHandleCast` or `ArrayHandleMultiplexer`, and you will get
the base array placed inside of it.
2020-09-03 09:13:01 -06:00
Kenneth Moreland
872da1f8e6 Suppress unnecessary deprecation warnings on VS
The Visual Studio compiler has an annoying habit where if you use a
templated class or method with a deprecated class as a template
parameter, you will get a deprecation warning where that class is used
in the templated thing. Thus, if you want to suppress the warning, you
have to supress every instance of the template, not just where the
template is declared.

This is annoying behavior that is thankfully not replicated in other
compilers.
2020-09-02 16:48:11 -06:00
Kenneth Moreland
bb443bbc24 Replace the implementation of VariantArrayHandle
The implementation of `VariantArrayHandle` has been changed to be a
relatively trivial subclass of `UnknownArrayHandle`.

The advantage of this change is twofold. First, it removes
`VariantArrayHandle`'s dependence on `ArrayHandleVirtual`, which gets us
much closer to deprecating that class. Second, it ensures that
`UnknownArrayHandle` is a reasonable replacement for
`VariantArrayHandle`, so we can move forward with replacing that.
2020-09-02 15:02:44 -06:00
Kenneth Moreland
278ab6c504 Merge topic 'vtk-files-no-cells'
66a4a23eb Fix issue of getting pointer from std::vector of size 0
3f8da6e7e Fix some debugging code that should not have been there
52cecefba Fix crash when loading poly data with no cells

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2254
2020-09-02 14:46:43 -04:00
Kenneth Moreland
66a4a23ebf Fix issue of getting pointer from std::vector of size 0
C++11 introduced the `std::vector::data()` method. In addition to being
more syntatically pleasing, it should correctly handle the condition
when the `std::vector` is size 0 and therefore has no real pointer.
(Expressions like `&v[0]` are undefined when the `vector` is empty.)
2020-09-02 12:04:34 -06:00
Kenneth Moreland
3f8da6e7e1 Fix some debugging code that should not have been there 2020-09-01 14:21:09 -06:00
Kenneth Moreland
52cecefba0 Fix crash when loading poly data with no cells 2020-09-01 14:20:11 -06:00
Kenneth Moreland
3e398bbb3d Merge topic 'reverse-arrayhandle-deepcopy-pattern'
5250c28ff Swap call pattern of ArrayHandle::DeepCopy

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Allison Vacanti <alliepiper16@gmail.com>
Merge-request: !2253
2020-09-01 15:04:40 -04:00
Kenneth Moreland
5250c28ff2 Swap call pattern of ArrayHandle::DeepCopy
The new method `ArrayHandle::DeepCopy` had the pattern such that the
data in the `this` array was pushed to the provided destination array.
However, this is the opposite pattern used in the equivalent method in
VTK, which takes the data from the provided array and copies it to
`this` array.

So, swap the pattern to match that of VTK. Also, make the method name
more descriptive by renaming it to `DeepCopyFrom`. Hopefully, users will
read that to mean given the `ArrayHandle`, you copy data from the other
provided `ArrayHandle`.
2020-09-01 10:08:06 -06:00