Commit Graph

8481 Commits

Author SHA1 Message Date
Li-Ta Lo
6dd1d7be3a direct gitlab CI to use my docker image 2021-01-05 10:19:07 -07:00
Li-Ta Lo
f00aececb0 experimental changes to dockerfile and gitlab ci configurations 2021-01-05 09:47:27 -07:00
Li-Ta Lo
fac489644f HDF5 unit tests
Move HDF5ImageWriter/Reader to its own unit test. Use user supplied
field name as HDF5 dataset name.
2021-01-04 10:01:49 -07:00
Li-Ta Lo
03cb5cb43c rename file names and add reference to the specification 2021-01-04 09:04:08 -07:00
Li-Ta Lo
da7d6aaf19 Add HDF5 Image file support 2020-12-25 16:02:08 -07:00
Kenneth Moreland
d2dd60e4ed Merge topic 'test-improvements'
932c8e5ec Wrap test_equal_ArrayHandles into a precompiled library
5610d674d Print TestEqualResult messages in VTK_TEST_ASSERT
84bfcc238 Move test_equal_* classes to top namespace

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Sujin Philip <sujin.philip@kitware.com>
Merge-request: !2363
2020-12-23 12:54:44 -05:00
Kenneth Moreland
932c8e5ec0 Wrap test_equal_ArrayHandles into a precompiled library
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.
2020-12-22 17:17:19 -07:00
Kenneth Moreland
5610d674d8 Print TestEqualResult messages in VTK_TEST_ASSERT
Some of the `test_equal` functions return a `TestEqualResult`
instead of a `bool` to capture more information about what
the error was. Unfortunately, using this was awkward because
you couldn't just call the `test_equal_*` inside of a
`VTKM_TEST_ASSERT`. Rather, you would have to do the comparison
and then check it.

This change adds an overload to `VTKM_TEST_ASSERT` that specifically
takes a `TestEqualResult`, checks its condition, and prints out
the contained messages. Thus, your command can just look like
`VTKM_TEST_ASSERT(test_equal_ArrayHandles(...));` and it will
provide the additional information.
2020-12-22 17:17:10 -07:00
Kenneth Moreland
84bfcc238c Move test_equal_* classes to top namespace
These helper functions were in vtkm::cont::testing, but that made them
hard to discover (and I personally kept forgetting about them). Move
them to the top namespace so that IDE of test_equal will helpfully
remind us of these other test functions.
2020-12-22 13:46:02 -07:00
Kenneth Moreland
2d17e2bef9 Merge topic 'fix-arrayhandleview-merge-error'
16471fcaf Fix ArrayHandleView compile error caused by merge error

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2362
2020-12-22 10:00:36 -05:00
Kenneth Moreland
16471fcaff Fix ArrayHandleView compile error caused by merge error
Recent merge requests !2354 and !2356 both edited ArrayHandleView. Git
successfully merged the changes, but the changes were still incompatible
with each other, causing an unexpected compile error on master. This
fixes the issue.
2020-12-22 07:47:33 -07:00
Kenneth Moreland
39715c92da Merge topic 'arrayhandleview-use-buffer'
1ed8b1f68 Convert ArrayHandleView to new buffer-style array

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2356
2020-12-22 09:32:16 -05:00
Kenneth Moreland
e56c6af41c Merge topic 'array-handle-stride'
7935716f8 Fix warning in VecFlat
8dfd01942 Add changelog for extract component
03c3f9e17 Update `MapField` helper functions to use extracted array components
67507185c Add ability to extract components in `UnknownArrayHandle`
0f24f82da Disable resizing of `ArrayHandleStride`
760553725 Add ArrayExtractComponent function
0ab3edd87 Add VecFlat class
73af6e679 Add ArrayHandleStride

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2354
2020-12-22 09:27:32 -05:00
Kenneth Moreland
bc987d53be Merge topic 'benchmark-read-file'
e0e24090a Correct argument check for benchmark --file argument

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2361
2020-12-22 09:24:22 -05:00
Kenneth Moreland
e0e24090a4 Correct argument check for benchmark --file argument
The condition was completely backwards so no file could ever be loaded.
2020-12-21 15:56:45 -07:00
Kenneth Moreland
1ed8b1f688 Convert ArrayHandleView to new buffer-style array 2020-12-21 07:51:42 -07:00
Kenneth Moreland
3eeeb1cb08 Merge topic 'arrayhandlegroupvecvariable-use-buffer'
802d78828 Convert ArrayHandleGroupVecVariable to new buffer-style arrays

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2357
2020-12-18 16:06:35 -05:00
Kenneth Moreland
eb1a500bd4 Merge topic 'arrayhandleconcat-use-buffer'
a5d57e744 Convert ArrayHandleConcatenate to new buffer-style arrays

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2358
2020-12-18 16:03:04 -05:00
Kenneth Moreland
a5d57e7440 Convert ArrayHandleConcatenate to new buffer-style arrays 2020-12-17 14:58:09 -07:00
Kenneth Moreland
802d788289 Convert ArrayHandleGroupVecVariable to new buffer-style arrays 2020-12-17 14:06:56 -07:00
Kenneth Moreland
373826372c Merge topic 'arrayhandlepermutation-use-buffer'
599c2f639 Convert ArrayHandlePermutation to new buffer-style array

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2355
2020-12-17 15:40:09 -05:00
Kenneth Moreland
7935716f8a Fix warning in VecFlat
`VecFlat` has a casting operator to cast itself to the nested version of
the `Vec`. However, for a simple `Vec` type, the superclass of `VecFlat`
is the same type as the "nested" `Vec` type (which was flat to begin
with). This meant that the casting operator was never used because it
casted to the same type as the object being cast from. Most compilers
silently ignored this, but some gave a warning that the casting operator
would never be used because of this condition.

