Commit Graph

149 Commits

Author SHA1 Message Date
Kenneth Moreland
46508487a0 Fix doxygen warnings with worklet base classes
Some versions of doxygen have issues with documenting `typedef`s (or the
equivalent `using`). This was causing warnings with doxygen and failing
to create some of the documentation. This fixes the problem by moving the
documentation to the classes things are defined to.
2024-02-12 15:37:40 +09:00
Kenneth Moreland
d77c5812c3 Deprecate the GetCounts() method in Keys objects
The `vtkm::worklet::Keys` object held a `SortedValuesMap` array, an
`Offsets` array, a `Counts` array, and (optionally) a `UniqueKeys` array.
Of these, the `Counts` array is redundant because the counts are trivially
computed by subtracting adjacent entries in the offsets array. This pattern
shows up a lot in VTK-m, and most places we have moved to removing the
counts and just using the offsets.

This change removes the `Count` array from the `Keys` object. Where the
count is needed internally, adjacent offsets are subtracted. The deprecated
`GetCounts` method is implemented by copying values into a new array.
2024-01-25 16:13:54 -05:00
Kenneth Moreland
29c96a24fa Rename structured connectivity index conversion methods
The structured connectivity classes are templated on two tags to
determine what 2 incident topological elements are being accessed. Back
in the day, these were called the "from" elements and "to" elements, as
taken from VTK filter names like `PointDataToCellData`. However, these
names were found to be very confusion, and after much debate they have
been renamed to the visit element type and the incident element type.
Meaning that a worklet is "visiting" elements of a particular type (such
as visiting each cell) and can access "incident" elements of a
particular type (such as the points incident on the cell).

I found a few methods converting flat and logical indices using the old,
confusing from/to convention. This changes them to the new convention.
2023-06-02 15:31:24 -04:00
Kenneth Moreland
d26d76deaf Fix construction issue for XGC arrays in topology map fetch
The `Fetch::Load` for an input array of a topology map for an XGC array
(that uses `ConnectivityExtrude`) was failing to compile because it
creates a return `Vec` and then fills it. That does not work if the
input array has values that cannot be default constructed. This is the
case for `ArrayHandleRecombineVec`, which creates values that lazily
pull data out of portals.

Change the code to careful construct the return `Vec` such that it does
not require the default constructor of the components.
2023-02-03 14:52:06 -05:00
Kenneth Moreland
eda6dc39f2 Support using arrays with dynamic Vec-likes as output arrays
When you use an `ArrayHandle` as an output array in a worklet (for example,
as a `FieldOut`), the fetch operation does not read values from the array
during the `Load`. Instead, it just constructs a new object. This makes
sense as an output array is expected to have garbage in it anyway.

This is a problem for some special arrays that contain `Vec`-like objects
that are sized dynamically. For example, if you use an
`ArrayHandleGroupVecVariable`, each entry is a dynamically sized `Vec`. The
array is referenced by creating a special version of `Vec` that holds a
reference to the array portal and an index. Components are retrieved and
set by accessing the memory in the array portal. This allows us to have a
dynamically sized `Vec` in the execution environment without having to
allocate within the worklet.

The problem comes when we want to use one of these arrays with `Vec`-like
objects for an output. The typical fetch fails because you cannot construct
one of these `Vec`-like objects without an array portal to bind it to. In
these cases, we need the fetch to create the `Vec`-like object by reading
it from the array. Even though the data will be garbage, you get the
necessary buffer into the array (and nothing more).

Previously, the problem was fixed by creating partial specializations of
the `Fetch` for these `ArrayHandle`s. This worked OK as long as you were
using the array directly. However, the approach failed if the `ArrayHandle`
was wrapped in another `ArrayHandle` (for example, if an `ArrayHandleView`
was applied to an `ArrayHandleGroupVecVariable`).

