Commit Graph

2416 Commits

Author SHA1 Message Date
Sujin Philip
e734f14b88 LookupTable: Shift computed idx by 1
The below range value is at index 0 and the actual table begins fron
index 1.
2023-08-23 12:55:13 -04:00
Sujin Philip
fc9077e0c5 Mark ArrayHandle constructors taking buffers, as explicit
This resolves a compiler ambiguity I hit during development.
In my case, I created an `ArrayHandleDecorator` with one of the arrays being
an `ArrayHandleTransform`. The ambiguity occurs in function
`DecoratorStorageTraits<...>::BuffersToArray`, here an `ArrayHandleTransform`
is constructed using buffers (`std::vector<vtkm::cont::internal::Buffer>`)

This constructor is not defined for `ArrayHandleTransform`, but it's defined for
its superclass (`vtkm::cont::ArrayHandle`). `ArrayHandleTransform` does have a
non-explicit constructor that takes the array to be transformed and the
transform-functor as parameters, where the later has a default value.
This produces the following ambiguous options for the compiler:

1. Create a "to-be-transformed" ArrayHandle instance using the buffers, call
   the `ArrayHandleTransform` constructor with this array with the defaulted
   functor parameter.
2. Create the superclass instance using the buffer and call the
  `ArrayHandleTransform` constructor that takes the superclass.

In this situation, option 2 is the correct choice.

The ambiguity is resolved by marking the constructors that take
buffers as explicit. These constructors are also added for the
derived classess via the `VTK_M_ARRAY_HANDLE_SUBCLASS_IMPL` macro.
2023-06-21 13:50:33 -04:00
Kenneth Moreland
a1e8d029c5 Get the 3D index from a BoundaryState in WorkletPointNeighborhood
There are occasions when you need a worklet to opeate on 2D or 3D
indices. Most worklets operate on 1D indices, which requires recomputing
the 3D index in each worklet instance. A workaround is to use a worklet
that does a 3D scheduling and pull the working index from that.

The problem was that there was no easy way to get this 3D index. To
provide this option, a feature was added to the `BoundaryState` class
that can be provided by `WorkletPointNeighborhood`.

Thus, to get a 3D index in a worklet, use the
`WorkletPointNeighborhood`, add `Boundary` as an argument to the
`ExecutionSignature`, and then call `GetCenterIndex` on the
`BoundaryState` object passed to the worklet operator.
2023-06-19 10:29:18 -06:00
Kenneth Moreland
0182eb9d9d Test variant arguments to worklets
Add a regression test for passing a variant as an argument to a worklet.
Variants are tricky objects, and the compiler might make some strange
assumptions during optimization.

One case that popped up in particular was when a variant contained two
objects with the same `sizeof` but the first object had padding. When the
variant contained the second object, the value under the padded part of
the first object was not set.
2023-04-19 11:30:47 -06:00
Kenneth Moreland
4725288224 Fix the size of Mask and ScatterPermutation arrays
While adding checks to the size of implicit arrays, it was discovered
that some of the Mask and ScatterPermutation arrays were constructed
with the wrong sizes during dispatch. In particular, these arrays were
supposed to be sized on the output, but were instead sized on the input.
They went unnoticed because they were using implicit arrays that worked
even if the array access went out of bounds.
2023-04-12 14:37:26 -06:00
Jay
d8f3e68d1d add distributed statistics 2023-03-24 15:19:23 +00:00
Kenneth Moreland
634847ce20 Change PointAverage to work on fields of any type
The previous version of the `PointAverage` filter used a float fallback
to handle most array types. The problem with this approach other than
converting field types perhaps unexpectantly is that it does not work
with every `Vec` size. This change uses the extract by component feature
of `UnknownArrayHandle` to handle every array type.

To implement this change the `PointAverage` worklet had to be changed to
handle recombined vecs. This change resulted in a feature degridation
where it can no longer be compiled for inputs of incompatible `Vec`
sizes. This feature dates back to when worklets like this were exposed
in the interface. This worklet class is now hidden away from the exposed
interface, so this degredation should not affect end users. There are
some unit tests that use this worklet to test other features, and these
had to be updated.
2023-02-03 14:52:04 -05:00
Kenneth Moreland
0c13917c1e Change CellAverage to work on fields of any type
The previous version of the `CellAverage` filter used a float fallback
to handle most array types. The problem with this approach other than
converting field types perhaps unexpectantly is that it does not work
with every `Vec` size. This change uses the extract by component feature
of `UnknownArrayHandle` to handle every array type.

