Commit Graph

2807 Commits

Author SHA1 Message Date
Kenneth Moreland
55143ef894 Merge topic 'better-deprecated-headers'
5cb9792bd SurfaceNormal -> SurfaceNormals
b2947a1d7 Improve deprecation support of CellMeasures
5b7893a3f Support deprecated MeshQuality features
d22a509b5 Split CoordinateSystemTransform.h
c238cfea5 Improve deprecation support for moved or renamed headers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2718
2022-03-04 14:40:29 -05:00
Vicente Adolfo Bolea Sanchez
26c8252dc5 Loguru: encapsulate loguru 2022-02-17 16:03:23 -05:00
Vicente Adolfo Bolea Sanchez
65063ca485 Logging: avoid reinit loguru 2022-02-17 16:03:23 -05:00
Kenneth Moreland
c238cfea50 Improve deprecation support for moved or renamed headers
VTK-m has a deprecation method that supports API changes in minor
releases. When an API change is made, the old API is marked with the
VTKM_DEPRECATED macro. If code attempts to use the old API, it still
works, but the compiler issues a warning that the thing is deprecated
and where to find the new API.

We have recently run into an issue when the API changes have a header
file renamed or moved. We still keep the old header file with the old
API, so code including that file will still work. However, sometimes
code expected the contents of that header file without directly
including that header file. In these cases, the code could get an error
about missing classes.

As an example, consider the change from `DynamicCellSet` to
`UnknownCellSet`/`UncertainCellSet`. The deprecated `DynamicCellSet` is
still around. But there is a lot of code that did not directly include
DynamicCellSet.h. This header file was necessarily included by
DataSet.h. Now, when this code uses `vtkm::cont::DynamicCellSet`, you
get a confusing error that the class does not exist. Backward
compatibility broken.

In response to this, we should be more careful about where we put the
deprecated API. Instead of containing the deprecated API, moved headers
should be empty except for a warning and an inclusion of the new header
file. The deprecated API should be moved to the new header file. For
example, in the case of `DynamicCellSet`, the implementation for the
deprecated `DynamicCellSet` is moved to UnknownCellSet.h, which is
included by anything that was including DynamicCellSet.h before.
2022-02-16 07:08:05 -07:00
Li-Ta Lo
f09032aaaf migrate geometry refinement filters 2022-02-11 20:52:43 -07:00
Kenneth Moreland
eb48d65399 Merge topic 'less-brigand'
8cca11601 Limit size of vtkm::List
9a94270e9 Better implementation of ListAt
ae28519af Fix ICE in MSVC 2017
878e56d97 Reduce the size of lists used when serializing UnknownArrayHandle
18c4b3258 Remove brigand from List.h

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Vicente Bolea <vicente.bolea@kitware.com>
Merge-request: !2700
2022-02-10 20:36:50 -05:00
Kenneth Moreland
8cca116013 Limit size of vtkm::List
If you have a really long list, compilers might error out if you have a
recursive operation on it. Such an error can be confusing, so for now
create an error if the list is too long.
2022-02-10 15:50:31 -07:00
Li-Ta Lo
d41e1e40f0 remove ALL_BACKENDS 2022-02-09 16:15:08 -07:00
Li-Ta Lo
b0452edf57 remove operator=(const&) = default 2022-02-08 17:53:14 -07:00
Kenneth Moreland
878e56d974 Reduce the size of lists used when serializing UnknownArrayHandle
To serialize an `UnknownArrayHandle`, a pair of lists were created to
specify all possible value and storage types. These were then used in an
`UncertainArrayHandle::CastAndCall`, which would in turn take the cross
of these two lists. This resulted in a _really_ long list that gave
compilers trouble.

Reduce the size of the list by separating out value types by the number
of components, which can be easily deduced.
2022-02-03 11:55:37 -07:00
Kenneth Moreland
18c4b3258b Remove brigand from List.h
The brigand third party library has become more problematic as we move
forward. Replace the use of brigand in List.h with our own
implementation.
2022-02-03 11:53:27 -07:00
Kenneth Moreland
8ae8394690 Merge topic 'fix-inefficient-component-extract'
9e0a38f5d Remove unused typedef
5063527bb Document that an inefficient component extract warning is expected
e16fa28d6 Fix range warning in ArrayHandleCast
2aed0b81c Avoid inefficient component extractions in serialization test
c3b6febb2 Fix ArrayHandleMultiplexer exec test
4b30939dd Fix inefficient copy when extracting rectilinear grids

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2697
2022-02-02 16:56:23 -05:00
Kenneth Moreland
9e0a38f5db Remove unused typedef
The `StorageListEfficientExtract` type is never used in
`UnitTestSerializationArrayHandle`. Although these types are used,
because they all support efficient component extraction from the array,
there is no need to treat them special. As such, this list was never
used.
2022-02-02 08:13:33 -07:00
Kenneth Moreland
5063527bb7 Document that an inefficient component extract warning is expected
When calling `ArrayExtractComponent`, some arrays cannot really have a
component extracted. In this case there is a fallback and a warning is
generated.

