Commit Graph

32 Commits

Author SHA1 Message Date
Kenneth Moreland
63ef84ed78 Optionally remove all use of ArrayHandleVirtual
As we remove more and more virtual methods from VTK-m, I expect several
users will be interested in completely removing them from the build for
several reasons.

1. They may be compiling for hardware that does not support virtual
methods.
2. They may need to compile for CUDA but need shared libraries.
3. It should go a bit faster.

To enable this, a CMake option named `VTKm_NO_DEPRECATED_VIRTUAL` is
added. It defaults to `OFF`. But when it is `ON`, none of the code that
both uses virtuals and is deprecated will be built.

Currently, only `ArrayHandleVirtual` is deprecated, so the rest of the
virtual classes will still be built. As we move forward, more will be
removed until all virtual method functionality is removed.
2020-09-04 22:52:45 -06:00
Kenneth Moreland
e11f612add Deprecate ArrayHandleVirtual
Virtual methods in the execution environment are going away the next
major release of VTK-m, so deprecate their use in preparation for that.
2020-09-04 22:52:45 -06:00
Kenneth Moreland
872da1f8e6 Suppress unnecessary deprecation warnings on VS
The Visual Studio compiler has an annoying habit where if you use a
templated class or method with a deprecated class as a template
parameter, you will get a deprecation warning where that class is used
in the templated thing. Thus, if you want to suppress the warning, you
have to supress every instance of the template, not just where the
template is declared.

This is annoying behavior that is thankfully not replicated in other
compilers.
2020-09-02 16:48:11 -06:00
Kenneth Moreland
bb443bbc24 Replace the implementation of VariantArrayHandle
The implementation of `VariantArrayHandle` has been changed to be a
relatively trivial subclass of `UnknownArrayHandle`.

The advantage of this change is twofold. First, it removes
`VariantArrayHandle`'s dependence on `ArrayHandleVirtual`, which gets us
much closer to deprecating that class. Second, it ensures that
`UnknownArrayHandle` is a reasonable replacement for
`VariantArrayHandle`, so we can move forward with replacing that.
2020-09-02 15:02:44 -06:00
Kenneth Moreland
c689a68c5c Suppress bad deprecation warnings in MSVC
The Microsoft compiler has this annoying and stupid behavior where if
you have a generic templated method/function and that method is
instantiated with a deprecated class, then the compiler will issue a
C4996 warning even if the calling code is suppressing that warning
(because, for example, you are implementing other deprecated code and
the use is correct). There is no way around this other than suppressing
the warnings for all uses of the templated method.
2020-07-14 16:25:04 -06:00
Kenneth Moreland
a3f23a03b6 Do not cast to ArrayHandleVirtual in VariantArrayHandle::CastAndCall
We are moving to deprecate `ArrayHandleVirtual`, so we are removing the
feature where `VariantArrayHandle::CastAndCall` automatically casts to
an `ArrayHandleVirtual` if possible.

The big reason to make this change now (as opposed to later when
`ArrayHandleVirtual` is deprecated) is to improve compile times.
This prevents us from having to compile an extra code path using
`ArrayHandleVirtual`.
2020-07-14 08:53:03 -06:00
Kenneth Moreland
8a1df977a7 Add common superclass to VariantArrayHandleBase
Many of the operations of `VariantArrayHandleBase` are not dependent on
the TypeList parameter of the class. Still others can operate just as
well by providing a type list to a method. Thus, it is convenient to
create a superclass that is not templated. That allows us to pass around
a `VariantArrayHandle` when the type list does not matter.

This superclass is called `VariantArrayHandleCommon` because "base" was
already taken.
2020-06-17 15:38:20 -06:00
Kenneth Moreland
c35abc732f Rename IsInValidArrayHandle to IsInvalidArrayHandle
This makes it clear that it returns true for an invalid array handle.
The previous name implied that it was looking for an ArrayHandle in some
"valid" set, which is the opposite.
2020-06-17 15:38:19 -06:00
Kenneth Moreland
ed2f4aabf7 Detect when VariantArrayHandle::AsMultiplexer fails
Previously, the VariantArrayHandle::AsMultiplexer operation silently
failed and returned an invalid ArrayHandleMultiplexer. This is now
changed to throw an exception if the desired ArrayHandleMultiplexer
cannot hold the VariantArrayHandle's array.
2020-06-16 00:12:24 -06:00
Kenneth Moreland
882dcacca4 Have filter specify its own field types
Previously, the policy specified which field types the filter should
operate on. The filter could remove some types, but it was not able to
add any types.