To implement this change the `CellAverage` worklet had to be changed to
handle recombined vecs. This change resulted in a feature degridation
where it can no longer be compiled for inputs of incompatible `Vec`
sizes. This feature dates back to when worklets like this were exposed
in the interface. This worklet class is now hidden away from the exposed
interface, so this degredation should not affect end users. There are
some unit tests that use this worklet to test other features, and these
had to be updated.
2023-02-03 14:51:40 -05:00
Jay
58acf3a43f add statistics filter 2023-01-30 10:21:47 +00:00
Vicente Adolfo Bolea Sanchez
049d0cca8c cmake: namespace vtkm export targets 2022-12-09 18:46:56 -05:00
Kenneth Moreland
3e1339f9a7 Remove deprecated features from VTK-m
With the major revision 2.0 of VTK-m, many items previously marked as
deprecated were removed. If updating to a new version of VTK-m, it is
recommended to first update to VTK-m 1.9, which will include the deprecated
features but provide warnings (with the right compiler) that will point to
the replacement code. Once the deprecations have been fixed, updating to
2.0 should be smoother.
2022-11-17 07:12:31 -06:00
Kenneth Moreland
a58c2cdacf Change how cell ghost levels are set
The name of the methods were changed from `AddGhostCellField` to
`SetGhostCellField` since only one field can be marked as the cell
ghost. Also automatically select a field that matches
`GetGlobalCellFieldName` if nothing else is set.
2022-11-09 08:40:37 -07:00
Kenneth Moreland
aa56875122 Correct the number of points in SplitSharpEdges filter
The cell set created in the `SplitSharpEdges` filter had the number of
points of the input, not the output. This inconsistency became worse now
that `DataSet` is doing more to check the consistency of point and cell
field lengths.
2022-10-31 16:23:14 -06:00
Kenneth Moreland
2945813755 Removed ExecutionWholeArray class
`ExecutionWholeArray` is an archaic class in VTK-m that is a thin wrapper
around an array portal. In the early days of VTK-m, this class was used to
transfer whole arrays to the execution environment. However, now the
supported method is to use `WholeArray*` tags in the `ControlSignature` of
a worklet.

Nevertheless, the `WholeArray*` tags caused the array portal transferred to
the worklet to be wrapped inside of an `ExecutionWholeArray` class. This
is unnecessary and can cause confusion about the types of data being used.

Most code is unaffected by this change. Some code that had to work around
the issue of the portal wrapped in another class used the `GetPortal`
method which is no longer needed (for obvious reasons). One extra feature
that `ExecutionWholeArray` had was that it provided an subscript operator
(somewhat incorrectly). Thus, any use of '[..]' to index the array portal
have to be changed to use the `Get` method.
2022-10-27 15:07:41 -06:00
Kenneth Moreland
ad1e7b5bdb Add module mechanism
This mechanism sets up CMake variables that allow a user to select which
modules/libraries to create. Dependencies will be tracked down to ensure
that all of a module's dependencies are also enabled.

The modules are also arranged into groups.
Groups allow you to set the enable flag for a group of modules at once.
Thus, if you have several modules that are likely to be used together,
you can create a group for them.

This can be handy in converting user-friendly CMake options (such as
`VTKm_ENABLE_RENDERING`) to the modules that enable that by pointing to
the appropriate group.
2022-10-26 12:51:05 -06:00
Vicente Adolfo Bolea Sanchez
e4d23a4ae6 CI: remove unused variable warnings 2022-10-25 15:40:48 -04:00
Dave Pugmire
ee31217da5 Convert LagrangianStructures filter to NewFilter 2022-09-20 13:40:50 -06:00
Mathieu Westphal
70ba476bd5 Fix doxygen groups 2022-09-09 10:37:31 +08:00
Gunther Weber
9551175dd4 Merge topic 'contour-tree-spatial-decomposition-refactor'
cd3fe3d47 Eliminate need for SpatialDecomposition in contour tree filters.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2825
2022-08-03 13:11:58 -04:00
Gunther H. Weber
cd3fe3d47d Eliminate need for SpatialDecomposition in contour tree filters.
This commit address issue #713 and removes the need to pass information
about the spatial decomposition (block origins, block sizes, block index
and blocks per dimension) to the contour tree filter. Block origin
information is added to CellSetStructured (as GlobalPointSize) and the
distributed contour tree filter will get this information from
CellSetStructured instead of expecting it as parameters to the
constructor. Information about blocks per dimension and block indices
are computed from the information in CellSetStructure albeit requiring
global communication across all ranks. To avoid this communication cost,
the caller of the filter may explicitly specify this information via the
SetBlockIndices() method.
2022-08-02 20:01:41 -07:00
Dave Pugmire
64f9d2fbf0 Merge topic 'remove_templates_from_streamline_filters'
898a3e092 Move StreamSurface into NewFilterField
5ffae6111 Use CastAndCallForTypes with UnknownArray of seeds.
061fe6afb Fix dashboard compile errors.
42fd70d50 Remove virtuals from DataSetIntegrator classes.
2524c16a0 Missed some cuda fixes filters...
e1fbfea30 Remove device compiler dependencies.
2a4430447 tests need to be device compiled.
9b2a257d9 Move include  out of .h file.
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2777
2022-08-01 19:55:03 -04:00
Tushar Athawale
aa01c51cb9 Addition of GhostCellField API to the Dataset Class
AddGhostCellField function for Dataset class