Of course it is good to test this behavior. The
`UnitTestArrayExtractComponent` does test this and as such generates
this warning (intentionally). Add a note to the output that this warning
is expected.
2022-02-01 15:25:40 -07:00
Kenneth Moreland
e16fa28d6d Fix range warning in ArrayHandleCast
`ArrayHandleCast` was giving warnings about casting to a type that could
not hold the range to the source even when that was not true. The
problem was it was using `std::numeric_limits::min` for the lower end of
the range. But for floating point values, `min` is not really `min`.
Rather, it is the smallest representable number. (This is probably a C++
bug we are stuck with.) You really need to use `lowest`.
2022-02-01 11:42:16 -07:00
Kenneth Moreland
2aed0b81c3 Avoid inefficient component extractions in serialization test
The actually serialization was not doing any inefficient component
extraction, but the array handle comparisons were. This made it hard to
verify that the actual serialization was not being slow. Fixed the
comparison to make sure that it only used efficient paths.
2022-02-01 10:58:55 -07:00
Kenneth Moreland
c3b6febb27 Fix ArrayHandleMultiplexer exec test
One of the tests was to make sure that the `ArrayHandleMultiplexer` is
working in the exec environment. It was doing this with an `ArrayCopy`.
However, the `ArrayCopy` was falling back to the host, so the test was
not doing what was expected.

Now use `DeviceAdapterAlgorithm::Copy` to force the array to work on the
device.
2022-02-01 09:28:43 -07:00
Li-Ta Lo
8113d15ef7 Merge branch 'master' into field_conversion
# Conflicts:
#	benchmarking/BenchmarkFilters.cxx
#	vtkm/filter/CMakeLists.txt
#	vtkm/filter/testing/UnitTestSplitSharpEdgesFilter.cxx
2022-01-31 14:08:02 -07:00
Kenneth Moreland
45e9b7fa76 Merge topic 'vectraits-range'
ca032801a Allow ArrayExtractComponent to work with Vec-like value types
f48b4b761 Add implementation of VecTraits for Range and Bounds

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Gunther Weber <ghweber@lbl.gov>
Merge-request: !2683
2022-01-31 10:15:12 -05:00
Li-Ta Lo
f08a3185f8 Migrate FieldConversion filters 2022-01-29 13:12:01 -07:00
Kenneth Moreland
5bd60a0b77 Add CreateResult to NewFilter and absorb field mapping
The original version of `Filter` classes had a helper header file named
`CreateResult.h` that had several forms of a `CreateResult` function that
helped correctly create the `DataSet` to be returned from a filter's
`DoExecute`. With the move to the `NewFilter` structure, these functions
did not line up very well with how `DataSet`s should actually be created.

A replacement for these functions have been added as protected helper
methods to `NewFilter` and `NewFilterField`. In addition to moving them
into the filter themselves, the behavior of `CreateResult` has been merged
with the map field to output functionality. The original implementation of
`Filter` did this mapping internally in a different step. The first design
of `NewFilter` required the filter implementer to call a
`MapFieldsOntoOutput` themselves. This new implementation wraps the
functionality of `CreateResult` and `MapFieldsOntoOutput` together so that
the `DataSet` will be created correctly with a single call to
`CreateResult`. This makes it easier to correctly create the output.
2022-01-27 13:27:39 -07:00
Kenneth Moreland
ca032801a8 Allow ArrayExtractComponent to work with Vec-like value types
Before, `ArrayExtractComponent` only worked with `Vec` types. Anything
that was not specifically a `Vec` was assumed to be a basic component
even if it had `VecTraits`. This was changed to extract components out
of anything that has `VecTraits`. The assumption is that all components
of the Vec-like object are packed tightly in the object.

This allows `ArrayExtractComponent` to work with objects like
`vtkm::Range` and `vtkm::Bounds` and extract their parts as expected.
2022-01-25 10:55:41 -07:00
Kenneth Moreland
170a10e4b4 Fix slow ArrayCopy calls
The `ArrayCopy` method has been changed to be precompiled. It handles
most standard array types. But there are some special `ArrayHandle`
types that are not correctly handled, and these go to a slow fallback.
Find places in the code that use that fallback and fix them.

