Commit Graph

8 Commits

Author SHA1 Message Date
Kitware Robot
cf0cdcf7d1 clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04: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
b534bdb1ba Remove std::conditional from List.h
The `std::conditional` utility is very convenient, but it unfortunately
means that the compiler has to evaluate both the true and false types
even though one is guaranteed to be thrown out. This is problematic
because it requires the compiler to do a lot more work then necessary.
It is especially dumb when introducing the conditionals to reduce the
number of cases being evaluated, as was much of the case in List.h.
2020-01-09 09:11:26 -07:00
Kenneth Moreland
851864d0b5 Work around with Visual Studio 2015 issue
Was getting the following error:

vtkm/List.h(284): error C2210: 'T' : pack expansions cannot be used as
arguments to non-packed parameters in alias templates

This is probably an issue with the compiler not resolving templated
aliases correctly.
2019-12-09 14:29:13 -07:00
Kenneth Moreland
452a2e1c9c Suppress warnings about CUDA host/device mismatch 2019-12-09 11:06:56 -05:00
Kenneth Moreland
5cfc14482b Implement old ListTag features with new ListTag implementations
This cleans up the code a bit by removing duplication. More importantly,
it makes sure that the old ListTag functions work with both the new
`List` and old `ListTagBase`.
2019-12-08 19:20:34 -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
Kenneth Moreland
70f6220fa3 Add vtkm::List
`vtkm::List` is meant to replace `vtkm::ListTag`. Rather than
subclassing a base class with a variadic template, all lists expose the
list of types.

`vtkm::ListTag` was originally created before we required C++11 so
supporting variadic templates was problematic. To hide the issue we had,
we made list tags subclass other lists rather than be the list
themselves. It makes for nicer types in the compiler, but hides
important details about what is actually in the type. It also creates
lots of unnecessary new types.

The new `vtkm::List` is in some ways simpler. All lists have to be a
`vtkm::List`. Subclasses are not supported (or rather, they will not
work as expected). All manipulations (such as `vtkm::ListAppend`)
resolve directly back to a `vtkm::List`. Although the types reported by
the compiler will be longer, they will be more specific to the types
being used. Also, the new implimentation should ultimately use fewer
types.
2019-12-04 17:13:56 -07:00