Commit Graph

636 Commits

Author SHA1 Message Date
Abhishek Yenpure
16f15c94b9 Adding fixes to identify degenerate cells 2022-01-22 21:06:28 -08:00
Kenneth Moreland
a2ab460f5d Compile more sources without device compiler
We have been doing a better job at hiding device code (and moving code
into libraries). Smoke out source that no longer needs to be compiled by
device compilers.
2022-01-03 08:23:04 -07:00
Kenneth Moreland
e9da343109 Handle Variant::Get for types not supported by the Variant
Previously, if you called `Get` on a `Variant` with a type that is not
in the list of types supported by the `Variant`, that would attempt to
look up the type at index `-1` and could spin the compiler into an
endless loop.

Instead, check for the case where you are attempting to get a type from
the `Variant` not listed in its templat arguments. In this case, instead
of producing a compiler error, produce a runtime error. Although this
increases the possibility that a bad compile path is being generated, it
simplifies creating templated code that produces cases we don't care
about.
2021-10-04 10:19:25 -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
Vicente Adolfo Bolea Sanchez
d348b11183 Enable shared CUDA builds when not compiling virtuals
The reason why we did not support shared libraries when CUDA compiles
were on is that virtual methods require a special linking step to pull
together all virtual methods that might be called. I other words, you
cannot call a virtual CUDA method defined inside a library. This
requirement goes away when virtuals are removed.

Also removed the necessity of using seprable compilation with cuda.
Again, this is only needed when a CUDA function is defined in one
translation unit and used in another. Now we can enforce that all
translation units define their own CUDA functions.

Also, suppress warnings in cuda/internal/ExecutionPolicy.h

This is where we call the thrust algorithms. There must be some loop
where it, on some code path, calls back a host function. This must be in
an execution path that never happens. The thrust version has its own
suppress, but that does not seem to actually suppress the warning (it
just means that the warning does not tell you where the actual call is).

Get around the problem by suppressing the warnings in VTK-m.

Co-authored-by: Kenneth Moreland <morelandkd@ornl.gov>
Co-authored-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>

Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2021-08-24 13:14:58 -04:00
Kenneth Moreland
9ce97352d9 Fix divide-by-zero in UnitTestCellInterpolate 2021-07-12 10:29:46 -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
Kenneth Moreland
8eed21d085 Do not declare headers for virtual classes that are removed 2021-04-28 15:28:06 -06:00
Kenneth Moreland
cb3bb43ff9 Completely deprecate virtual methods
Deprecate `VirtualObjectHandle` and all other classes that are used to
implement objects with virtual methods in the execution environment.

Additionally, the code is updated so that if the
`VTKm_NO_DEPRECATED_VIRTUAL` flag is set none of the code is compiled at
all. This opens us up to opportunities that do not work with virtual
methods such as backends that do not support virtual methods and dynamic
libraries for CUDA.
2021-04-28 07:28:32 -06:00
Kenneth Moreland
6921b5cc3d Minor style changes in UnitTestVariant 2021-04-01 14:47:51 -06:00
Kenneth Moreland
9816c422b1 Add padding to Grid struct in CellLocatorTwoLevel
There appears to be a bug in CUDA 9.2 where if you have a class that
contains a struct that itself has to have padding in the middle for
alignment purposes and you then put that class in a union with other
classes, it seems like that padding can cause problems with other
objects in the union.
2021-03-30 12:59:07 -06:00
Kenneth Moreland
e480fd7a24 Support copying a Variant to itself 2021-03-30 12:59:07 -06:00
Kenneth Moreland
d2d9ba3321 Make connectivity structures trivially copyable
It always worked to trivially copy these classes, but the compiler did
not think so because copy constructors were defined. Change these
constructors to be default so that the compler can properly check
triviality.
2021-03-30 12:59:07 -06:00
Kenneth Moreland
c9bcdd0195 Use a union in Variant for safe type punning
Create a `VaraintUnion` that is an actual C++ `union` to store the data
in a `Variant`.

