Commit Graph

6307 Commits

Author SHA1 Message Date
Allison Vacanti
5db762ee71 Refactor topology mappings to clarify meaning.
The `From` and `To` nomenclature for topology mapping has been confusing for
both users and developers, especially at lower levels where the intention of
mapping attributes from one element to another is easily conflated with the
concept of mapping indices (which maps in the exact opposite direction).

These identifiers have been renamed to `VisitTopology` and `IncidentTopology`
to clarify the direction of the mapping. The order in which these template
parameters are specified for `WorkletMapTopology` have also been reversed,
since eventually there may be more than one `IncidentTopology`, and having
`IncidentTopology` at the end will allow us to replace it with a variadic
template parameter pack in the future.

Other implementation details supporting these worklets, include `Fetch` tags,
`Connectivity` classes, and methods on the various `CellSet` classes (such as
`PrepareForInput` have also reversed their template arguments. These will need
to be cautiously updated.

The convenience implementations of `WorkletMapTopology` have been renamed for
clarity as follows:

```
WorkletMapPointToCell --> WorkletVisitCellsWithPoints
WorkletMapCellToPoint --> WorkletVisitPointsWithCells
```

The `ControlSignature` tags have been renamed as follows:

```
FieldInTo --> FieldInVisit
FieldInFrom --> FieldInMap
FromCount --> IncidentElementCount
FromIndices --> IncidentElementIndices
```
2019-08-06 11:27:26 -04:00
Robert Maynard
793702cf62 Merge topic 'symbol_vis_warnings_with_worklets'
d8cc39eb8 Always export VTK-m functor symbols

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1753
2019-08-01 17:13:50 -04:00
Robert Maynard
d38a23e55b Merge topic 'find_package_vtkm_dont_check_cuda_arch'
8f3681171 When importing VTK-m don't recheck the CUDA host architecture

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1748
2019-08-01 17:09:14 -04:00
Robert Maynard
c7c2cd6d92 Merge topic 'documented_intel_tested_versions'
0c4e0a695 Document versions of the Intel compiler VTK-m has been tested on

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1752
2019-08-01 13:39:08 -04:00
Robert Maynard
0c4e0a695c Document versions of the Intel compiler VTK-m has been tested on 2019-08-01 13:34:51 -04:00
Robert Maynard
d8cc39eb8d Always export VTK-m functor symbols
This is done to avoid warnings when compiling VTK-m consumers
with different defaults for symbol visiblity. AKA avoid warnings
like:

```
warning: ‘vtkm::worklet::WorkletMapField’ declared with greater visibility than the type of its field ‘vtkm::worklet::WorkletMapField::<anonymous>’ [-Wattributes]
 class WorkletMapField : public vtkm::worklet::internal::WorkletBase
       ^~~~~~~~~~~~~~~
```
2019-08-01 12:53:54 -04:00
Robert Maynard
2eeeafc1f5 Merge topic 'move_invoker_to_cont'
7e04b0511 Move Invoker into vtkm/cont

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1745
2019-08-01 12:36:00 -04:00
Robert Maynard
7e04b0511f Move Invoker into vtkm/cont
The Invoker is a control side object that handles the construction
of the relevant worklet dispatcher. Moving it to control makes it
obvious that it isn't an algorithm itself but a way to launch
worklets.
2019-08-01 12:34:27 -04:00
Allison Vacanti
9b0d70203b Merge topic 'orient_normals'
91e7c4d0b Add orientation and winding options to SurfaceNormals.
320a5257a Add TriangleWinding worklet.
ab627b61d Add OrientNormals worklet.
112024dae Fix CUDA shfl usage.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1614
2019-08-01 12:18:31 -04:00
Allison Vacanti
91e7c4d0b9 Add orientation and winding options to SurfaceNormals. 2019-08-01 11:02:13 -04:00
Allison Vacanti
320a5257ad Add TriangleWinding worklet. 2019-08-01 10:57:58 -04:00
Allison Vacanti
ab627b61d6 Add OrientNormals worklet. 2019-08-01 10:57:58 -04:00
Allison Vacanti
112024dae2 Fix CUDA shfl usage.
There was a bug in the implementations of CountSetBits and
BitFieldToUnorderedSet.
2019-08-01 10:57:57 -04:00
Robert Maynard
8f36811718 When importing VTK-m don't recheck the CUDA host architecture 2019-07-31 18:16:22 -04:00
Kenneth Moreland
57440239ef Merge topic 'vec-typedefs'
53e868938 Add changedoc for common vec types
0be50c119 Update VTK-m code to use new Vec aliases
b3e295214 Add aliases for common Vec types

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1743
2019-07-31 16:24:46 -04:00
Dave Pugmire
881b1713f0 Merge topic 'particleAdvectionStatus'
0527fad6c fix compiler warning.
22becf6de Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into particleAdvectionStatus
f3d060a61 remove prints
19e41efb3 Add new particle status for 'took any steps'

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1744
2019-07-31 15:30:46 -04:00
Kenneth Moreland
53e8689385 Add changedoc for common vec types 2019-07-31 12:55:40 -06:00
Kenneth Moreland
0be50c119d Update VTK-m code to use new Vec aliases
Should make the code easier to read.
2019-07-31 12:55:40 -06:00
Kenneth Moreland
b3e2952149 Add aliases for common Vec types
It is a hassle to write out vtkm::Vec<vtkm::FloatDefault, 3>. Instead,
you can now just write vtkm::Vec3f.
2019-07-31 12:55:30 -06:00
Dave Pugmire
0527fad6ce fix compiler warning. 2019-07-31 11:41:37 -06:00
Dave Pugmire
22becf6de3 Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into particleAdvectionStatus 2019-07-31 11:08:39 -06:00
Dave Pugmire
f3d060a61f remove prints 2019-07-31 11:06:54 -06:00
Dave Pugmire
19e41efb30 Add new particle status for 'took any steps' 2019-07-31 10:54:39 -06:00
Kenneth Moreland
945a37d96b Merge topic 'remove-special-ah-multiplexer-template'
eaf87e451 Remove special ArrayHandleMultiplexer template case

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Allison Vacanti <allison.vacanti@kitware.com>
Merge-request: !1742
2019-07-30 17:39:40 -04:00
Kenneth Moreland
eaf87e4519 Remove special ArrayHandleMultiplexer template case
There was a special case for ArrayHandleMultiplexer where if you gave it
just one type it would treat that as a value type rather than an array
to support and instead provide a default list of types. However, GCC 4.8
is having trouble compiling the code to create the default list, the
semantics are confusing, and the more I think about it the less likely I
think we will need this functionality. So, just getting rid of that.
2019-07-30 14:48:35 -06:00
Kenneth Moreland
023e12b23a Merge topic 'backup-aligned-union'
01176efbd Provide implementation of aligned_union

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Allison Vacanti <allison.vacanti@kitware.com>
Merge-request: !1741
2019-07-30 16:02:59 -04:00
Kenneth Moreland
01176efbdf Provide implementation of aligned_union
Although it is mostly C++11 compliant, GCC 4.8 does not have an
implementation of std::aligned_union. We cannot drop this compiler, so
provide our own implementation in that case.
2019-07-29 17:09:27 -06:00
Kenneth Moreland
88c5c0a65e Merge topic 'array-handle-multiplexer'
d80a8125c Sprinkle noexcept goodness on Variant and ArrayPortalMultiplexer
a96a13cf3 Use large case statements to CastAndCall variants
866e1d7d5 Update comparison for virtual and multiplexer arrays
5416cbeb7 Add ArrayHandleMultiplexer testing to BenchmarkFieldAlgorithms
d45106452 Add changedoc for ArrayHandleMultiplexer
0aa15c97c Fix 'Failed to specialize alias template' error from Visual Studio
7b72e31df Fixes for CUDA
5e2385352 Create ArrayHandleMultiplexer
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1726
2019-07-26 17:20:13 -04:00
Dave Pugmire
b495aec7f3 Merge topic 'streamSurface'
703e4c254 Stream surface worklet

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1740
2019-07-26 16:54:22 -04:00
Dave Pugmire
703e4c254c Stream surface worklet 2019-07-26 11:20:12 -04:00
Kenneth Moreland
d80a8125cc Sprinkle noexcept goodness on Variant and ArrayPortalMultiplexer
Allow Variant copy constructor/operators and its CastAndCall to operate
in noexcept methods. This can help the compiler make optimizations.
2019-07-25 15:25:29 -06:00
Allison Vacanti
403bca94c7 Merge topic 'error_on_cuda_flag_detect_failure'
5af957ec8 Error out when native CUDA flag detection fails.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1738
2019-07-25 13:54:04 -04:00
Allison Vacanti
5af957ec81 Error out when native CUDA flag detection fails.
Ref #388.
2019-07-25 12:17:46 -04:00
Allison Vacanti
77f17450ba Merge topic 'nvcc_fixes'
bff75de48 Use std::is_integral<T>::value instead of is_int<>{}.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1736
2019-07-23 16:33:17 -04:00
Allison Vacanti
bff75de48c Use std::is_integral<T>::value instead of is_int<>{}.
NVCC doesn't seem to handle the construction + implicit conversion
well. Explicitly specifying the value fixes this.
2019-07-23 11:38:37 -04:00
Kenneth Moreland
a96a13cf33 Use large case statements to CastAndCall variants
Previously, templates were used in the implementation of CastAndCall to
find the type and call the underlying function. The templates checked
one type at a time.

However, compilers were not always great at optimizing a 15-call deep
stack with an if statement at each one. Instead, use a case statement in
a single function block. This requires providing separate code for each
number of types. Currently, up to 20 are created (with pyexpander). If
there are more than that, then the template recurses.
2019-07-22 14:37:17 -06:00
Kenneth Moreland
866e1d7d5b Update comparison for virtual and multiplexer arrays
Previously the "dynamic" array was taken from a VariantArrayHandle.
However, the VariantArrayHandle will actually cast to a basic array, so
the comparison is not particularly fair. Change that to an
ArrayHandleVirtual so that it is actually calling through a virtual
method.

Also make 2 versions of the multiplexer test. The first version has an
array that is at the 1st index and the second is at the last index. This
tests whether the compiled code has to do lots of actual comparisons to
get to the last index.
2019-07-22 08:36:28 -06:00
Kenneth Moreland
5416cbeb7e Add ArrayHandleMultiplexer testing to BenchmarkFieldAlgorithms 2019-07-22 08:36:28 -06:00
Kenneth Moreland
d451064525 Add changedoc for ArrayHandleMultiplexer 2019-07-22 08:36:28 -06:00
Kenneth Moreland
0aa15c97ce Fix 'Failed to specialize alias template' error from Visual Studio
The code was working fine on all the dashboards except for the Visual
Studio 2015 compiles on delve. It gave an error like:

ArrayHandleMultiplexer.h(398): error C2938: 'ArrayHandleToStorageTag<unknown-type>' : Failed to specialize alias template

A StackOverflow article (https://stackoverflow.com/questions/43411542/
metaprogramming-failed-to-specialize-alias-template) suggests that this
is a bug in older versions of Visual Studio. Although fixed in more
recent versions, we might have to support older versions.
2019-07-22 08:36:28 -06:00
Kenneth Moreland
7b72e31dfb Fixes for CUDA 2019-07-22 08:36:28 -06:00
Kenneth Moreland
5e23853521 Create ArrayHandleMultiplexer 2019-07-22 08:36:28 -06:00
Kenneth Moreland
827613263a Avoid touching ListTag internals
Currently, ListTags are implemented by having a subtype name list set to
a brigand::list. However, there is always a chance this will change. To
make things more explicit, create a vtkm::internal::ListTagToBrigandList
to make it clear what the resulting type should be (and provide some
potential future-proofing).

Also add a convenient vtkm::ListTagApply that allows you to  easily
instantiate a template with the list of types in a ListTag.
2019-07-22 08:36:28 -06:00
Kenneth Moreland
58d3123370 Add Variant
vtkm::internal::Variant is a simplified version of C++17's std::variant
or boost's variant. It is a template that takes a list of types. The
Variant may be set to any one of those types. A CastAndCall allows you
to call a functor with the appropriately cast type.
2019-07-22 08:36:28 -06:00
Kenneth Moreland
468ee61cac Merge topic 'write-to-array-handle-cast'
6592e5288 Fix IsWritableArrayHandle for portals that exist but cannot be written
0e15a1116 Enable writing to ArrayHandleCast
6d37ce945 Remove invalid PortalType

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1731
2019-07-22 10:34:54 -04:00
Kenneth Moreland
6592e52880 Fix IsWritableArrayHandle for portals that exist but cannot be written
Previously, IsWriteableArrayHandle just checked to see if an
ArrayHandle's portal has a ValueType of void* because we had coded the
special read-only array handles to have fake portals for writing.
However, we recently removed that because it was more trouble than it
was worth. Now IsWritableArrayHandle checks for the existance of the Set
method. If it does not exist, then the portal is considered read-only.

Also corrected spelling (writeable -> writable).
2019-07-19 20:33:58 -06:00
Allison Vacanti
4e3e102531 Merge topic '385-fix_examples'
094cf2159 Rename a file to match CMakeLists.txt in an example.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1734
2019-07-19 15:59:36 -04:00
Allison Vacanti
63baa30829 Merge topic 'boundary_checks'
694d1e113 Add methods to BoundaryState to query specific offsets.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1733
2019-07-19 15:51:59 -04:00
Allison Vacanti
694d1e113d Add methods to BoundaryState to query specific offsets.
The existing functionality worked on radii, but it's helpful to
know if a specific sample location will be in bounds, too.
2019-07-19 15:09:57 -04:00
Allison Vacanti
094cf21599 Rename a file to match CMakeLists.txt in an example.
Fixes #385.
2019-07-19 12:02:51 -04:00