setGhostCellName function for GhostCellClassify class

setGhostCellName function for GhostCellClassify class

added default ghost cell name in Dataset class

Default ghost cell field name defined in GhostCellClassify class

Default ghost cell field name for GhostCellClassify class

Unit test for ghost field name check

Unit test for ghost field name check updated

Default ghost field name updated

Get function for GhostCellClassify and default ghost name

UnitTestStreamlineFilter updated with AddGhostCellField

AddGhostCellField and GetGlobalGhostCellFieldName propagated

GhostCellClassify constructor now defined in header file

Assigned default values to dataset class members GhostSet and GhostCellName

default values set for GhostSet and GhostCellName in dataset constructor

Constructor removed from dataset class and noexcept for GetGlobalGhostName

added Dataset constructor with noexcept

additions to make sure default move constructor has not changed

GhostSetName field made as a shared pointer since string class is not noexcept

AddGhostCellField funtion added without field name

hasGhostCellField added and unit tests updated for addGhostCellField

hasGhostCellField added and unit tests updated for addGhostCellField

GetGhostCellField and GetGhostCellFieldName functions added to Dataset

GetGhostCellField and GetGhostCellFieldName functions added to Dataset

debugging UnitTestCellLocatorGerneral for CUDA error

UnitTestCellLocatorGeneral testing for error

UnitTestCellLocatorGeneral testing for cude error

UnitTestCellLocatorGeneral error resolution

UnitTestCellLocatorGeneral error resolution

UnitTestCellLocatorGeneral error resolution print statement removed

Minor updates to Dataset class files

GlobalGhostCellFieldName implementation revised to return a static variable

GhostSet member removed, hasGhostCellField, constructor, copystructure updated

GetGhostCellField and GetGhostCellFieldName made cosistent with GetField

Fixes to a few function calls
2022-07-28 16:49:14 -04:00
Dave Pugmire
d2aacfc07e Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into remove_templates_from_streamline_filters 2022-07-25 11:52:45 -04:00
Dave Pugmire
6a934167c2 Move streamsurface into flow 2022-07-25 09:09:59 -04:00
Dave Pugmire
e786874a77 Move tests into flow/testing 2022-07-22 15:46:59 -04:00
Dave Pugmire
ed11e447d0 Move the worklets over to filter/flow. 2022-07-22 15:31:58 -04:00
Dave Pugmire
80b0608ab2 Put steady/unsteady into sep files. 2022-07-15 11:36:02 -04:00
Vicente Bolea
3ae5511211 Merge topic 'add-macos-build'
e26455076 CI: adds gitlab macos_xcode13 build
464524a4b Worklet: remove unused var in WaveletDWT
c661e4afb CI: refactor cmake.sh file
5c5ec868d CI: updates cmake sha256sum for macOS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2810
2022-07-11 14:57:55 -04:00
Vicente Adolfo Bolea Sanchez
464524a4b2 Worklet: remove unused var in WaveletDWT 2022-07-09 13:29:26 -04:00
Kenneth Moreland
80f15aa8de Fix dispatcher invoke error test for asychronous schedules 2022-07-08 06:57:43 -06:00
Kenneth Moreland
567b626080 Remove warnins about unused functions
nvcc is giving me lots of annoying warnings about unused functions.
Typically, this warning is given when a function declared as static or
in an anonymous namespace is never used. The "functions" in question are
not really functions. They are templated methods (in a class in an
anonymous namespace).

Specificaly, I'm getting errors like this:

```
/.../vtkm/cont/testing/UnitTestArrayHandleDecorator.cxx(96): warning #177-D: function "<unnamed>::DecoratorTests::InvertibleDecorImpl::CreateFunctor(PortalTs&&...) const [with PortalTs=<vtkm::cont::internal::decor::GetWritePortalType<vtkm::cont::ArrayHandleCounting<signed char>>, vtkm::cont::internal::decor::GetWritePortalType<vtkm::cont::ArrayHandleConstant<signed char>>, vtkm::cont::internal::decor::GetWritePortalType<vtkm::cont::ArrayHandle<vtkm::Int8, vtkm::cont::StorageTagBasic>>>]" was declared but never referenced
```

That said, these warnings appear to be an annoying but harmless bug in
nvcc. This warning is in error because

1. The method in question is _definitely_ being used.
2. I'm pretty sure this warning should not be given for a templated
method even if it was never used. SFINAE alone should be enough
justification to allow this to exist without warning.