There are also some instances of replacing an `ArrayHandleCounting` with
an `ArrayHandleIndex`. This change is probably not strictly necessary to
make the `ArrayCopy` faster, but when it can be used `ArrayHandleIndex`
is generally better.
2022-01-24 14:15:45 -07:00
Kenneth Moreland
9b017f4f95 Correct inefficient extract component for decorating arrays
Many arrays decorate other arrays but still allow an efficient component
extraction. However, the component can only be extracted if it can be
efficiently extracted from the array being decorated. In this case, the
array reported that it could efficiently extract even though it could
not.

Fixed this by having the `ArrayExtractComponentImpl` classes inherit
from the respective superclass. This will in turn inhert the
`ArrayExtractComponentImplInefficient` if it is the base class.
2022-01-24 12:17:23 -07:00
Kenneth Moreland
392d781359 Add ArrayCopy specialization for Counting and Permutation array
This required adding another source file.
2022-01-24 12:17:23 -07:00
Kenneth Moreland
f3c82bfea7 Add ArrayCopy fast paths
There are some common uses of `ArrayCopy` that don't use basic arrays.
Rather than move away from `ArrayCopy` for these use cases, compile a
special fast path for these cases.

This required some restructuring of the code to get the template
resolution to work correctly.
2022-01-24 12:17:23 -07:00
Kenneth Moreland
00609b0af2 Make ArrayCopy not depend on a device compiler
Rather than require `ArrayCopy` to create special versions of copy for
all arrays, use a precompiled versions. This should speed up compiles,
reduce the amount of code being generated, and require the device
compiler on fewer source files.

There are some cases where you still need to copy arrays that are not
well supported by the precompiled versions in `ArrayCopy`. (It will
always work, but the fallback is very slow.) In this case, you will want
to switch over to `ArrayCopyDevice`, which has the old behavior.
2022-01-24 12:17:23 -07:00
Kenneth Moreland
aefc753329 Implement permutation mapping in vtkm_cont
There was a precompiled version of mapping permutations in the
filter library. However, there are reasons to be able to copy
a permutation of an array outside of filters. So add the
capability to the more general filter library.
2022-01-24 12:17:23 -07:00
Kenneth Moreland
2b8d89fd50 Fix Fill for ArrayHandleView
The Fill method in the storage was filling the wrong buffers.
2022-01-24 12:17:23 -07:00
Julien Schueller
a6dcac2cb1 Fix build with MinGW
Co-authored-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2022-01-19 16:41:42 +00:00
Kenneth Moreland
e8a6d37190 Merge topic 'allocate-and-fill'
d7b4390d1 Specify end position when filling values in Buffer
7a4cbaf10 Suggestions during review by Gunther Weber
8e4fb7ebd Suppress unhelpful nvcc warning
bacca0693 Add Fill method for non-standard Storage
9da66ff32 Prefer ArrayHandle::Fill over Algorithm::Fill
f79cf1d5f Add BitField::Fill and BitField::AllocateAndFill
926164049 Add Fill and AllocateAndFill to ArrayHandle
0cf996f41 Add ability to fill values in a Buffer

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2660
2022-01-13 17:15:37 -05:00
Kenneth Moreland
bdb989df61 Merge topic 'more-efficient-merge-partitions'
10f21b21a Pre-allocate arrays for MergePartitionedDataSet

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Roxana Bujack <bujack@lanl.gov>
Merge-request: !2664
2022-01-13 09:04:37 -05:00
Kenneth Moreland
d7b4390d15 Specify end position when filling values in Buffer
This allows us to support `Fill` in `ArrayHandleView` and
`ArrayHandleReverse`.
2022-01-11 07:15:41 -07:00
Kenneth Moreland
7a4cbaf105 Suggestions during review by Gunther Weber 2022-01-10 08:17:41 -07:00
Kenneth Moreland
10f21b21ae Pre-allocate arrays for MergePartitionedDataSet
The initial implementation of `MergePartitionedDataSet` would grow each
array as it was generated. As each partition was revisited, the arrays
being merged would be reallocated and data appended to the end. Although
this works, it is slower than necessary. Each reallocation has to copy
the previously saved data into the newly allocated memory space.

This new implementation first counts how big each array should be and
then copies data from each partition into the appropriate location of
each dataset.

