Commit Graph

6418 Commits

Author SHA1 Message Date
Kenneth Moreland
62c5095209 Save host portal for ArrayHandleVirtual in array instead of portal
Previously, when you got a host/control portal from
`ArrayHandleVirtual`, you got a version of an `ArrayPortal` that manged
its own reference to the virtual structure that was implementing the
portal. This was not done for device/execution portals because those
objects could not do the appropriate resource management from the
execution environment.

Rather than releasing the host object to the portal, keep the host
object managed by `StorageVirtual`. This allows the control and
execution portals to be the same type, which we will need to be friendly
with new array objects.
2020-11-30 16:40:28 -07:00
Kenneth Moreland
bc3a7d8e25 Restore composite of transform in UnitTestParticleDensity.cxx
Fixes #584
2020-11-30 16:40:28 -07:00
Sujin Philip
755b136354 Merge topic 'kokkos-use-explicit-syncs'
89e19ce7f Don't require CUDA_LAUNCH_BLOCKING

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2333
2020-11-30 14:28:20 -05:00
Sujin Philip
89e19ce7fa Don't require CUDA_LAUNCH_BLOCKING
1. The code now works without CUDA_LAUNCH_BLOCKING set by using explicit
   synchronizations where required.
2. The code has also been modified to use thread specific memory spaces,
   which for Kokkos' Cuda backend means per thread streams.
2020-11-30 13:12:39 -05:00
Nick Thompson
b249986473 Merge topic 'less_verbose_zfp'
8ae76a458 Revert unfocused diffs.
4b3ca3f54 Make ZFP tests less verbose.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2336
2020-11-29 15:02:14 -05:00
Nick Thompson
8ae76a458b Revert unfocused diffs. 2020-11-29 14:16:05 -05:00
Kenneth Moreland
a77a1f7f48 Merge topic 'arrayhandlecompositevec-use-buffer'
fb130d42d Remove test for ArrayHandleCompositeVector with bad lengths
7cbf40d5b Back out of using a composite of transform arrays
7ff1a690d Support ArrayHandleCompositeVector with 1 component
5391e353a Convert ArrayHandleExtractComponent to new buffer-style array
22fac15b3 Convert ArrayHandleCompositeVector to new buffer-style array

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2330
2020-11-28 13:37:27 -05:00
Kenneth Moreland
553f97650c Merge topic 'swizzle-uses-transform'
35ca89531 Simplify ArrayHandleSwizzle

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2334
2020-11-28 13:33:40 -05:00
Nick Thompson
4b3ca3f54e Make ZFP tests less verbose. 2020-11-25 15:50:10 -05:00
Dave Pugmire
b8287665e5 Merge topic 'pathline_manual_fix'
3c50a7ea4 Fix assert for pathlines. Add example from manual that was failing.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !2335
2020-11-25 14:02:06 -05:00
Nick Thompson
2addc19eac Merge topic 'less_verbose_logging'
5d4c3f0c6 Less verbose logging.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2329
2020-11-25 13:54:23 -05:00
Nick Thompson
39b6090402 Merge topic 'more_digits'
0019c0b3a Missing include file.
db00f356b Merge remote-tracking branch 'origin/master' into more_digits
3a9e97bb8 Write more digits in VTKDataSetWriter.cxx.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2328
2020-11-25 13:53:37 -05:00
Dave Pugmire
3c50a7ea46 Fix assert for pathlines. Add example from manual that was failing. 2020-11-25 12:43:00 -05:00
Kenneth Moreland
35ca89531c Simplify ArrayHandleSwizzle
As we update the `ArrayHandle`s to the new buffer style, simplify
`ArrayHandleSwizzle` by implementing it on top of
`ArrayHandleTransform`. Also, introduce some C++11 template concepts to
handle variable arguments better.

In this conversion, some features have been removed. Previously if the
swizzle dropped some components, you were still allowed to write to the
array. This would be an in place write that would only update the passed
components. This feature has been removed and if any components are
dropped, the array becomes read only. If all components are swizzled,
then the array becomes writable (through templating).

Another lost feature is that the swizzle map is no longer checked for
correctness. The array handle just assumes that the indices are correct.

It should be noted that it does not look like `ArrayHandleSwizzle` is
actually used anywhere. If it is not used by any customers, we may
want to consider deprecating the class.
2020-11-25 09:28:49 -07:00
Dave Pugmire
8f2ec9e467 add better comment. 2020-11-24 16:07:02 -05:00
Dave Pugmire
967fb9fadf Remove unneeded cast in worklet, clarify the code in threaded algo. 2020-11-24 15:06:36 -05:00
Dave Pugmire
5297c36e2c fix compile error. 2020-11-24 13:48:20 -05:00
Dave Pugmire
5992f9f694 Restore the cmake after the clip issue was fixed. 2020-11-24 13:36:58 -05:00
Dave Pugmire
9cdcddb0c3 Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into threaded_particleAdvection 2020-11-24 13:35:30 -05:00
Dave Pugmire
eb7d791f24 Rename the worker-sync variables. 2020-11-24 13:26:46 -05:00
Dave Pugmire
b0f97f480b Add condition_variable to sleep the worker. 2020-11-24 11:47:32 -05:00
Kenneth Moreland
fb130d42de Remove test for ArrayHandleCompositeVector with bad lengths
The old version of `ArrayHandleCompositeVector` would check (at
construction) to make sure that all the arrays had the same length. This
check has been removed because (1) it did not always catch all problems
(such as if the input arrays change), (2) debug builds check for out-of-
range array accesses anyway, and (3) it required a lot of extra template
expansion.