To get around this problem and simplify things, the basic `Fetch` for
direct output arrays is changed to handle all cases where the values in the
`ArrayHandle` cannot be directly constructed. A compile-time check of the
array's value type is checked with `std::is_default_constructible`. If it
can be constructed, then the array is not accessed. If it cannot be
constructed, then it grabs a value out of the array.
2023-01-23 13:02:40 -07: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
Kenneth Moreland
36352912bc Support scatter/mask for CellSetExtrude
Scheduling topology map workets for `CellSetExtrude` always worked, but
the there were indexing problems when a `Scatter` or a `Mask` was used.
This has been corrected, and now `Scatter`s and `Mask`s are supported on
topology maps on `CellSetExtrude`.
2021-09-27 13:27:02 -06:00
Kenneth Moreland
9d5d9e38a1 Remove testing headers from benchmarking
The code in `vtkm/cont/Testing.h` now requires a library, which is not
built if testing is not built. Thus, the benchmarking code was giving a
compile error if benchmarking was on but testing was off.

Change the benchmarking to not rely on anything in the Testing
framework. This means using classes in `vtkm/source` instead of
`MakeTestData`. Also avoid using the `TestValue` defined for the tests.
(In one case, we have a simple replacement.) Also had to fix a problem
with a header file not defining everything it needed to compile.
2021-06-10 09:41:26 -06:00
Ben Boeckel
4c7fe13a98 cmake: avoid adding testing directories if testing is disabled
Some testing directories have side effects such as installing headers or
compiling code that ultimately doesn't end up getting used.
2021-06-01 18:40:40 -04:00
Caitlin Ross
46155daaa2 removing ArrayHandleExtrude* 2021-02-10 15:20:35 -05:00
Kenneth Moreland
4d8f05baef Update CellSetExtrude to not specify exec types by device
Somewhere during this edit I removed a header file that didn't strictly
need to be there. This caused me to have to add

```cpp
```

in several places in the code.
2021-02-08 16:57:16 -07:00
Kenneth Moreland
f941cb607c Move Fetch specializations to vtkm/exec/arg
Some of the special `ArrayHandle`s require specialized versions of
`vtkm::exec::arg::Fetch`. The specializations were not put in the
respective vtkm/exec/arg/Fetch*.h header files because the definition of
the `ArrayHandle`s was not available there. The implementation was in
the ArrayHandle*.h files, but it is hard to find the specialization
there.

Instead, make a secondary header file in vtkm/exec/arg that implements
the Fetch specialization and include it from the ArrayHandle*.h file.
That way, the basic Fetch does not have to include odd `ArrayHandle`
types but the `Fetch` implemenations are still all located together.
2021-01-11 10:47:58 -07:00
Robert Maynard
1365cfa9ec Update ConnectivityExtrude to follow clangs rules on markup 2020-09-25 09:37:46 -04:00
Kitware Robot
cf0cdcf7d1 clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
Sujin Philip
452f61e290 Add Kokkos backend 2020-08-12 13:55:24 -04:00
Li-Ta Lo
567b1fedd2 Merge topic 'cell_neighbor'
9cd70a7dc Install WorkletNeighborhood.h
f66c782b1 Extract WorkletNeighborhood base class
760c51ed6 install ThreadIndicesNeighborhood.h
e52b8fa88 Add CellNeighborhood

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !2181
2020-07-21 13:45:40 -04:00
Li-Ta Lo
f66c782b14 Extract WorkletNeighborhood base class 2020-07-20 17:50:14 -06:00
Li-Ta Lo
760c51ed62 install ThreadIndicesNeighborhood.h 2020-07-16 08:06:17 -06:00
Li-Ta Lo
e52b8fa88a Add CellNeighborhood 2020-07-15 14:41:32 -06:00
Caitlin Ross
235d9ce14b add GetThreadIndex to ThreadIndicesExtrude classes 2020-07-08 14:51:41 -04:00
Robert Maynard
a652f7fe1e Update vtk-m doxygen to generate less warnings 2020-06-01 16:58:32 -04:00
Kenneth Moreland
b1f288aaea Add non-templated base class to Keys class.
The only reason Keys has a template is so that it can hold a UniqueKeys
array and provide the key for each group. If that is not needed and you
want to implement a library function that takes a keys object, you can
now grab the Keys superclass KeysBase. KeysBase is not templated, so you
can pass it to a standard method in a library.
2020-05-21 08:34:07 -06:00
Vicente Adolfo Bolea Sanchez
d5906eccd9 add ThreadIndicesTopologyMap optimized specializations
This commit splits ThreadIndicesTopologyMap into two
different specializations which can be instanciated with the
tags: DefaultScatterAndMaskTag and CustomScatterAndMaskTag.