You may be asking yourself, why not just use an `std::aligned_union`
rather than a real union type? That was our first implementation, but
the problem is that the `std::aligned_union` reference needs to be
recast to the actual type. Typically you would do that with
`reinterpret_cast`. However, doing that leads to undefined behavior. The
C++ compiler assumes that 2 pointers of different types point to
different memory (even if it is clear that they are set to the same
address). That means optimizers can remove code because it "knows" that
data in one type cannot affect data in another type. To safely change
the type of an `std::aligned_union`, you really have to do an
`std::memcpy`. This is problematic for types that cannot be trivially
copied. Another problem is that we found that device compilers do not
optimize the memcpy as well as most CPU compilers. Likely, memcpy is
used much less frequently on GPU devices.
2021-03-30 10:16:16 -06:00
Li-Ta Lo
b590a8ebb2 Add floating point atomics 2021-03-11 08:19:51 -07:00
Kenneth Moreland
80c1f0a974 Be more conservative about is_trivial support
`std::is_trivial` is part of the C++14 specification. However, we have
encountered multiple compilers that purport to implement C++14 but do
not implement `std::is_trivial` and the like checks correctly.

To avoid such issues, only use `std::is_trivial` on compilers that we
have tested to support it.
2021-03-01 15:12:27 -07:00
Kenneth Moreland
1822792b85 Support deprecated behavior of point locator pointers
`PointLocator`s have changed from being virtual objects to being trivial
objects. Part of this change means that when a worklet gets the
execution object for a point locator, it gets the actual object (or a
reference to it) instead of a pointer to an object. This means that the
new code uses the `.` operator to access the locator's features instead
of the `->` operator.

To support code still using the deprecated functionality, added a
specific `->` operator to the locator execution object to make it behave
as if it were a pointer. However, this operator is marked deprecated to
warn the user that they should modify their code to use the `.` instead.
2021-02-18 13:11:54 -07:00
nadavi
f70ecd4354 implement PointLocator without virtual methods 2021-02-17 17:16:17 +00:00
Kenneth Moreland
23c823d4b4 Fix compile errors and warnings related to new CellLocator structure 2021-02-15 12:39:11 -07:00
Kenneth Moreland
0a5f5d55c9 Remove virtual methods from cell locators
Deprecated the `CellLocator` class and made all methods of the
other `CellLocator` classes non-virtual. General locators can
still use the `CellLocatorGeneral` class, but this class now
only works with a predefined set of locators. (The functionality
to provide a function to select a locator has been removed.)
2021-02-15 12:39:11 -07:00
Kenneth Moreland
34b6bea013 Merge topic 'device-free-execwholearray'
0797359c5 Make ExecutionWholeArray objects not depend on device type
0bee74438 Support DeviceAdapterId in deprecated ArrayHandle

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Nick Thompson <nathompson7@protonmail.com>
Merge-request: !2405
2021-02-12 20:00:11 -05:00
Caitlin Ross
46155daaa2 removing ArrayHandleExtrude* 2021-02-10 15:20:35 -05:00
Kenneth Moreland
0797359c57 Make ExecutionWholeArray objects not depend on device type
With recent changes to `Arrayhandle`, the type for the associated array
portal is now the same across all devices. This means that almost all
exec objects no longer need to be specialized on the device types. Thus,
clean up the whole array exec objects to no longer need to be templated
on device.
2021-02-09 19:16:51 -07:00
Kenneth Moreland
c62e38bab6 Make locator exec objects not depend on device type
With recent changes to `ArrayHandle`, the type for the associated array
portal is now the same across all devices. This means that almost all
exec objects no longer need to be specialized on the device types. Thus,
clean up the locator exec objects to no longer need to be templated on
device.
2021-02-09 17:20:57 -07: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
c55d15f397 Deprecate ArrayHandle::ExecutionTypes
The newer version of `ArrayHandle` no longer supports different types of
portals for different devices. Thus, the `ReadPortalType` and
`WritePortalType` are sufficient for all types of portals across all
devices.

