Commit Graph

6300 Commits

Author SHA1 Message Date
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
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
Robert Maynard
c18f762697 Merge topic 'add_odr_warning_flag'
736664612 Cleanup VTK-m warning flags and add in Wodr

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1732
2019-07-18 16:16:51 -04:00
Robert Maynard
736664612d Cleanup VTK-m warning flags and add in Wodr
This was done to help us catch ODR violations quicker
2019-07-18 13:33:18 -04:00
Kenneth Moreland
0e15a1116c Enable writing to ArrayHandleCast
Previously, `ArrayHandleCast` was considered a read-only array handle.
However, it is trivial to reverse the cast (now that `ArrayHandleTransform`
supports an inverse transform). So now you can write to a cast array
(assuming the underlying array is writable).

One trivial consequence of this change is that you can no longer make a
cast that cannot be reversed. For example, it was possible to cast a simple
scalar to a `Vec` even though it is not possible to convert a `Vec` to a
scalar value. This was of dubious correctness (it is more of a construction
than a cast) and is easy to recreate with `ArrayHandleTransform`.
2019-07-17 18:40:45 -06:00
Kenneth Moreland
6d37ce9453 Remove invalid PortalType
Several ArrayHandles (actuall Storage implementations) had a fake portal
type that only defined invalid value types and no Get/Set methods. The
idea was to quickly identify when using a read-only array for writing.
However, this was more trouble than it was worth as the compiler just
gives  an incomprehensible error and it is hard to track down the actual
value.

Now actually define some type even if it is never used.
2019-07-17 18:39:00 -06:00
Robert Maynard
8d3310fe55 Merge topic 'namespace_lodepng'
46a1df6c1 DecodePNG uses the namespaced lodepng from thirdparty/
26e50065a Merge branch 'upstream-lodepng' into namespace_lodepng
43e0185b2 lodepng 2019-07-17 (82328a33)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Matt Larsen <larsen30@llnl.gov>
Merge-request: !1728
2019-07-17 16:07:15 -04:00
Kenneth Moreland
79909ecf12 Merge topic 'add_mesh_quality'
b622c7962 Fixed index out of bounds error for the cell counts array
4d61066e9 Removed all modifications in the internal device adapter algorithm header files.
06ac9f721 Revised version of the original mesh quality merge request
e54001367 Added few lines of code missing from cuda device adapter header
3dd34d251 Added custom CopyIf function
417dbcea7 Removed all modifications in the internal device adapter algorithm header files.
50cb805ce Fixed cuda device adapter alg
8c070caa0 Added few lines of code missing from cuda device adapter header
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1714
2019-07-17 15:42:22 -04:00
Robert Maynard
46a1df6c18 DecodePNG uses the namespaced lodepng from thirdparty/ 2019-07-17 14:21:33 -04:00