These specialization will allow ThreadIndicesTopologyMap
instances to avoid holding in memory InputIndex, OutputIndex and ThreadIndex
variables when Mask = MaskNone and Scatter = ScatterIdentity which in this case
are not needed since no transformation are done.

Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2020-05-12 13:45:43 -04:00
Vicente Adolfo Bolea Sanchez
d0396e2a40 relaxes ThreadIndicesType across multiple worklets fetchs
This change is needed for being able to use different thread indices types
without changing Fetchs. Basically decoupling those two areas.

1. This commit removes concrete specialization instantiations of
   ThreadIndicesTypes in all of the Fetch's specializations.

2. It also moves the ThreadIndicesType template parameter from the Fetch
   struct to a template parameter in their methods Load/Store.

Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2020-04-24 17:39:31 -04:00
Vicente Adolfo Bolea Sanchez
6c7855aed8 relax ThreadIndicesType requirements for WorkletInvokeFunctorDetail
Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2020-04-10 13:13:35 -04:00
Kenneth Moreland
545e60fbe3 Merge topic 'no-streaming-arrayhandle'
4f9fa08fa Remove ArrayHandleStreaming capabilities

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2008
2020-03-25 11:26:26 -04:00
Kenneth Moreland
4f9fa08fa1 Remove ArrayHandleStreaming capabilities
The `ArrayHandleStreaming` class stems from an old research project
experimenting with bringing data from an `ArrayHandle` in parts and
overlapping device transfer and execution. It works, but only in very
limited contexts. Thus, it is not actually used today. Plus, the feature
requires global indexing to be permutated throughout the worklet
dispatching classes of VTK-m for no further reason.

Because it is not really used, there are other more promising approaches
on the horizon, and it makes further scheduling improvements difficult,
we are removing this functionality.
2020-03-24 15:01:56 -06:00
Kenneth Moreland
42bc9a393c Fix gaps in type support
With recent changes to allow a configuration to change the default
types, storage, and cell sets, it is possible to feed filters and other
components types they were not previously expecting. Fix feature gaps
where these components were not accepting the types they should.
2020-03-19 17:07:11 -06:00
Vicente Adolfo Bolea Sanchez
e2c32ffac7 add unit test for WorkletMapTopology
Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2020-03-18 10:26:58 -04:00
Vicente Adolfo Bolea Sanchez
0e90c22e70 Worklet{MapTopology,PointNeighbor} custom sg/mask
The change affects the method GetThreadIndices for both
WorkletMapTopology and WorkletPointNeighborhood.

Before an scatter or mask which was not ScatterIdentity or MaskNone
was not allowed and it was enforced at compilation time.

Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2020-03-12 11:49:10 -04:00
Robert Maynard
1f1688483e Initial infrastructure to allow WorkletMapField to have 3D scheduling 2020-02-25 15:23:41 -05:00
Kenneth Moreland
2fbcc78a60 Merge topic 'simple-list-template'
4659d69c7 Remove some commented out code
aec75ab1a Suppress CUDA warning about device calling host
851864d0b Work around with Visual Studio 2015 issue
452a2e1c9 Suppress warnings about CUDA host/device mismatch
4fdefe9f1 Suppress some deprecated warnings in visual studio
5cfc14482 Implement old ListTag features with new ListTag implementations
d5fe4046c Remove instances of ListTag in favor of List
92db37623 Convert uses of ListTagBase to List
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1918
2019-12-11 09:43:22 -05:00
Robert Maynard
f89672b71a UnitTestFetchArrayTopologyMapIn now compiles with VS2015
Fixes #445
2019-12-06 09:27:45 -05:00
Kenneth Moreland
cd302effb3 Update lists in TypeListTag.h
A new header named TypeList.h and the type lists have been redefined in
this new file. All the types have been renamed from `TypeListTag*` to
`TypeList*`. TypeListTag.h has been gutted to provide deprecated
versions of the old type list names.

