1. 21 Jun, 2021 1 commit
    • Kenneth Moreland's avatar
      Support all Allocate flags in UnknownArrayHandle · 8d7cf2c8
      Kenneth Moreland authored
      `UnknownArrayHandle` supported an `Allocate` method to change
      the size of the underlying array without knowing its type.
      However, it did not give all the features of `ArrayHandle`'s
      allocate. Namely, you could not specify that the data should
      be preserved and you could not provide a `Token` object. This
      change adds these (optional) parameters.
      8d7cf2c8
  2. 12 Apr, 2021 1 commit
    • Kenneth Moreland's avatar
      Fix UnknownArrayHandle::CastAndCall for special arrays · fb8a80b0
      Kenneth Moreland authored
      `UnknownArrayHandle` treats a `ArrayHandleCast` and
      `ArrayHandleMultiplexer` special. When you put one of these arrays in an
      `UnknownArrayHandle`, it takes the original array out and stores it. If
      you try to take an array of that type out, it will again do the proper
      conversion.
      
      The only problem is that if you use `IsType`, the result can be
      unexpected. This is what happened with `CastAndCall`, which was using
      `IsType` internally. Changed that to `CanConvert` to properly get the
      array handle out.
      fb8a80b0
  3. 07 Apr, 2021 1 commit
    • Kenneth Moreland's avatar
      Fix UnknownArrayHandle::CastAndCall for special arrays · b4ef9fca
      Kenneth Moreland authored
      `UnknownArrayHandle` treats a `ArrayHandleCast` and
      `ArrayHandleMultiplexer` special. When you put one of these arrays in an
      `UnknownArrayHandle`, it takes the original array out and stores it. If
      you try to take an array of that type out, it will again do the proper
      conversion.
      
      The only problem is that if you use `IsType`, the result can be
      unexpected. This is what happened with `CastAndCall`, which was using
      `IsType` internally. Changed that to `CanConvert` to properly get the
      array handle out.
      b4ef9fca
  4. 02 Feb, 2021 2 commits
    • Kenneth Moreland's avatar
      Fix inverted `ArrayCopy` arguments · 4c524de6
      Kenneth Moreland authored
      Also fix condition where a `UnknownArrayHandle` destination does not
      have an underlying `ArrayHandle` set yet.
      4c524de6
    • Kenneth Moreland's avatar
      Add general `ArrayCopy` between `UnknownArrayHandle`s · 916a01d7
      Kenneth Moreland authored
      Add an overload of `ArrayCopy` that takes `UnknownArrayHandle`s and
      copies them for (almost) any `ArrayHandle` type.
      
      The code uses `CastAndCallWithExtractedArray` to reduce the total number
      of copy conditions to about 100, which are all precompiled into the
      library. On a debug build on my mac, this creates a .o file of 21MB.
      That's not great, but not terrible. Hopefully, this can be used to
      consolidate copy implementations elsewhere.
      916a01d7
  5. 01 Feb, 2021 1 commit
    • Kenneth Moreland's avatar
      Add UnknownArrayHandle::NewInstanceFloatBasic · d51fdadd
      Kenneth Moreland authored
      This provides the ability to convert an array handle of an unknown value
      type to an array handle that has `vtkm::FloatDefault` as its base
      component type. Thus subsequently lets you pull the components as
      `vtkm::FloatDefault` without having to worry about type conflicts.
      d51fdadd
  6. 14 Jan, 2021 1 commit
  7. 13 Jan, 2021 2 commits
    • Kenneth Moreland's avatar
      Add UnknownArrayHandle::CastAndCallWithExtractedArray · f90c2bfd
      Kenneth Moreland authored
      This provides a convenience for calling a function for most
      `ArrayHandle` types.
      f90c2bfd
    • Kenneth Moreland's avatar
      Enable reinterpreting `UnknownArrayHandle` to compatible C types · 97324e75
      Kenneth Moreland authored
      The base C types have several "duplicate" types that the compiler
      considers different even though the byte representation is the same. For
      example, `char` and `signed char` have the same meaning but are treated
      as different types. Likewise, 'long', 'int', and 'long long' are all
      different types even though 'long' is the same as either 'int' or 'long
      long'.
      
      When pulling extracted components from `UnknownArrayHandle`, there is
      little value for creating multiple code paths for types like `char` and
      `signed char`. Instead, allow implicit conversion among these types.
      97324e75
  8. 07 Jan, 2021 1 commit
    • Kenneth Moreland's avatar
      Undeprecate UnknownArrayHandle::GetNumberOfComponents · d91b4f35
      Kenneth Moreland authored
      This method was originally deprecated to avoid confusion with the
      indexing of the components in `ExtractComponent`. However, there might
      be good reason to want to know the non-flat number of components, so
      maybe getting rid of it is not a great idea. Unmark the method as
      deprecated, at least for now.
      d91b4f35
  9. 04 Jan, 2021 1 commit
    • Kenneth Moreland's avatar
      Add UnknownArrayHandle::ExtractArrayFromComponents · 7dd9b425
      Kenneth Moreland authored
      This method allows you to extract an `ArrayHandle` from
      `UnknownArrayHandle` when you only know the base component type.
      
      Also removed the `Read/WritePortalForBaseComponentType` method
      from `UnknownArrayHandle`. This functionality is subsumed by
      `ExtractArrayFromComponents`.
      7dd9b425
  10. 22 Dec, 2020 1 commit
    • Kenneth Moreland's avatar
      Wrap test_equal_ArrayHandles into a precompiled library · 932c8e5e
      Kenneth Moreland authored
      The previous implementation of test_equal_ArrayHandles was several
      templates that had to be resolved by any test that used them, which
      could be costly for unknown array types. Simplify this a bit by moving
      the implementation of testing unknown arrays into a library.
      
      Another advantage of the new implementation is that is handles more
      cases. Thus, you should not need to `ResetTypes` on the unknown/
      uncertain arrays.
      932c8e5e
  11. 16 Dec, 2020 2 commits
    • Kenneth Moreland's avatar
      Update `MapField` helper functions to use extracted array components · 03c3f9e1
      Kenneth Moreland authored
      Previously, the `MapFieldMergeAverage` and `MapFieldPermutation` helper
      function had to iterate over every possible type and create a separate
      code path. This change uses the new extract component functionality to
      create separate code paths only for different component types. This both
      requires less code (the common filter library dropped from 66MB to 42MB
      on my Mac) and covers more cases (such as `Vec`s larger than 4
      components).
      
      To make the implementation easier, `UnknownArrayHandle` now can create a
      new `UnknownArrayHandle` of the same `ValueType` but with the basic
      storage (so you can work with read-only storage) and the ability to
      allocate the unknown array.
      03c3f9e1
    • Kenneth Moreland's avatar
      Add ability to extract components in `UnknownArrayHandle` · 67507185
      Kenneth Moreland authored
      This allows you to handle just about every type of array with about 10
      basic types. It allows you to ignore both the size of `Vec`s and the
      actual storage of the data.
      67507185
  12. 08 Dec, 2020 1 commit
  13. 02 Dec, 2020 1 commit
  14. 14 Sep, 2020 1 commit
    • Kenneth Moreland's avatar
      Enable storing variable-sized Vecs in UnknownArrayHandle · 9b62c9ee
      Kenneth Moreland authored
      One of the features of `UnknownArrayHandle` is that it allows you to
      query how many `Vec` components each value has without resolve the type
      of the array. The functionality to implement this failed if you tried to
      store an `ArrayHandle` that stored `Vec`-like objects with `Vec` sizes
      that varied from value to value (i.e. an `ArrayHandleGroupVecVariable`).
      
      Storing such an array in `UnknownArrayHandle` might not be the best
      idea, but it should probably work. This change allows you to store such
      an array. If you try to query the number of components, you will get 0.
      9b62c9ee
  15. 09 Sep, 2020 1 commit
  16. 02 Sep, 2020 2 commits
    • Kenneth Moreland's avatar
      Suppress unnecessary deprecation warnings on VS · 872da1f8
      Kenneth Moreland authored
      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.
      872da1f8
    • Kenneth Moreland's avatar
      Replace the implementation of VariantArrayHandle · bb443bbc
      Kenneth Moreland authored
      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.
      bb443bbc
  17. 31 Aug, 2020 4 commits