This is backward. Instead, the filter should specify what types its
supports and the policy may cull out some of those.
2020-04-28 10:31:44 -06:00
Kenneth Moreland
dc112b5169 Enable changing policy used for library compiles
Previously, the PolicyDefault used to compile all the filters was hard-
coded. The problem was that if any external project that depends on VTK-
m needs a different policy, it had to recompile everything in its own
translation units with a custom policy.

This change allows an external project provide a simple header file that
changes the type lists used in the default policy. That allows VTK-m to
compile the filters exactly as specified by the external project.
2020-03-19 15:07:07 -06:00
Kenneth Moreland
944a3c4c14 Make ArrayHandleCast storage type shorter 2020-01-07 07:00:55 -07:00
Kenneth Moreland
d5fe4046c5 Remove instances of ListTag in favor of List 2019-12-06 21:32:36 -07:00
Kenneth Moreland
92db376236 Convert uses of ListTagBase to List 2019-12-06 15:37:46 -07: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
Kenneth Moreland
6fc883213c Deprecate ListTag operations
The newer List operations should still work on the old ListTags, so make
those changes first to ensure that everything still works as expected if
given an old ListTag.

Next step is to deprecate ListTagBase itself and move all the lists to
the new types.
2019-12-05 11:27:31 -05:00
Robert Maynard
f2a3ecd014 Don't generate doxygen for serialization helpers 2019-09-12 17:29:05 -04:00
Kenneth Moreland
2b6e6da6ca Add ability to get VariantArrayHandle as an ArrayHandleMultiplexer 2019-09-09 08:19:15 -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
Robert Maynard
3dda0ab2d6 Correct unused-parameter warnings from defaulted methods.
GCC 6 warns about defaulted methods when parameters have names.
2019-04-30 13:12:32 -04:00
nadavi
fbcea82e78 conslidate the license statement 2019-04-17 10:57:13 -06:00
Robert Maynard
6306ca66ce Merge topic 'refactor_cast_and_call_location'
72cb6343b Move vtkm::cont::CastAndCall into a header in vtkm/cont

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1622
2019-04-04 10:05:22 -04:00
Robert Maynard
18f3b0dccc Document all the free functions for VariantArrayHandle 2019-04-03 18:10:31 -04:00
Robert Maynard
72cb6343b8 Move vtkm::cont::CastAndCall into a header in vtkm/cont
Since CastAndCall is meant to be a user callable function,
we should make sure it is part of the vtkm cont headers
2019-04-03 14:15:26 -04:00
Allison Vacanti
e1f5c4dd9b Modify VariantAH::AsVirtual to cast to new ValueType if needed.
E.g:

```
    ArrayHandle<Float64> doubleArray;
    VariantArrayHandle varHandle{doubleArray};
    ArrayHandleVirtual<Float32> = varHandle.AsVirtual<Float32>();
```

If there is a loss in range and/or precision, a warning is logged. If
the ValueTypes are Vecs with mismatched widths, an ErrorBadType is thrown.
Internally, an ArrayHandleCast is used between the VariantArrayHandle's
stored array and the ArrayHandleVirtual.
2019-03-25 11:39:45 -04:00
Allison Vacanti
d1db4ef8b3 Clarify intent of TypeString and TypeName functions.
TypeName is used for logging, and is now TypeToString.

TypeString is used for serialization, and is now SerializableTypeString.
2019-03-01 11:47:53 -05:00
Robert Maynard
ad98d818ce VTK-m now doesn't clobber external DIY installations
Fixes #334
2019-02-05 13:05:14 -05:00
Kenneth Moreland
d59ce11c00 Allow VariantArrayHandle CastAndCall to cast to concrete types
When you call VariantArrayHandle::CastAndCall, it now tries both basic
storage and virtual storage. You can modify the types of storages tried
by giving a type list of storage tags as the first argument.
2019-01-16 22:31:55 -06:00
Robert Maynard
3445047f9e Refactor vtkm::cont::ArrayHandleAny into vtkm::cont::ArrayHandleVirtual
ArrayHandleVirtual can automatically be constructed from any ArrayHandle.
In the cases where the input ArrayHandle doesn't derived from ArrayHandleVirtual,
it will automatically construct StorageAny to hold the array.
2018-12-27 15:42:03 -05:00
Robert Maynard
1f2abbc9c4 vtkm::cont::IsType and vtkm::cont::Cast support VariantArrayHandle 2018-12-27 14:35:56 -05:00
Robert Maynard
7b9fa975f2 Rename: IsVirtualType to IsValueType. 2018-12-27 14:35:56 -05:00
Robert Maynard
0a40c620ac Rename ArrayHandleVariant to VariantArrayHandle. 2018-12-27 14:35:56 -05:00