Fix the problem by having a different implemention of `VecFlat` when
applied to a `Vec` that is already flat.
2020-12-17 13:39:02 -07:00
Kenneth Moreland
599c2f6391 Convert ArrayHandlePermutation to new buffer-style array 2020-12-17 09:00:03 -07:00
Kenneth Moreland
8dfd019423 Add changelog for extract component 2020-12-16 17:23:35 -07:00
Kenneth Moreland
03c3f9e178 Update MapField helper functions to use extracted array components
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.
2020-12-16 17:23:35 -07:00
Kenneth Moreland
67507185ce Add ability to extract components in UnknownArrayHandle
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.
2020-12-16 17:23:27 -07:00
Kenneth Moreland
0f24f82dad Disable resizing of ArrayHandleStride
The typical use case of `ArrayHandleStride` is to flexibly point into
another array, often looking at a single component in an array. It is
typical that multiple things will be accessing the same array, and bad
things could happen as they all try to resize. There was some code to
try to figure out what the size of the original array was, but it was
fragile.

It is safer for now to disable the behavior altogether. If a use case
pops up, we can reintroduce the code.
2020-12-16 17:22:44 -07:00
Kenneth Moreland
760553725c Add ArrayExtractComponent function
`ArrayExtractComponent` allows you to get a component of an array.
Unlike `ArrayHandleExtractComponent`, the type you get is always the
same: an `ArrayHandleStride`. This way, you can get an array that
contains the data of an extracted component with less templating and
potentially dramatically reduce the amount of code generated (although
some runtime integer arithmetic is added).
2020-12-16 17:22:44 -07:00
Kenneth Moreland
0ab3edd87d Add VecFlat class
`vtkm::VecFlat` is a wrapper around a `Vec`-like class that may be a
nested series of vectors. For example, if you run a gradient operation
on a vector field, you are probably going to get a `Vec` of `Vec`s that
looks something like `vtkm::Vec<vtkm::Vec<vtkm::Float32, 3>, 3>`. That
is fine, but what if you want to treat the result simply as a `Vec` of
size 9?

The `VecFlat` wrapper class allows you to do this. Simply place the
nested `Vec` as an argument to `VecFlat` and it will behave as a flat
`Vec` class. (In fact, `VecFlat` is a subclass of `Vec`.) The `VecFlat`
class can be copied to and from the nested `Vec` it is wrapping.

There is a `vtkm::make_VecFlat` convenience function that takes an
object and returns a `vtkm::VecFlat` wrapped around it.
2020-12-16 17:22:44 -07:00
Kenneth Moreland
73af6e6795 Add ArrayHandleStride 2020-12-16 17:22:44 -07:00
Robert Maynard
004f320e20 Merge topic 'expand_kokkos_device_to_support_hip'
7475c318b VTK-m now uses CMake's future HIP lang for Kokkos+HIP

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Sujin Philip <sujin.philip@kitware.com>
Merge-request: !2351
2020-12-16 08:58:17 -05:00
Robert Maynard
12de232cbf Merge topic 'reproduce_ci_env_remove_git_reset'
88b207d74 reproduce_ci_env doesn't try to do any form of EOL normalization

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !2353
2020-12-16 08:54:59 -05:00
Robert Maynard
88b207d74f reproduce_ci_env doesn't try to do any form of EOL normalization
This means that we no longer do `git reset --hard` allowing
local changes to copied into the docker container
2020-12-15 14:36:36 -05:00
Kenneth Moreland
fd07c241e2 Merge topic 'release-read-only'
7811cc4b1 Add standard support for read-only storage
a6b9d5c49 Add tests for ReleaseResources of fancy arrays

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2345
2020-12-14 10:03:20 -05:00
Robert Maynard
91f0bfa51c Merge topic 'workaround_bigsur_framework_issues'
f5b776b74 VTK-m Properly computes frameworks on mojave / big sur

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Nick Thompson <nathompson7@protonmail.com>
Merge-request: !2352
2020-12-11 13:50:29 -05:00
Robert Maynard
f5b776b747 VTK-m Properly computes frameworks on mojave / big sur
Fixes #587