The easiest way around the spurious error is to declare these structures
in a namespace with a name.
2022-07-08 06:28:51 -06:00
Kenneth Moreland
163d591795 Add DEVICE_SOURCES to vtkm_unit_tests
The `vtkm_unit_tests` function in the CMake build now allows you to specify
which files need to be compiled with a device compiler using the
`DEVICE_SOURCES` argument. Previously, the only way to specify that unit
tests needed to be compiled with a device compiler was to use the
`ALL_BACKENDS` argument, which would automatically compile everything with
the device compiler as well as test the code on all backends.
`ALL_BACKENDS` is still supported, but it no longer changes the sources to
be compiled with the device compiler.
2022-07-08 06:28:51 -06:00
Li-Ta Lo
d1cede4d2b migrated ContourTreeUniformDistributed filter 2022-06-29 14:58:10 -06:00
Dave Pugmire
c7f11ae5bc Fixes for PA and SL filters. 2022-06-29 09:38:24 -04:00
Li-Ta Lo
7c8dbcde28 migrated ContourTreeAugmented filter 2022-06-27 18:01:42 -06:00
Li-Ta Lo
579b75bb04 migrate ContourTreeUniform filter 2022-06-09 11:49:49 -06:00
Abdelilah Essiari
6a7aaa5a32 Add unit tests and refactor based on merge request discussion
Co-authored-by: Gunther H. Weber <GHWeber@lbl.gov>
2022-06-06 19:57:13 -07:00
Gunther H. Weber
f871f51cb8 Move computing branch decomposition to a separate filter 2022-06-06 19:57:13 -07:00
Oliver Ruebel
4fe495be8d Implement branch decomposition for hierarchical contour tree
Co-authored-by: Gunther H. Weber <GHWeber@lbl.gov>
2022-06-06 19:57:13 -07:00
oruebel
af5073885e Add timers to distributed contour tree; reduce data size sent during reduction
Co-authored-by: Gunther H. Weber <GHWeber@lbl.gov>
2022-06-06 19:57:13 -07:00
Li-Ta Lo
911c663774 Merge branch 'master' into mir_filter 2022-05-18 08:57:10 -06:00
Li-Ta Lo
2b102e2b7c Merge topic 'probe_refactor'
849106762 remove include CellDeepCopy
4108febd3 remove #include functional
daaac78f1 minor changes based on code review
aecdd7705 Update vtkm/filter/resampling/testing/CMakeLists.txt
38000ed6d Use ALL_BACKENDS for unit test
ab09f77b7 migrate Probe filter

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2771
2022-05-18 10:48:37 -04:00
Li-Ta Lo
ab09f77b7c migrate Probe filter 2022-05-16 14:55:14 -06:00
Li-Ta Lo
0a0e30858e Migrate MIR filter 2022-05-16 09:26:08 -06:00
Kenneth Moreland
746d1efa4f Use Buffer objects for dispatcher base test
`UnitTestDispatcherBase` previously used arrays from `std::vector` to
test dispatching data to worklets. This only works for devices that have
unified memory with the host.

Change the test to use `vtkm::cont::internal::Buffer` objects and
properly copy data to/from the device for devices that have separate
memory spaces.
2022-05-13 16:02:59 -04:00
Kenneth Moreland
3ba13c5cc4 Re-enable hip builds
There were several tests that were disabled for hip because they either
took too long to compile or were failing. We are getting closer to
making everything work, so re-enable this part of the build.
2022-05-12 16:00:30 -04:00
Kenneth Moreland
e1e3d4af2f Merge topic 'scoped-enum-cell-classification'
5d90102f1 Remove deprecated use of vtkm::CellClassification
ccef4d2db Fix scoping of vtkm::CellClassification

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2737
2022-03-21 12:40:05 -04:00
Kenneth Moreland
5d90102f1b Remove deprecated use of vtkm::CellClassification 2022-03-17 15:34:01 -06:00
Kenneth Moreland
f8f41e0ef5 Update use of field association enumerations
The enumerations in `vtkm::cont::Field::Association` were renamed in the
previous commit. The old names still exist, but are deprecated. Change
the rest of the code to use the new names.
2022-03-17 11:02:37 -06:00
Kenneth Moreland
2b64630674 Enable predicate parameter to ListAll and ListAny
In pretty much any practical circumstance, whenusing `ListAll` or
`ListAny`, you have a list of types on which you run some sort of
predicate on each item in the list to determine whether any or all of
the items match the predicate. To make this easier, add a second
argument to `ListAll` and `ListAny` to provide a predicate that will
automatically be added.

If no predicate is given, then the operation is run directly on the
list. This is implemented by just using an identity operation.
2022-03-08 09:26:35 -07:00