Because that check has been removed, also remove the part of the
`ArrayHandleCompositeVector` test that checks this check.
2020-11-23 17:41:07 -07:00
Kenneth Moreland
7cbf40d5b2 Back out of using a composite of transform arrays
This should be restored once transform arrays use the new buffer-style
arrays.
2020-11-23 17:30:57 -07:00
Kenneth Moreland
7ff1a690de Support ArrayHandleCompositeVector with 1 component
When `ArrayHandleCompositeVector` has only 1 component, it is supposed
to have a special template that uses the base value type rather than a
`Vec` of that type. However, the `Storage` with the value type was
missing. I'm not sure how we weren't getting compile errors before, but
moving to the new buffer arrays seems to bring about the expected error.
2020-11-23 17:17:31 -07:00
Kenneth Moreland
5391e353a0 Convert ArrayHandleExtractComponent to new buffer-style array 2020-11-23 15:45:31 -07:00
Kenneth Moreland
22fac15b32 Convert ArrayHandleCompositeVector to new buffer-style array 2020-11-23 14:56:17 -07:00
Dave Pugmire
675f2d50f4 Add a debug mode assert to verify buffer size. 2020-11-23 15:30:36 -05:00
Kenneth Moreland
b7a09f5ecb Re-introduced deprecated StorageImplicit.h
The `StorageImplicit.h` header is no longer used. However, just removing
it causes compiles to fail if they include it. To make the transition
better, re-add this file, but cause a deprecation warning if it is
included.
2020-11-23 08:12:09 -07:00
Dave Pugmire
9f204abbb2 Assert is wrong. will fix tomorrow 2020-11-22 21:41:10 -05:00
Dave Pugmire
9b290994f5 fix compile warnings. 2020-11-21 22:20:20 -05:00
Dave Pugmire
9da2b86d72 Implement blockAndWait for threaded 2020-11-21 22:13:16 -05:00
Kenneth Moreland
51c954c857 Merge topic 'arrayhandledecorator-use-buffer'
f80071894 Convert ArrayHandleDecorator to new buffer-style arrays

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2324
2020-11-20 16:20:11 -05:00
Nick Thompson
5d4c3f0c61 Less verbose logging. 2020-11-20 15:12:23 -05:00
Dave Pugmire
741fff75c8 support for blockAndSend when a rank is totally idle. 2020-11-20 14:57:33 -05:00
Dave Pugmire
669794f992 Support for blockAndWait. Do sends BEFORE receives. 2020-11-20 14:57:04 -05:00
Nick Thompson
0019c0b3af Missing include file. 2020-11-20 13:46:59 -05:00
Nick Thompson
db00f356b0 Merge remote-tracking branch 'origin/master' into more_digits 2020-11-20 13:03:38 -05:00
Nick Thompson
3a9e97bb88 Write more digits in VTKDataSetWriter.cxx. 2020-11-20 11:39:30 -05:00
Dave Pugmire
a4ce505d5f Use std::atomic for this->Done. 2020-11-20 09:25:16 -05:00
Vicente Adolfo Bolea Sanchez
5ddfb719a3 ClipWithField: Use primive types in instantiations
`vtkm::[U]Int*` types depending of each platform/arch would translate to
different integer types. We cannot make a generalization with this.

A simple way to handle this is to simply use primitive types, such as
char, signed char, long..., instead of vtkm::[U]Int*. This makes sure
that every primitive type is actually instantiated.

We could potentially use this in other filters instantiation file.

This error has been reported in VTK when being build with vtkm.
2020-11-19 19:14:16 -05:00
Dave Pugmire
c3fa3d43b1 Undo changes to the cmakelists 2020-11-19 15:24:36 -05:00
Dave Pugmire
2fec7a79c3 Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into threaded_particleAdvection 2020-11-19 15:23:17 -05:00
Kenneth Moreland
f800718947 Convert ArrayHandleDecorator to new buffer-style arrays
It should be noted that a break in backward compatibility is introduced.
The implementation class passed to `ArrayHandleDecorator` changed the
specification of `AllocateSourceArrays`. Thus, decorators that were
previously allocatable now no longer will be until that method is
updated to the new form.
2020-11-19 12:29:16 -07:00
Dave Pugmire
5f86dfc941 Code cleanup.... 2020-11-19 14:19:26 -05:00
Dave Pugmire
173c14b086 Add new files to cmakelists 2020-11-19 13:55:27 -05:00
Dave Pugmire
79d840a24f refactor classes. Put in different files. 2020-11-19 13:52:01 -05:00
Dave Pugmire
55f9d24983 Update class inheritance, etc. 2020-11-19 12:42:54 -05:00
Robert Maynard
1c7fbc70c3 Merge topic 'remove_filter_hxx_usages'
7eaedfe84 Reduce compiler memory usage by removing auto hxx inclusion

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Vicente Bolea <vicente.bolea@kitware.com>
Merge-request: !2313
2020-11-19 10:59:43 -05:00
Robert Maynard
7eaedfe84b Reduce compiler memory usage by removing auto hxx inclusion
A large portion of the VTK-m filters are now compiled into the
vtkm_filter library. These pre-built filters now don't include
the respective hxx file to remove the amount of template
instantiation users do.

To verify that this removal reduces compiler memory ( and maybe time)
I profiled the compiler while it building filter tests in debug mode.
Here is a selection of results:

```
CleanGrid           10.25s => 9.01s,  901MB => 795MB
ExternalFaces       13.40s => 5.96s, 1122MB => 744MB
ExtractStructured    4.69s => 4.75s,  492MB => 492MB
GradientExplicit    22.97s => 5.88s, 1296MB => 740MB
```
2020-11-19 09:59:25 -05:00
Dave Pugmire
3dc1237881 Fix compile warning. 2020-11-19 09:28:29 -05:00
Dave Pugmire
02e37db863 Fix compile error. 2020-11-18 21:23:06 -05:00
Kenneth Moreland
5e3ae70a6b Merge topic 'arrayhandlegroupvec-use-buffer'
41784b31f Allow ArrayHandleGroupVec with odd component array size
d472e05ea Convert ArrayHandleGroupVec to new buffer-style array

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2317
2020-11-18 17:36:46 -05:00
Dave Pugmire
7a4b2ff0c5 Threaded algorithms for particle advection 2020-11-18 17:10:28 -05:00
Nick Thompson
0ac1b816c8 Merge topic 'less_verbose_tests_2'
275abf2f2 Revert change the removes printing of seed.
3b2c10339 Less verbose unit tests.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !2321
2020-11-18 15:12:32 -05:00
Kenneth Moreland
41784b31ff Allow ArrayHandleGroupVec with odd component array size
The array given to `ArrayHandleGroupVec` should really have a number of
values that divides evenly among the `Vec`s. Previously, if this was not
the case, an error exception was thrown. These changes allow this
condition. Extra components are dropped and a warning is logged.
2020-11-18 11:15:50 -07:00
Nick Thompson
275abf2f2d Revert change the removes printing of seed. 2020-11-18 11:03:19 -05:00
Kenneth Moreland
8d3f376646 CreateBuffers improvements suggested by Rob Maynard 2020-11-18 08:25:53 -07:00
Nick Thompson
3b2c103397 Less verbose unit tests. 2020-11-18 08:35:37 -05:00
Kenneth Moreland
c072e4ed29 Add a CreateBuffers helper function
Most `ArrayHandle` implementations must create an
`std::vector<vtkm::cont::internal::Buffer>` object. It is most helpful
to create it in the constructor when initializing the superclass (so the
superclass does not have to create it's own). Added a `CreateBuffers`
convenience function to make it easy to build these vectors.
2020-11-17 16:20:15 -07:00
Kenneth Moreland
d472e05eae Convert ArrayHandleGroupVec to new buffer-style array 2020-11-17 12:36:05 -07:00
Kenneth Moreland
e9410f27cb Add constexpr to GetNumberOfBuffers
This should always be a constant value.
2020-11-17 12:25:11 -07:00
Kenneth Moreland
07d6c06c73 Convert ArrayHandleCartesianProduct to new buffer-style array 2020-11-17 12:17:28 -07:00
Nick Thompson
64ff684218 Use TypeToString to demangle symbol in UnknownArrayHandle. 2020-11-16 14:58:52 -05:00
Kenneth Moreland
d82fc92a10 Fix for serializable type names that change base C types
MR !2311 fixed an issue where some base C types were not recognized by
`SerializableTypeString`. However, the fix was such that different types
with the same layout had the same string. For example `char` and
`signed char` both were given the string `I8`. That meant that the
serialization/deseralization would work, but the deserialization could
change the type. That could cause problems if two arrays were expected
to have the same type but did not.

This change undoes much of MR !2311 and redoes it so that the types are
correct.
2020-11-12 16:59:56 -07:00
Kenneth Moreland
88eed2bbeb Make sure all C scalar types are in TypeListScalarAll
C++ template considers some types different even though they have the
exact same format. For example `int`, `long`, and `long long` all match
different types even though they all represent either signed 32-bit ints
or signed 64-bit ints.

List all these possible types in
`TypeListScalarAll`.
2020-11-12 16:18:56 -07:00
Kenneth Moreland
60f19f3f9e Merge topic 'serialization-fixes'
ec4a434dc Include all int types in SerializableTypeString
d9fe6a546 Fix ArrayHandleCast serializable type name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Sujin Philip <sujin.philip@kitware.com>
Merge-request: !2311
2020-11-11 15:13:06 -05:00
Vicente Bolea
9a15735541 Merge topic 'fix-578-reduce-compilation-memory-usage'
f3db116c6 Clip: Split instantiations of its derivated filters

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2303
2020-11-11 12:23:43 -05:00
Vicente Adolfo Bolea Sanchez
f3db116c64 Clip: Split instantiations of its derivated filters
- It explicitly instantiate its concrete templates to
  the supported types.
- It disables implicit template instantations for the
  the supported types.
- Also fix small typo in Contour impl include guards

Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2020-11-11 11:14:10 -05:00
Kenneth Moreland
ec4a434dcf Include all int types in SerializableTypeString
Previously, `SerializableTypeString` was specialized only for the VTK-m
defined int types (`Int8`, `UInt8`, `Int16`, etc.). You would think this
would cover all the base int types, but in fact C++ defines multiple int
types that have the exact same bit layout. These duplicates will not
match each other when matching template specializations. For example,
`char` is either the same as `signed char` or `unsigned char`, but will
match neither. Likewise, `long` is the same as either `int` or `long
long`, but all these types will match different template
specializations.

Now all integer types are covered.
2020-11-11 08:07:14 -07:00
Kenneth Moreland
d9fe6a546f Fix ArrayHandleCast serializable type name
The specialization for SerializableTypeString for ArrayHandleCast tried
to get the serialization for the base type and the storage tag. This is
wrong since the storage tag itself is not seralizable nor has a type
string. Instead, just record the type name for the sub ArrayHandle
itself.
2020-11-11 07:48:24 -07:00
Kenneth Moreland
339a461f5c Avoid warning about uninitialized member 2020-11-10 16:39:57 -07:00
Kenneth Moreland
2f04dc3aef Simplify creating metadata in Buffer objects
Previously you had to create a special virtual object to place in the
`Buffer`'s metadata. This added a lot of difficulty that is probably
unnecessary.

Instead, just have `Buffer` hold an arbitrary object and some simple
functions to copy and delete it. There may be issues with type safety
across translation units, but we'll deal with that when/if we run into
it.
2020-11-10 16:22:05 -07:00
Kenneth Moreland
132a07225d Merge topic 'precompiled-field-get-range'
a88e0d914 Reintroduce ArrayRangeCompute.hxx as deprecated
7d681fb58 Deprecate templated versions of Field::GetRange

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2296
2020-11-10 13:49:45 -05:00
Kenneth Moreland
a88e0d9149 Reintroduce ArrayRangeCompute.hxx as deprecated
ArrayRangeCompute.hxx was removed, but other code may be including it.
The file was replaced. It now just includes its replacement
(ArrayRangeComputeTemplate.h) and forces a deprecation warning.
2020-11-10 09:58:50 -07:00
Kenneth Moreland
917ad80a85 Merge topic 'arrayhandlediscard-use-buffer'
cc729f422 Convert ArrayHandleDiscard to new buffer-style arrays

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2309
2020-11-10 09:46:08 -05:00
Kenneth Moreland
8d73a86623 Merge topic 'separate-cont-exec-variant'
e3dfa4891 Do not attempt to move non-trivial objects in Variant
8e11b3ecd Remove ArrayPortalCheck
21db210a7 Make separate exec and cont versions of Variant

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2274
2020-11-10 09:33:13 -05:00
Kenneth Moreland
cc729f422b Convert ArrayHandleDiscard to new buffer-style arrays 2020-11-09 15:45:45 -07:00
Kenneth Moreland
8dfc682014 Convert ArrayHandleReverse to new buffer-style arrays 2020-11-09 14:22:52 -07:00
Kenneth Moreland
e3dfa48910 Do not attempt to move non-trivial objects in Variant
The `Variant` class has separate implementations for its move and copy
constructors/assignment operators depending on whether the classes it
holds can be trivially moved. If the objects are trivial, Variant is
trivial as well. However, in the case where the objects are not trivial,
special construction and copying needs to be done.

Previously, the non-trivial `Variant` defined a move constructor that
did a byte copy of the contained object and reset the right hand side
object so that it did not attempt to destroy the object. That usually
works because it guarantees that only one version of the `Variant` will
attempt to destroy the object and its resources should be cleaned up
correctly.

But C++ is a funny language that lets you do weird things. Turns out
there are cases where moving the location of memory for an object
without calling the proper copy method can invalidate the object. For
example, if the object holds a pointer to one of its own members, that
pointer will become invalid. Also, if it points to something that points
back, then the object will need to update those pointers when it is
moved. GCC's version of `std::string` seems to be a type like this.

Solve the problem by simply deleting the move constructors. The copy
constructors and destructor will be called instead to properly manage
the object. A test for these conditions is added to `UnitTestVariant`.
2020-11-09 12:48:10 -07:00
Kenneth Moreland
8e11b3ecd1 Remove ArrayPortalCheck
This portal only works on the control environment, which means it cannot
work with the new `ArrayHandle` type. Recent changes to
`ArrayHandleMultiplexer` also do not allow this, so just remove it
rather than try to fix it.
2020-11-09 12:48:10 -07:00
Kenneth Moreland
21db210a73 Make separate exec and cont versions of Variant
The `Variant` class is templated to hold objects of other types.
Depending on whether those objects of are meant to be used in the
control or execution side, the methods on `Variant` might need to be
declared with (or without) special modifiers. We can sometimes try to
compile the `Variant` methods for both host and device and ask the
device compiler to ignore incompatibilities, but that does not always
work.

To get around that, create two different implementations of `Variant`.
Their API and implementation is exactly the same except one declares its
methods with `VTKM_CONT` and the other its methods `VTKM_EXEC`.
2020-11-09 12:48:10 -07:00
Kenneth Moreland
7d681fb585 Deprecate templated versions of Field::GetRange
Instead, always use precompiled versions of range computing. This means
you won't be able to specify the type. Currently, types are limited to
scalars vecs up to size 4.

The main motivation for this change is to allow you to include Field.h
with a non-device compiler. This is an important feature for our
customers.

I plan in the future to implement a mechanism to pull out a component of
most ArrayHandle's as a single array. This would enable us to support a
precompiled version that can compute the range of arbitrarily sized
Vecs.
2020-11-09 12:28:29 -07:00
Dave Pugmire
f4fdc5e183 MPI testing update. 2020-11-05 16:04:48 -05:00
Dave Pugmire
c0e07e845f remove print statements. 2020-11-05 16:01:55 -05:00
Dave Pugmire
ed790afd8d debug for dashboards 2020-11-05 15:49:38 -05:00
Dave Pugmire
b57ffb30ae Add parallel AMR streamline test. 2020-11-05 15:34:11 -05:00
Dave Pugmire
f93ddfee9d Re-enable the other SL tests. 2020-11-05 14:30:54 -05:00
Dave Pugmire
6663d348b7 Add tests for AMR-like grids for streamline 2020-11-05 14:25:58 -05:00
Dave Pugmire
02f73fce1b Compiler warnings. 2020-11-02 21:39:24 -05:00
Dave Pugmire
f876a2ceec Structured ONLY in LS filter. 2020-11-02 17:44:18 -05:00
Dave Pugmire
4517201676 Fix testing for both SL and PA 2020-11-02 17:35:13 -05:00
Dave Pugmire
fb72ab097b Add tests for all datasetypes for 3D 2020-11-02 17:23:42 -05:00
Dave Pugmire
699dbae5ca compile warning and fix to PA test. 2020-11-02 17:16:37 -05:00
Dave Pugmire
4d6776cd16 Update filter test to use all data types. 2020-11-02 17:07:22 -05:00
Dave Pugmire
c0189982ac Messed up the merge. 2020-11-02 16:31:23 -05:00
Dave Pugmire
a7f049ac1a Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into ghost_streamlines 2020-11-02 16:28:57 -05:00
Dave Pugmire
0bd0b0c5a7 Remove PA tests (moved into SL) 2020-11-02 16:26:14 -05:00
Dave Pugmire
467ad88d06 Move PA tests into Streamline 2020-11-02 16:25:38 -05:00
Robert Maynard
67541f5ea5 Merge topic 'update_thirdparty_for_hip_support'
19216a3bd Merge branch 'upstream-lcl' into update_thirdparty_for_hip_support
5f0d04ad3 lcl 2020-10-28 (b7fe5404)
913787f3a Merge branch 'upstream-diy' into update_thirdparty_for_hip_support
25fed44bd diy 2020-10-26 (538957e7)
7c40254d3 diy: update for corrections to allow HIP compilation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Sujin Philip <sujin.philip@kitware.com>
Merge-request: !2304
2020-10-29 15:44:43 -04:00
Kenneth Moreland
7d77676599 Merge topic 'more-tbb-device-log'
7a12c5e52 Add missing logging for some TBB device algorithms

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2306
2020-10-29 14:07:14 -04:00
Robert Maynard
77a979ff2b Merge topic 'corrections_for_swap_and_math_for_hip'
0b2ddb83b UnitTestBounds custom compile flags expressed via generator expression
1ed5dfca0 vtkm/Math frexp(float) version works now with HIP
ff381bf8b vtkm/Swap works with hip

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !2301
2020-10-29 10:55:55 -04:00
Kenneth Moreland
7a12c5e524 Add missing logging for some TBB device algorithms
Some of the algorithms listed near the end of
DeviceAdapterAlgorithmTBB.h were missing the entry in the performance
log letting us know it was called.
2020-10-28 18:28:27 -06:00
Robert Maynard
19216a3bd6 Merge branch 'upstream-lcl' into update_thirdparty_for_hip_support
* upstream-lcl:
  lcl 2020-10-28 (b7fe5404)
2020-10-28 14:21:28 -04:00
Dave Pugmire
2a916ebc0f remove debug prints. 2020-10-28 09:11:00 -04:00
Dave Pugmire
722479ea10 Add different dataset types to MPI test. 2020-10-27 22:12:45 -04:00
Dave Pugmire
047bd93d5a Fix compile error 2020-10-27 14:27:34 -04:00
Dave Pugmire
5294bd2045 remove print statements. 2020-10-27 13:54:32 -04:00
Dave Pugmire
098edff0a8 Add multiple dataset types for streamline and pathline. 2020-10-27 13:43:00 -04:00
Robert Maynard
913787f3a8 Merge branch 'upstream-diy' into update_thirdparty_for_hip_support
* upstream-diy:
  diy 2020-10-26 (538957e7)
2020-10-26 17:20:25 -04:00
Dave Pugmire
dedf4d7a7d fix compile error. 2020-10-26 16:36:26 -04:00
Dave Pugmire
c592095f75 fix compile warnings. 2020-10-26 15:59:38 -04:00
Dave Pugmire
e8dc7e0eee Add more dataset types for testing. 2020-10-26 15:49:58 -04:00
Robert Maynard
7c40254d39 diy: update for corrections to allow HIP compilation 2020-10-26 15:07:16 -04:00
Dave Pugmire
46a82c6985 add data generation functions. 2020-10-26 14:37:20 -04:00
Dave Pugmire
dbe9e17882 Add helper functions for generating datasets. 2020-10-26 13:45:47 -04:00
Dave Pugmire
eb76dff8d2 Support for ghost cells in P.A. filter 2020-10-26 12:39:31 -04:00
Kenneth Moreland
29fd565b5f Merge topic 'perf-schedule-task'
0b1c48a3e Identify number of partitions in filter execution
b33c54bf6 Add ScheduleTask to performance log

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2302
2020-10-26 11:55:03 -04:00
Vicente Bolea
7370934244 Merge topic 'fix-548-error-mapping-contour'
1add731ef BenchmarkFilters: Add Unstructured bench for Contour
b22823a54 Contour: Zero-init arrays in Flying Edges

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2197
2020-10-26 11:42:29 -04:00
Kenneth Moreland
0b1c48a3ee Identify number of partitions in filter execution
When you execute a filter, the default behavior is to do the execution
on each partition of the data set independently. This code path is
followed even for non-partitioned data; the `DataSet` is wrapped in a
`PartitionedDataSet` of one partition.

Make performance logging a bit more clear by only giving one scoped log
for a basic `DataSet` and recording the number of partitions executed in
the log.
2020-10-26 09:00:09 -06:00
Kenneth Moreland
b33c54bf61 Add ScheduleTask to performance log
When `DeviceAdapterAlgorithm::ScheduleTask` was called directly (i.e.
not through `Schedule`), nothing was added to the log. Adding
`VTKM_LOG_SCOPE` to these methods so that all scheduling is added to the
performance log.
2020-10-25 17:22:38 -06:00
Dave Pugmire
b041891b5d Fix bad index in a unit test. 2020-10-23 22:46:47 -04:00
Dave Pugmire
6e42c4fe31 remove unused function. 2020-10-23 22:43:56 -04:00
Dave Pugmire
f8fe2e16b4 Add more data set types to filter tests. 2020-10-23 16:19:49 -04:00
Dave Pugmire
0dccfdc61e Code cleanup and more tests for ghostcells 2020-10-23 14:37:28 -04:00
Robert Maynard
0b2ddb83b3 UnitTestBounds custom compile flags expressed via generator expression 2020-10-22 16:48:18 -04:00
Robert Maynard
1ed5dfca0b vtkm/Math frexp(float) version works now with HIP 2020-10-22 15:32:14 -04:00
Robert Maynard
ff381bf8b4 vtkm/Swap works with hip 2020-10-22 15:32:06 -04:00
Kenneth Moreland
447bae88d0 Merge topic 'arrayhandleimplicit-use-buffer'
f66dc780c Update ArrayHandleImplicit to new array style with Buffer

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2246
2020-10-22 10:15:55 -04:00
Dave Pugmire
a9232904d9 code cleanup and remove compile warning. 2020-10-22 09:57:57 -04:00
Vicente Adolfo Bolea Sanchez
b22823a547 Contour: Zero-init arrays in Flying Edges
- It fixes a lingering error triggered with BenchContour
- It reenables BenchContour

Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2020-10-21 19:12:51 -04:00
Li-Ta Lo
8b6ae4f78c fixed type conversion and typo 2020-10-21 16:32:04 -06:00
Li-Ta Lo
77e1aec50a minor change based on code review 2020-10-21 16:08:06 -06:00
Dave Pugmire
6e4d4932d7 debug kokkos compile errors. 2020-10-21 17:14:56 -04:00
Dave Pugmire
64601619c3 Trying to find kokkos compile error 2020-10-21 17:08:10 -04:00
Dave Pugmire
0f0797f0e1 Fix compiler warnings. 2020-10-21 16:00:54 -04:00
Dave Pugmire
ec37279b01 Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into ghost_streamlines 2020-10-21 12:01:31 -04:00
Li-Ta Lo
58436ed2fc Merge branch 'master' into particle_density 2020-10-21 08:48:38 -06:00
Kenneth Moreland
f66dc780c5 Update ArrayHandleImplicit to new array style with Buffer
Also updated the dependent `ArrayHandle`s that use
`ArrayHandleImplicit`'s storage.
2020-10-21 08:36:29 -06:00
Robert Maynard
0277ff1440 Merge topic 'functor_general_work_with_hip'
882d9be58 FunctorsGeneral updated to work with HIP

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2295
2020-10-21 09:11:14 -04:00
Robert Maynard
882d9be583 FunctorsGeneral updated to work with HIP 2020-10-20 15:52:29 -04:00
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
Dave Pugmire
381886c947 Fix compiler warnings... 2020-10-20 09:53:05 -04:00
Robert Maynard
71ff85e926 vtkm/Math can now works with HIP device functions 2020-10-20 09:49:24 -04:00
Robert Maynard
7834b5155b vtkm::Math::ModF calls correct CUDA math function 2020-10-20 09:24:05 -04:00
Robert Maynard
264b4fabc6 vtkm/Algorithms now can do device side HIP algorithms 2020-10-20 09:24:05 -04:00
Robert Maynard
f04b12d9db vtkm/Atomic can now safely include kokkos when HIP is enabled 2020-10-20 09:24:05 -04:00
Dave Pugmire
ee24cdd4d4 fix compile error... 2020-10-19 22:21:24 -04:00
Li-Ta Lo
f1b27c2b8b removed bad stuff 2020-10-19 17:49:55 -06:00
Li-Ta Lo
e6e0506e1f add a newline 2020-10-19 15:46:08 -06:00
Li-Ta Lo
9c4129bfb1 Neareast Grid Point particle density estimate 2020-10-19 15:29:14 -06:00
Dave Pugmire
35627b287e Add support for ghost cells in particle advection. 2020-10-19 16:46:48 -04:00
Robert Maynard
fa42c9a55c Correct casting warning in AtomicArrayExecutionObject
Fixes a warning introduced by !2282
2020-10-16 09:39:08 -04:00
Robert Maynard
0c8cd26199 Merge topic 'correct_atomic_load_api'
5fe6c36fa vtkm::AtomicLoad should only occur on non-const values

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !2282
2020-10-15 17:50:02 -04:00
Kenneth Moreland
4a1b26d1b1 Change ArrayHandle::ReleaseResourcesExecution to be const
The `ReleaseResourcesExecution` method makes changes by booting data off
of the execution environment. But logically the array does not change.
It remains the same size with the same contents. Thus, it makes sense
for this to be a const method.

Also modified some deprecated methods a bit to remove some unnecessary
templates.
2020-10-15 10:03:38 -06:00
Li-Ta Lo
8c15745c04 Merge branch 'master' into particle_density 2020-10-15 07:41:05 -06:00
Kenneth Moreland
19944653bc Add scope log for functions that help map fields in filters 2020-10-13 16:35:25 -06:00
Kenneth Moreland
c60cae3b87 Add scope logs for building locators 2020-10-13 12:41:25 -06:00
Kenneth Moreland
4dec08c6f0 Add tests for advecting particles in explict cell sets
The `UnitTestParticleAdvectionFilter` was only testing advection in
structured cell sets (with either uniform or rectilinear points). This
did not test all paths (i.e. grid evaluators and locators) of particle
advection. Changed the test to also try grids with explicit cells.

Note that the explicit cells are created by just converting the
rectilinear grids to explicit grids. It would be better to get at least
one small dataset that starts as unstructured.
2020-10-13 09:06:02 -06:00
Robert Maynard
b70f677856 Merge topic 'scope-scatters'
f5c5b6188 Log the computation of ranges in fields and arrays
bef55f8ee Log the conversion of num components to offsets
420b9d397 Log the building of arrays for scatters and masks

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2283
2020-10-13 09:02:51 -04:00
Robert Maynard
5c769b1b5f Merge topic 'remove_unused_functions'
22dfb4776 Remove unused functions from TestingDeviceAdapter

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !2281
2020-10-13 08:58:57 -04:00
Kenneth Moreland
f5c5b61880 Log the computation of ranges in fields and arrays 2020-10-12 15:51:09 -06:00
Kenneth Moreland
bef55f8ee3 Log the conversion of num components to offsets 2020-10-12 14:02:31 -06:00
Kenneth Moreland
420b9d3979 Log the building of arrays for scatters and masks 2020-10-12 13:19:43 -06:00
Sujin Philip
0d5178dfc5 Merge topic 'kokkos-opt-algo'
c26e193fe Use kokkos provided routines for sort and copy

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2277
2020-10-12 10:28:01 -04:00
Robert Maynard
5fe6c36fa2 vtkm::AtomicLoad should only occur on non-const values
Previously vtk-m allowed users to issue atomic loads on constant
values which is problematic for the following reasons:

 - can be a source of undefined behavior
 - not supported by kokkos

This issue was detected when using kokkos HIP atomic implementation
2020-10-09 14:20:21 -04:00
Robert Maynard
22dfb4776e Remove unused functions from TestingDeviceAdapter 2020-10-09 14:13:45 -04:00
Kenneth Moreland
7933c70ca5 Add dispatcher type when logging worklet invocation
When you invoke a worklet, a scoped performance log is automatically
generated. The previous version gave the name of the worklet, which is
technically everything you need to know. However, it is also convenient
to know what type of worklet it is (e.g. a field map worklet or a
topology map worklet). This can be determined by looking at the
definition of the worklet in the source code, but that is not practical
if, for example, you want to perform automated analysis.

This change prints out the type of the dispatcher instead of the
worklet. The full type of the dispatcher includes the worklet as a
template parameter, so you get both the dispatcher/worklet type and the
worklet itself. So previously you would get log lines like

```
Invoking Worklet: 'vtkm::worklet::vtkm::worklet::ExternalFaces::NumFacesPerCell'
```

They now look like this:

```
Invoking Worklet: 'vtkm::worklet::DispatcherMapTopology<vtkm::worklet::ExternalFaces::NumFacesPerCell>'
```
2020-10-08 16:10:00 -06:00
Li-Ta Lo
ec6b2bc7fb Merge topic 'concurrent_union_find'
268a07bb0 remove test on large graph and sample data

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !2278
2020-10-08 15:38:07 -04:00
Li-Ta Lo
268a07bb06 remove test on large graph and sample data 2020-10-08 13:26:46 -06:00
Sujin Philip
c26e193fec Use kokkos provided routines for sort and copy 2020-10-08 13:46:43 -04:00
Vicente Adolfo Bolea Sanchez
a290de5bcc BenchmarkFilters: adds unstructured Dataset for some filters
- It also remove termination on bench error
- It disables passing fields in Countour to skip an error.

Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2020-10-07 18:46:36 -04:00
Li-Ta Lo
2b0960f279 Merge topic 'concurrent_union_find'
932f8b82f Merge branch 'concurrent_union_find' of gitlab.kitware.com:ollielo/vtk-m into concurrent_union_find
eaff27195 minor changes on comments on findRoot()
9fef540ba minor changes on comments on findRoot()
916661e33 Merge branch 'concurrent_union_find' of gitlab.kitware.com:ollielo/vtk-m into concurrent_union_find
a036b0f98 Minor change based on code review.
9e68022ac Minor change based on code review.
1185f70bc Data Race Resolution
aed7e02da Merge branch 'concurrent_union_find' of gitlab.kitware.com:ollielo/vtk-m into concurrent_union_find
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !2248
2020-10-07 17:48:30 -04:00
Li-Ta Lo
eaff271950 minor changes on comments on findRoot() 2020-10-07 15:09:12 -06:00
Li-Ta Lo
a036b0f980 Minor change based on code review. 2020-10-07 14:23:40 -06:00
Li-Ta Lo
c1681d2f2a Merge branch 'master' into particle_density 2020-10-07 12:24:07 -06:00
Li-Ta Lo
1185f70bc9 Data Race Resolution
Finished the comments on data races and their resolution.
2020-10-07 11:56:02 -06:00
Li-Ta Lo
3c7aa34267 Remove duplicate code in ImageConnectivity.h and GraphConnectivity.h 2020-10-06 13:38:59 -06:00
Dave Pugmire
303520ad48 Remove virtuals from vtkm::Particle 2020-10-06 13:25:26 -04:00
Kenneth Moreland
757766431b Merge topic 'variant-is-trivial'
4a7aae86f Allow Variant to be trivial

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2265
2020-10-06 10:43:08 -04:00
Li-Ta Lo
43aa21df40 Merge branch 'master' into concurrent_union_find 2020-10-05 09:28:31 -06:00
Kenneth Moreland
a653fb93ed Merge topic 'rename-2-level-locators'
b012c42be Rename CellLocatorUniformBins to CellLocatorTwoLevel
c9b763aca Rename PointLocatorUniformGrid to PointLocatorSparseGrid

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2264
2020-09-25 18:03:28 -04:00
Robert Maynard
9bd6f3e6da Disable VTKM_ASSERT when using HIP 2020-09-25 11:06:57 -04:00
Robert Maynard
68b5edfcba VTK-m defines VTKM_EXEC / VTKM_EXEC_CONT when compiling with HIP 2020-09-25 11:06:34 -04:00
Robert Maynard
d0c9fb2741 Correct missing VTKM_EXEC_CONT in UnitTestArrayHandleExtrude 2020-09-25 09:37:46 -04:00
Robert Maynard
1365cfa9ec Update ConnectivityExtrude to follow clangs rules on markup 2020-09-25 09:37:46 -04:00
Robert Maynard
09df45bb19 Update vtkm/Geometry.hxx to follow clangs rules on function markup 2020-09-25 09:37:46 -04:00
Robert Maynard
461616a771 Refactor some VTK-m device adapter to be alphabetical 2020-09-24 09:10:03 -04:00
Robert Maynard
2278fdfd94 Deprecation macro has to come before VTKM_EXEC or VTKM_EXEC_CONT
This order is needed by CUDA-clang and HIP-clang compilers
2020-09-23 10:02:37 -04:00
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
b012c42beb Rename CellLocatorUniformBins to CellLocatorTwoLevel
The new name is more descriptive and prevents confusion with
CellLocatorUniformGrid.
2020-09-21 15:42:47 -06:00
Kenneth Moreland
c9b763aca9 Rename PointLocatorUniformGrid to PointLocatorSparseGrid
The new name reflects better what the underlying algorithm does. It also
helps prevent confusion about what types of data the locator is good
for. The old name suggested it only worked for structured grids, which
is not the case.
2020-09-21 15:42:41 -06: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
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
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
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
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
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
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 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
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
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
Ben Boeckel
aa6eb01dfe ComputeMoments: use FilterField instead of FilterCell 2020-08-31 16:51:12 -04:00
Li-Ta Lo
e17345a81f Merge branch 'master' into concurrent_union_find 2020-08-31 14:34:29 -06:00
Kenneth Moreland
c79daa5c2f Suggested changes to comments 2020-08-31 09:51:53 -06:00
Kenneth Moreland
fca25fa3c7 Enable serialization of UnknownArrayHandle and UncertainArrayHandle
Because UnknownArrayHandle is not typed, we can compile into vtkm_cont
the ability to serialize many types.
2020-08-31 09:46:57 -06:00
Kenneth Moreland
94aa6449b9 Add UncertainArrayHandle 2020-08-31 09:46:57 -06:00
Kenneth Moreland
e47cedd972 Add UnknownArrayHandle 2020-08-31 09:46:56 -06:00
Li-Ta Lo
945e9cf328 some more comments 2020-08-31 09:23:03 -06:00
Ben Boeckel
ede0c179b7 Merge topic 'vtkmdiy-install-destination'
f4df3fe00 vtkmdiy: forward the bin install directory to diy
a4b4b1a2c Merge branch 'upstream-diy' into HEAD
db483b3e2 diy 2020-08-26 (c9efaac9)
acde82a36 diy: update for install destination fix

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2244
2020-08-28 14:29:11 -04:00
Li-Ta Lo
7533538e17 restore CI config files, minor clean up for UnionFind 2020-08-28 10:48:14 -06:00
Li-Ta Lo
31322cd2e1 use CompareAndSwap for setting root 2020-08-28 10:33:24 -06:00
Li-Ta Lo
4cd320c284 put finding and setting root in a loop 2020-08-28 08:53:56 -06:00
Li-Ta Lo
f91fb35d7f added more data race analysis, change GraphGraft to use AtomicArray 2020-08-28 00:04:50 -06:00
Li-Ta Lo
e5f8219477 try fixing CUDA compiler error 2020-08-27 22:35:27 -06:00
Li-Ta Lo
fc754b329f deduplicate UnionFind 2020-08-27 20:07:32 -06:00
Li-Ta Lo
af53fb736f Add unit test for graph connectivity with data from the ECL_CC paper 2020-08-27 17:37:08 -06:00
Kenneth Moreland
2877aab21a Fix problem with ArrayCopy of two of the same arrays
A recent modification to `ArrayCopy` created a fast path for when
copying arrays of the same type. This fast path just deep copies the
buffers. The issue was that the buffer copy was creating new buffers
instead of updating the existing buffers. The passed in `ArrayHandle`
would get updated to the new buffers, but any other `ArrayHandle`s
sharing those buffers would still have the old versions. That would lead
to unexpected errors in code like this.

```cpp
vtkm::cont::ArrayHandle<T> outArray1;
vtkm::cont::ArrayHandle<T> outArray2 = outArray1;

vtkm::cont::ArrayCopy(inArray, outArray2);
```

If `inArray` was a different type than `outArray2`, then the data for
both `outArray1` and `outArray2` would be updated (which is the expected
behavior for something considered a "pointer"). However, if `inArray`
was the same type as `outArray2`, then the fast path would change
`outArray2` but leave `outArray1` the same.

This behavior has been corrected so that, in this case, the data of
`outArray1` always follows that of `outArray2`.
2020-08-27 17:28:54 -06:00
Kenneth Moreland
d938226cd3 Fix tests that relied on stable sort
The parallel sorts in the device adapter are documented to not be
stable. Up until recently, the sorts for all the supported devices
happened to be stable (or at least provided a stable sort where needed).
However, the recent Kokkos adapter provides a sort that is no stable.
This broke some tests that relied on stable sorts when they should not
have.

Fix the tests that relied on stable sort to check the results.
2020-08-27 14:50:51 -06:00
Li-Ta Lo
17047f456d more comments on things to do 2020-08-27 11:46:31 -06:00
Li-Ta Lo
727e0cb268 single pass algorithm for both Image and Graph connectivity 2020-08-27 11:22:48 -06:00
Li-Ta Lo
19be36ee7a implemented single pass algorithm for image connectivity 2020-08-27 11:03:45 -06:00
Li-Ta Lo
0902cbbad3 save before change to single pass algorithm 2020-08-27 10:17:02 -06:00
Kenneth Moreland
80cf0b3658 Fix more signed/unsigned vtkm::Id/std::size_t warnings in kokkos adapter 2020-08-27 07:59:03 -06:00