This works around issues in CMake 3.19 and lower which aren't
aware of the new 'tbd' files that should be used for GLUT
2020-12-11 13:20:18 -05:00
Robert Maynard
7475c318be VTK-m now uses CMake's future HIP lang for Kokkos+HIP 2020-12-11 09:13:12 -05:00
Kenneth Moreland
1323dfeca6 Merge topic 'arrayhandlemultiplexer-use-buffer'
a61d07a6d Convert ArrayHandleMultiplexer to new buffer-style array

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2346
2020-12-10 16:58:33 -05:00
Kenneth Moreland
7811cc4b1e Add standard support for read-only storage
Many of the fancy `ArrayHandle`s are read-only and therefore connot
really create write portals. Likewise, many `ArrayHandle`s (both read-
only and read/write) have no way to resize themselves. In this case,
implementing the `CreateWritePortal` and `ResizeBuffers` methods in the
`Storage` class was troublesome. Mostly they just threw an exception,
but they also sometimes had to deal with cases where the behavior was
allowed.

To simplify code for developers, this introduces a pair of macros:
`VTKM_STORAGE_NO_RESIZE` and `VTKM_STORAGE_NO_WRITE_PORTAL`. These can
be declared in a `Storage` implementation when the storage has no viable
way to resize itself and create a write portal, respectively.

Having boilerplate code for these methods also helps work around
expected behavior for `ResizeBuffers`. `ResizeBuffers` should silently
work when resizing to the same size. Also `ResizeBuffers` should behave
well when resizing to 0 as that is what `ReleaseResources` does.
2020-12-10 13:39:28 -07:00
Kenneth Moreland
a6b9d5c497 Add tests for ReleaseResources of fancy arrays
The `ReleaseResources` method should work for all arrays (even if it
effectively does not do anything). However, the implementation of
`ReleaseResources` is generally to call `Allocate` with 0. Several fancy
arrays balk at this because it is resizing a read-only array. There
should be an exception for this.
2020-12-10 12:33:32 -07:00
Kenneth Moreland
03b814a9a3 Merge topic 'remove-old-array-transfer'
1df732cdb Add changedocs for removing `ArrayTransfer`
90050b96e Remove `ArrayManagerExecution`
196859023 Delete the default implementation of `ArrayTransfer`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2347
2020-12-08 19:08:53 -05:00
Kenneth Moreland
1df732cdb3 Add changedocs for removing ArrayTransfer 2020-12-08 15:22:07 -07:00
Kenneth Moreland
90050b96e4 Remove ArrayManagerExecution
This class was used indirectly by the old `ArrayHandle`, through
`ArrayHandleTransfer`, to move data to and from a device. This
functionality has been replaced in the new `ArrayHandle`s through the
`Buffer` class (which can be compiled into libraries rather than make
every translation unit compile their own template).

This commit removes `ArrayManagerExecution` and all the implementations
that the device adapters were required to make. None of this code was in
any use anymore.
2020-12-08 13:18:44 -07:00
Kenneth Moreland
1968590232 Delete the default implementation of ArrayTransfer
`ArrayTransfer` is used with the old `ArrayHandle` style to move data
between host and device. The new version of `ArrayHandle` does not use
`ArrayTransfer` at all because this functionality is wrapped in `Buffer`
(where it can exist in a precompiled library).

Once all the old `ArrayHandle` classes are gone, this class will be
removed completely. Although all the remaining `ArrayHandle` classes
provide their own versions of `ArrayTransfer`, they still need the
prototype to be defined to specialize. Thus, the guts of the default
`ArrayTransfer` are removed and replaced with a compile error if you try
to compile it.
2020-12-08 12:56:16 -07:00
Kenneth Moreland
a61d07a6d0 Convert ArrayHandleMultiplexer to new buffer-style array 2020-12-08 12:18:19 -07:00
Kenneth Moreland
ccd00c8030 Merge topic 'arrayhandlezip-use-buffer'
df1dd51f8 Convert ArrayHandleZip to new buffer-style array

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2342
2020-12-07 13:32:14 -05:00
Kenneth Moreland
df1dd51f8c Convert ArrayHandleZip to new buffer-style array 2020-12-07 08:52:38 -07:00
Kenneth Moreland
9a2dd4a089 Merge topic 'arrayhandletransform-use-buffer'
78aa463da Fix compile error when template parameter shadows superclass
905b5a02b Call PrepareForControl to get transform for undefined device
650e416cc Convert ArrayHandleTransform to new buffer-style-array
76880dd8c Enable ExecutionObjectBase::PrepareForExecution for DeviceAdapterId
b0146b1e4 Fix issue with CreateBuffers function

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2341
2020-12-03 19:17:40 -05:00
Kenneth Moreland
78aa463da6 Fix compile error when template parameter shadows superclass
I'm too lazy to look up the C++ spec, but it seems like template
parameter names would shadow the same names from a superclass.
Apparently that is not the case for Visual Studio. The `Storage` for the
cast array inherits from the `Storage` of the transform array. The
latter declares a private type named `SourceStorage`, and that is being
used instead of the former's `SourceStorage` template parameter. You
then get an error for accessing a private member that you did not want
in the first place.

Fix the problem by changing the name of the template parameter.
2020-12-03 09:49:21 -07:00
Sujin Philip
2d920535af Merge topic 'kokkos_opt-reduce'
7f61058b8 Use kokkos reduce functionality

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2340
2020-12-03 10:24:31 -05:00