This significantly simplifies supporting execution objects on devices,
and thus this change also includes many changes to various execution
objects to remove their dependence on the device adapter tag.
2021-02-08 12:17:37 -07:00
Kenneth Moreland
71a5bd3b95 Fix compile error with MSVC
Some (but not all) versions of visual studio seem to have a bug that
causes a syntax error when using the deprecated attribute in a templated
constructor.
2021-02-04 08:47:28 -07:00
Kenneth Moreland
7df5c39358 Remove device template argument from AtomicArrayExecutionObject
The actual code for AtomicArrayExecutionObject does not need to be
specialized by the device. The functionality is implemented by calling
the vtkm::Atomic* methods, which are properly implemented on each
device.
2021-02-04 08:47:28 -07:00
Kenneth Moreland
b4ca18607c Merge topic 'recombine-vec-array'
f941cb607 Move Fetch specializations to vtkm/exec/arg
439c18cfc Add changedoc for ArrayHandleRecombineVec
9833f3d0d Fix issue with using recombined vec as an output array
7dd9b4252 Add UnknownArrayHandle::ExtractArrayFromComponents
755af739e Add ArrayHandleRecombineVec

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2372
2021-01-11 13:50:57 -05: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
Kenneth Moreland
fa876efc90 Correct documentation for AtomicArrayExecutionObject
The code example had errors that would prevent it from compiling
correctly.
2021-01-07 13:57:38 -07:00
Nick Thompson
275abf2f2d Revert change the removes printing of seed. 2020-11-18 11:03:19 -05:00
Nick Thompson
3b2c103397 Less verbose unit tests. 2020-11-18 08:35:37 -05: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
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
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
Robert Maynard
fa42c9a55c Correct casting warning in AtomicArrayExecutionObject
Fixes a warning introduced by !2282
2020-10-16 09:39:08 -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
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
1365cfa9ec Update ConnectivityExtrude to follow clangs rules on markup 2020-09-25 09:37:46 -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
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
Kenneth Moreland
c6a4f9b79c Fix warning about return value 2020-09-14 15:04:03 -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
Kitware Robot
cf0cdcf7d1 clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
Kenneth Moreland
13056b3af5 Deprecate AtomicInterfaceControl and AtomicInterfaceExecution
Now that we have the functions in `vtkm/Atomic.h`, we can deprecate (and
eventually remove) the more cumbersome classes `AtomicInterfaceControl`
and `AtomicInterfaceExecution`.

Also reversed the order of the `expected` and `desired` parameters of
`vtkm::AtomicCompareAndSwap`. I think the former order makes more sense
and matches more other implementations (such as `std::atomic` and the
GCC `__atomic` built ins). However, there are still some non-deprecated
classes with similar methods that cannot easily be switched. Thus, it's
better to be inconsistent with most other libraries and consistent with
ourself than to be inconsitent with ourself.
2020-08-20 13:40:44 -06: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
Kenneth Moreland
502c310cf8 Merge topic 'deprecate-arrayhandlevirtualcoordinates'
c689a68c5 Suppress bad deprecation warnings in MSVC
a3f23a03b Do not cast to ArrayHandleVirtual in VariantArrayHandle::CastAndCall
f6b13df51 Support coordinates of both float32 and float64
453e31404 Deprecate ArrayHandleVirtualCoordinates
be7f06bbe CoordinateSystem data is VariantArrayHandle

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2177
2020-07-16 17:25:43 -04: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
Kenneth Moreland
be7f06bbe7 CoordinateSystem data is VariantArrayHandle
`CoordinateSystem` differed from `Field` in that its `GetData`
method returned an `ArrayHandleVirtualCoordinates` instead of
a `VariantArrayHandle`. This is probably confusing since
`CoordianteSystem` inherits `Field` and has a pretty dramatic
difference in this behavior.

In preparation to deprecate `ArrayHandleVirtualCoordinates`, this
changes `CoordiantSystem` to be much more like `Field`. (In the
future, we may change the `CoordinateSystem` to point to a `Field`
rather than be a special `Field`.)

A method named `GetDataAsMultiplexer` has been added to
`CoordinateSystem`. This method allows you to get data from
`CoordinateSystem` as a single array type without worrying
about creating functors to handle different types and without
needing virtual methods.
2020-07-14 08:50:39 -06:00
Caitlin Ross
235d9ce14b add GetThreadIndex to ThreadIndicesExtrude classes 2020-07-08 14:51:41 -04:00
Kenneth Moreland
56bec1dd7b Replace basic ArrayHandle implementation to use Buffers
This encapsulates a lot of the required memory management into the
Buffer object and related code.