Also changed the templating of how fields are copied so that all field
types are supported, not just those in the common types.
2022-01-06 13:01:04 -07:00
Li-Ta Lo
e5639b1f91 Merge topic 'NewFilter'
0801b2423 add newline
c9b8a31b5 add NewFilterField.cxx so EXPORT_CORE would work
548df8436 add CORE_EXPORT
9ff52a98c Set default ActiveCoordinateSystemIndex to 0.
90992406f Merge branch 'NewFilter' of gitlab.kitware.com:ollielo/vtk-m into NewFilter
4a63b745a uniform treatment of primary/secondary field/coordinate_system
6461857e4 Merge branch 'master' into NewFilter
3720006d0 change based on code review
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2648
2022-01-06 09:31:25 -05:00
Kenneth Moreland
4650a1da96 Deprecate old methods from DynamicCellSet
The `DynamicCellSet` (and the related `DynamicCellSetBase`) are
deprecated and replaced with `UnknownCellSet` (and `UncertainCellSet`).
Thus, `UnknownCellSet` has some methods inherited from `DynamicCellSet`
but replaced with other functionality. These methods are now marked as
deprecated and their use is removed.
2022-01-05 08:18:17 -07:00
Kenneth Moreland
0b84787f78 Deprecate DynamicCellSet and remove from code
The `DynamicCellSet` class is now marked as deprecated (as is the header
that contains it), and all non-deprecated code is moved to its
`UnknownCellSet` replacement.

Also added a deprecation warning for the VariantArrayHandle.h header
file and deleted a couple inappropriate uses of it.
2022-01-04 15:38:18 -07:00
Kenneth Moreland
8e4fb7ebd0 Suppress unhelpful nvcc warning 2022-01-04 13:32:27 -07:00
Kenneth Moreland
de14629c1f Merge topic 'render-test-improvements'
1981f9061 Add secondary image for MapperConnectivity test
d4d1ef955 Add secondary image for MapperQuad test
54c1a85d0 Reduce templating in RenderTest code
c0fbe5f30 Remove antiquated templated render test functions
0fe9300ee Expand test_equal_images
12e116417 Redefine RenderTest interface for library
afa8c9082 Add struct for passing options to render tests
9173d6bba Rename RegressionTests to RenderTests
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Nickolas Davis <nadavi@sandia.gov>
Merge-request: !2657
2022-01-04 14:54:31 -05:00
Kenneth Moreland
bacca06934 Add Fill method for non-standard Storage
Also add test code for the Fill functionality in fancy `ArrayHandle`s.
2022-01-04 10:35:53 -07:00
Kenneth Moreland
9da66ff320 Prefer ArrayHandle::Fill over Algorithm::Fill 2022-01-04 08:50:57 -07:00
Kenneth Moreland
f79cf1d5f7 Add BitField::Fill and BitField::AllocateAndFill 2022-01-04 08:50:57 -07:00
Kenneth Moreland
926164049f Add Fill and AllocateAndFill to ArrayHandle
These allow you to create an `ArrayHandle` filled with an inital value
without having to compile code for the device.
2022-01-04 08:50:57 -07:00
Kenneth Moreland
0cf996f410 Add ability to fill values in a Buffer
This is in preparation to add a method to `ArrayHandle` that allows
initializing fill values.
2022-01-04 08:50:52 -07:00
Kenneth Moreland
2eabba3366 Merge topic 'get-value-fallback'
5b34e6f70 Better fallback for ArrayGetValue

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Li-Ta Lo <ollie@lanl.gov>
Merge-request: !2659
2022-01-04 10:09:00 -05:00
Li-Ta Lo
6461857e4e Merge branch 'master' into NewFilter 2022-01-04 07:54:04 -07:00
Kenneth Moreland
0a89a5fff5 Store UnknownCellSet instead of DynamicCellSet in DataSet
`UnknownCellSet` is an updated replacement for `DynamicCellSet`. The
next step in the replacement is to change `DataSet` to use the new
class.

Also replaced `DynamicCellSet` with `UnknownCellSet` in a few
places where `DynamicCellSet.h` was not directly included (and
therefore now no longer included at all). This change would have
to be made at some point anyway.
2022-01-03 13:52:30 -07:00
Kenneth Moreland
5b34e6f70b Better fallback for ArrayGetValue
To avoid having to use a device compiler every time you wish to use
`ArrayGetValue`, the actual implementation is compiled into the `vtkm_cont`
library. To allow this to work for all the templated versions of
`ArrayHandle`, the implementation uses the extract component features of
`UnknownArrayHandle`. This works for most common arrays, but not all
arrays.

For arrays that cannot be directly represented by an `ArrayHandleStride`,
the fallback is bad. The entire array has to be pulled to the host and then
copied serially to a basic array.

For `ArrayGetValue`, this is just silly. So, for arrays that cannot be
simply represented by `ArrayHandleStride`, make a fallback that just uses
`ReadPortal` to get the data. Often this is not the most efficient method,
but it is better than the current alternative.
2022-01-03 10:08:39 -07:00
Kenneth Moreland
a2ab460f5d Compile more sources without device compiler
We have been doing a better job at hiding device code (and moving code
into libraries). Smoke out source that no longer needs to be compiled by
device compilers.
2022-01-03 08:23:04 -07:00