There were also some other type lists that were changed from using the
old `ListTagBase` to the new `List`.
2019-12-05 11:05:19 -07:00
Robert Maynard
daa6b0984b Another round of simplifications to FunctionInterface
Yet more ways that we can reduce the complexity of `FunctionInterface`.
This is another step in figuring out what set of features the replacement
for `FunctionInterface` needs to have.
2019-12-04 14:02:44 -05:00
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
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
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
Mark Kim
8a3528d700 consolidate some files
ArrayPortalExtrude and ArrayPortalExtrudePlane
merged into StorageExtrude.h
2019-06-22 00:48:12 -04:00
Mark Kim
978fc2b9c2 Copyright notices. 2019-06-21 11:35:46 -04:00
Mark Kim
6e1d3a84f0 First Extrude commit.
how did any of this work?

match other CellSet file layouts.

???

compile in CUDA.

unit tests.

also only serial.

make error message accurate

Well, this compiles and works now.

Did it ever?

use CellShapeTagGeneric

UnitTest matches previous changes.

whoops

Fix linking problems.

Need the same interface

as other ThreadIndices.

add filter test

okay, let's try duplicating CellSetStructure.

okay

inching...

change to wedge in CellSetListTag

Means changing these to support it.

switch back to wedge from generic

compiles and runs

remove ExtrudedType

need vtkm_worklet

vtkm_worklet needs to be included

fix segment count for wedge specialization

need to actually save the index

for the other constructor.

specialize on Explicit

clean up warning

angled brackets not quotes.

formatting
2019-06-20 22:17:24 -04:00
nadavi
fbcea82e78 conslidate the license statement 2019-04-17 10:57:13 -06:00
Kenneth Moreland
191d6e5580 Add Mask capabilities to worklets
Mask objects allow you to specify which output values should be
generated when a worklet is run. That is, the Mask allows you to skip
the invocation of a worklet for any number of outputs.
2019-02-25 08:58:39 -07:00
Robert Maynard
d6f66d17a3 Testing run methods now take argc/argv to init logging/runtime device
`vtkm::cont::testing` now initializes with logging enabled and support
for device being passed on the command line, `vtkm::testing` only
enables logging.
2019-01-17 13:16:27 -06:00
Robert Maynard
20d02fdec2 Support pointers in vtkm::exec::Fetch classes 2018-12-27 13:19:40 -05:00
Kenneth Moreland
82536092cc Rename boundary classes
Did a bit of renaming of the support classes used for
WorkletPointNeighborhood. First, the OnBoundary tag is changed to
Boundary to match other tags and reflect some changes in the resulting
methods. Also moved the BoundaryState and Neighborhood classes from
vtkm::exec::arg to vtkm::exec to be more accessible. Finally, the
Neighborhood class name was changed to FieldNeighborhood to be more
specific on what role this class plays with neighborhood.
2018-12-03 12:45:23 -07:00
Kenneth Moreland
e008aff27b Change neighborhood parameter from layer to radius
It was determined that the word "radius" more clearly described how the
size of the neighborhood is determined.
2018-12-03 12:45:23 -07:00
Kenneth Moreland
01a9e85416 Change WorkletPointNeighborhood to specify neighborhood at runtime
Previously, WorkletPointNeighborhood had a template argument to select
the size of the neighborhood. This change removes that template
argument. Instead, the vtkm::exec::arg::BoundaryState methods now take
in a size parameter when determining when it overlaps the boundary.

If in the future we want to add the ability to select the neighborhood
size at compile-time (for performance reasons), I suggest adding this
template argument to the OnBoundary tag for ExecutionSignature.
2018-12-03 12:45:23 -07:00
Kenneth Moreland
3e3baad6f8 Add better queries to vtkm::exec::arg::BoundaryState
Previously, vtkm::exec::arg::BoundaryState only provided methods that
said whether or not the neighborhood extened past the boundary of a
mesh. That is fine for a 3x3x3 neighborhood, which can only extend over
the boundary by one. However, that is problematic for larger
neighborhoods where you may need to know how far neighborhood extends
over the boundary.

This changes allows you to query how far the neighborhood extends within
the constrains of the boundary.
2018-11-13 22:45:06 -06:00
Robert Maynard
fc6fcee8fd Merge topic 'support_connectivity_with_no_default_constructor'
d1d8756dc ThreadIndicesTopologyMap supports types without a default constructor

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1410
2018-09-18 11:49:32 -04:00