Many now unneeded classes were deleted.
2020-06-25 14:02:26 -06:00
Robert Maynard
3029994a97 Remove some unneeded include statements from vtkm/exec 2020-06-22 09:28:51 -04:00
Robert Maynard
a652f7fe1e Update vtk-m doxygen to generate less warnings 2020-06-01 16:58:32 -04:00
Robert Maynard
93d87e06fd Optimize StructuredPointGradient for non boundary points.
We can remove lots of clamp calls by checking if we are on
a boundary and using a non-clamped API.
2020-05-22 14:58:38 -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
Kenneth Moreland
a44392027a Fix compile error in UnitTestTaskStrided.cu from changes in Fetch
A recent change removed the thread indices parameters from the arguments
to the `Fetch` template. Somehow, an instance of using the old template
in the CUDA task strided tests snuck through the dashboard tests.
Correct that.
2020-04-27 17:47:37 -06:00
Dave Pugmire
87470a89b7 Merge topic 'fix_euler_step_particleAdvection2'
2ecca9edf Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into fix_euler_step_particleAdvection2
d2e9b3d30 Fix for small euler step for particle advection.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2057
2020-04-27 09:41:39 -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
dpugmire
d2e9b3d306 Fix for small euler step for particle advection. 2020-04-23 16:14:28 -04:00
Vicente Adolfo Bolea Sanchez
026fd14ba6 CellMetrics return vtkm::ErrorCode instead of raising errors
- MeshQuality now throws ErrorCode messages

Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2020-04-16 17:27:42 -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 Bolea
35276434bd Merge topic 'fix-475-support-sg-3d-scheduling'
e2c32ffac add unit test for WorkletMapTopology
0e90c22e7 Worklet{MapTopology,PointNeighbor} custom sg/mask

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1980
2020-03-19 11:17:12 -04: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
Kenneth Moreland
0748725806 Make sure return value of cell operations is initialized
Even if an error condition occurs, the output parameter should be
initialized to something. This makes the behavior predicatable on error
conditions and prevents uninitialized variable warnings.
2020-03-14 00:24:13 -06:00
Kenneth Moreland
51e817adc1 Introduce vtkm::ErrorCode
This is a flag that functions in the execution environment can return to
report on the status of the operation. This way they can report an error
without forcing the entire invocation to shut down.
2020-03-13 18:58:33 -06: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
Kenneth Moreland
04edc3d202 Avoid raising errors when operating on cells
Cell operations like interpolate and finding parametric coordinates can
fail under certain conditions. Typically these call RaiseError on the
worklet. But that can make a worklet unstable, so provide paths where no
error is raised.
2020-03-12 07:50:01 -06:00
Robert Maynard
8377806778 Merge topic 'introduce_mapfield_3d_scheduling'
1f1688483 Initial infrastructure to allow WorkletMapField to have 3D scheduling

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1938
2020-02-27 08:02:52 -05:00
Kenneth Moreland
ec34cb56c4 Use new ways to get array portal in control environment
Also fix deadlocks that occur when portals are not destroyed
in time.
2020-02-26 13:10:46 -07:00
Robert Maynard
1f1688483e Initial infrastructure to allow WorkletMapField to have 3D scheduling 2020-02-25 15:23:41 -05:00
Kenneth Moreland
3671cbe168 Fix token issues with CUDA 2020-02-25 09:39:30 -07:00
Kenneth Moreland
ad0a53af71 Convert execution preparation to use tokens
Marked the old versions of PrepareFor* that do not use tokens as
deprecated and moved all of the code to use the new versions that
require a token. This makes the scope of the execution object more
explicit so that it will be kept while in use and can potentially be
reclaimed afterward.
2020-02-25 09:39:19 -07:00
Kenneth Moreland
76ce9c87f0 Support using Token calling PrepareForExecution in ExecutionObject
The old version of ExecutionObject (that only takes a device) is still
supported, but you will get a deprecated warning if that is what is
defined.

Supporing this also included sending vtkm::cont::Token through the
vtkm::cont::arg::Transport mechanism, which was a change that propogated
through a lot of code.
2020-02-25 07:41:39 -07:00
Robert Maynard
f395e084d8 Merge topic 'correct_warnings_from_osx_dashboard'
b9516c116 Correct CellSetStructured compile failures
00235874d Suppress more warning types from thirdparty includes
a52af2d13 Correct double to float warning in CellAspectFrobeniusMetric
cf5ebfb16 Suppress warning about extension use, since all compilers support it
27739660b Add missing constructors/assignment operators
123f8b01a Mark virtual destructors as override where applicable
54118dfca Use noexcept instead of throw() as it was deprecated in c++11

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1943
2020-01-15 15:27:18 -05:00
Robert Maynard
cf5ebfb16e Suppress warning about extension use, since all compilers support it 2020-01-14 11:18:22 -05:00
Robert Maynard
123f8b01aa Mark virtual destructors as override where applicable 2020-01-13 15:54:33 -05:00
Allison Vacanti
539f6e5ad7 Port benchmarking framework to Google Benchmark. 2020-01-08 10:58:51 -05:00
Allison Vacanti
813f5a422f Fixup custom portal iterator logic.
The convenience functions `ArrayPortalToIteratorBegin()` and
`ArrayPortalToIteratorEnd()` wouldn't detect specializations of
`ArrayPortalToIterators<PortalType>` since the specializations aren't
visible when the `Begin`/`End` functions are declared.

Since the CUDA iterators rely on a specialization, the convenience
functions would not compile on CUDA.

Now, instead of specializing `ArrayPortalToIterators` to provide custom
iterators for a particular portal, the portal may advertise custom
iterators by defining `IteratorType`, `GetIteratorBegin()`, and
`GetIteratorEnd()`. `ArrayPortalToIterators` will detect such portals
and automatically switch to using the specialized portals.

This eliminates the need for the specializations to be visible to the
convenience functions and allows them to be usable on CUDA.
2019-12-17 15:39:51 -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
Kenneth Moreland
d5fe4046c5 Remove instances of ListTag in favor of List 2019-12-06 21:32:36 -07:00
Robert Maynard
f89672b71a UnitTestFetchArrayTopologyMapIn now compiles with VS2015
Fixes #445
2019-12-06 09:27:45 -05:00
Kenneth Moreland
34b0bba842 Use C++11 attributes for VTKM_ALWAYS/NEVER_EXPORT
Previously, the `VTKM_ALWAYS_EXPORT` and `VTKM_NEVER_EXPORT` macros
used the gnu-specific `__attribute__` keyword. This change instead
uses the C++11 standard method of using `[[ ]]` as attributes.
Specifically, `__attribute(visibility("---"))` is changed to
`[[gnu::visibility("--")]]`.

The main impetus for this change is that `__attribute__` does not
seem to work with `[[deprecated]]` on GCC compilers. (For sure on
GCC 6. I didn't check all compiler versions.) This change was
recommended from
https://stackoverflow.com/questions/40886628/deprecated-attribute-visibility-default-in-gcc-6-2

This creates a minor backward incompatibility. We have always meant
for these macros to be used before the return type when used with
a function. However, GCC accepted placing `__attribute__` after
the return type. The C++11 `[[ ]]` cannot be placed there, so
some macros might have to be moved. Still, this was a broken
use that happened to work.
2019-12-05 13:55:54 -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
Robert Maynard
65347bf948 Correct warnings found by GCC 9.2 2019-12-02 09:33:35 -05:00
Sujin Philip
b0592ce4c8 Switch from VTK-c to LCL 2019-10-07 15:38:36 -04:00
Robert Maynard
308552bd62 Merge topic 'improve_connectivity_worklet_perf'
973878b8b Improve the performance of the Image and Graph Connectivity algorithms

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Li-Ta Lo <ollie@lanl.gov>
Merge-request: !1873
2019-10-02 11:41:57 -04:00
Robert Maynard
973878b8ba Improve the performance of the Image and Graph Connectivity algorithms
The collection of connectivity algorithms had a couple of inefficiencies.
By moving to using WorkId we can remove a couple of arrays of the same size
as the input domain. In addition by moving to using atomics we can remove
an bool output array with a size equivalent to the input domain and
a call to reduce.
2019-10-02 08:25:10 -04:00
Allison Vacanti
3886b7dfb8 Refactor CellSetExplicit to remove NumIndices.
See #408 for details.
2019-09-30 12:27:13 -04:00
Brad King
9a906e4cbf Merge topic 'use-vtkc'
e08d862f9 Use Light-Weight Cell Library
e56b34fc9 Merge branch 'upstream-vtkc' into use-vtkc
e909edd61 vtkc 2019-09-24 (cdc72582)
2a6aadc69 Add update file for VTK-c

Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1852
2019-09-25 09:21:00 -04:00