Commit Graph

8514 Commits

Author SHA1 Message Date
Kenneth Moreland
0b2dbfdda1 Fix ICE in GCC 4.8 2021-01-13 09:19:34 -07:00
Kenneth Moreland
50d9320135 Add missing types to serialization of UnknownArrayHandle 2021-01-13 09:19:34 -07:00
Kenneth Moreland
ab9c0f7248 Add arithmetic assignment operators to RecombineVec
`RecombineVec` is the class used as the value type for
`ArrayHandleRecombineVec`. It is a `Vec`-like object, but has several
limitations (including arithmetic operators like `+` won't work).
Arithmetic assignment operators are useful so you don't have to create
impossible intermediate values.
2021-01-13 09:19:34 -07:00
Kenneth Moreland
1cc6dbb0c2 Allow VecBaseCommon operators to work with any Vec-like
Previously, the arithmetic assignment operators (`+=`, `-=`, `*=`, `/=`)
on `VecBaseCommon` only accepted another subclass of `VecBaseCommon`.
Changed the operators to accept any type.

The benefit of this change is that the assignment operator of classes
that inherit from `VecBaseCommon` can now work with `Vec`-like classes
that do not inherit from `VecBaseCommon`. I think the only real downside
is that the template could match other classes that would lead to
invalid comparisons. But such use would lead to a compile error anyway.
The difference is that instead of getting an error that no overloaded
version of the operator is available, you will get an error inside the
code of the operator.
2021-01-13 09:19:34 -07:00
Kenneth Moreland
74536d4ca1 Support Vec operators on ArrayPortalValueReference 2021-01-13 09:19:33 -07:00
Kenneth Moreland
06c59fed13 Update MapFieldMergeAverage/Permuation to use new CastAndCall
These functions now use
`UnknownArrayHandle::CastAndCallWithExtractedArray` to reduce the number
of times the worklet is run.
2021-01-13 09:19:33 -07:00
Kenneth Moreland
f90c2bfd0b Add UnknownArrayHandle::CastAndCallWithExtractedArray
This provides a convenience for calling a function for most
`ArrayHandle` types.
2021-01-13 09:19:33 -07:00
Kenneth Moreland
97324e75cd Enable reinterpreting UnknownArrayHandle to compatible C types
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.
2021-01-13 09:19:27 -07:00
Kenneth Moreland
de55494c81 Merge topic 'disable-curl-auth'
e10c4fad6 Disable security with downloading sccache tarball

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2382
2021-01-12 15:45:01 -05:00
Kenneth Moreland
e10c4fad6e Disable security with downloading sccache tarball
Some organizations use a firewall that intercepts SSL communications and
replaces the authentication token with an organization-wide token that
is just supposed to be accepted. Browsers can be locally configured for
this intentional trickery, but it's a little more tricky for the use of
`curl` in a batch script that is shared with external collaborators.

The easiest solution is to just disable the security for the `curl`
download. This makes the script more susceptible to "man in the middle"
attacks, but it's probably easier to just slip malware in the public
repos anyway.
2021-01-11 17:29: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
Robert Maynard
ca8e4fe09a Merge topic 'correct_atomic_unused_warnings_msvc'
c5efdb39a vtkm/Atomic doesn't generate unused parameter warnings on MSVC

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Vicente Bolea <vicente.bolea@kitware.com>
Merge-request: !2380
2021-01-11 13:27:33 -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
Robert Maynard
c5efdb39ac vtkm/Atomic doesn't generate unused parameter warnings on MSVC 2021-01-11 09:01:48 -05:00
Sujin Philip
4fac642273 Merge topic 'kokkos-opt-scan'
e57f5a175 Fix DeviceAdapterAlgorithmGeneral Reduce
1b7fc3d3e Use `Kokkos::parallel_scan` for Scan functionality

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2360
2021-01-08 10:33:12 -05:00
Kenneth Moreland
34437712d2 Merge topic 'fix-atomic-array-execution-documentation'
fa876efc9 Correct documentation for AtomicArrayExecutionObject

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2379
2021-01-07 16:45:59 -05:00
Sujin Philip
e57f5a175d Fix DeviceAdapterAlgorithmGeneral Reduce
It was using `ArrayHandleImplicit` in an unsupported manner.
2021-01-07 16:24:53 -05:00
Sujin Philip
1b7fc3d3e4 Use Kokkos::parallel_scan for Scan functionality 2021-01-07 16:24:39 -05: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
Robert Maynard
df93250969 Merge topic 'flying_edges_support_kokkos'
ebf648906 FlyingEdges uses optimized Y axis algorithm for Kokkos device

Acked-by: Kitware Robot <kwrobot@kitware.com>
Rejected-by: Robert Maynard <robert.maynard@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !2367
2021-01-07 15:16:09 -05:00
Kenneth Moreland
318a03019f Merge topic 'undeprecate-unknownarrayhandle-numberofcomponents'
d91b4f356 Undeprecate UnknownArrayHandle::GetNumberOfComponents

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2377
2021-01-07 15:03:53 -05:00
Robert Maynard
ebf648906f FlyingEdges uses optimized Y axis algorithm for Kokkos device 2021-01-07 13:46:42 -05:00
Robert Maynard
cb7d987544 Merge topic 'correct_flying_edge'
a31293da7 Add uniformat grid contour regression tests

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Nickolas Davis <nadavi@sandia.gov>
Merge-request: !2369
2021-01-07 11:54:26 -05:00
Kenneth Moreland
d91b4f3568 Undeprecate UnknownArrayHandle::GetNumberOfComponents
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.
2021-01-07 09:48:25 -07:00
nadavi
a31293da7f Add uniformat grid contour regression tests
Fixes #576

The Y-axis flying edge bug(s) had been fixed in !2197, and so
now we can test uniform data
2021-01-07 11:26:24 -05:00
Nickolas Davis
3f020101c4 Merge topic 'image-diff-improvements'
dd3193d69 consolidate contour-wedge baseline images to favor new pixel diff calculation
da751cf06 change arg ordering, support setting number of error pixels allowed

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2374
2021-01-06 16:27:27 -05:00
nadavi
dd3193d69d consolidate contour-wedge baseline images to favor new pixel diff calculation 2021-01-06 20:50:50 +00:00
nadavi
da751cf061 change arg ordering, support setting number of error pixels allowed 2021-01-06 20:50:49 +00:00
Kenneth Moreland
439c18cfc0 Add changedoc for ArrayHandleRecombineVec 2021-01-04 15:10:18 -07:00
Kenneth Moreland
9833f3d0da Fix issue with using recombined vec as an output array
`ArrayHandleRecombineVec` is used when calling
`ExtractArrayFromComponents` from `UnkownArrayHandle`. It needs special
handling with the `Fetch` for an output array.
2021-01-04 14:21:32 -07:00
Kenneth Moreland
7dd9b4252a Add UnknownArrayHandle::ExtractArrayFromComponents
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`.
2021-01-04 14:17:24 -07:00
Kenneth Moreland
755af739e3 Add ArrayHandleRecombineVec
The primary purpose of `ArrayHandleRecombineVec` is to take arrays
returned from `ArrayExtractComponent` and recombine them again into a
single `ArrayHandle` that has `Vec` values.
2021-01-04 11:55:02 -07:00
Robert Maynard
142a538d32 Merge topic 'dont_look_for_targets_before_they_exist'
90c607c99 Correct CMake checking for targets before creation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2368
2020-12-30 13:08:36 -05:00
Robert Maynard
90c607c999 Correct CMake checking for targets before creation 2020-12-30 12:42:51 -05:00
Robert Maynard
4c2f8cc635 Merge topic 'workaround_hip_min_bug'
0134de4fe Don't use HIP overloads for std::min

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !2366
2020-12-29 08:55:03 -05:00
Robert Maynard
0134de4fe4 Don't use HIP overloads for std::min
The HIP overloads for std::min don't return the first parameter
when the two values are equal which causes problems when inputs
such as nan.

Reported upstream:
https://github.com/ROCm-Developer-Tools/HIP/issues/2209
2020-12-28 13:29:32 -05:00
Robert Maynard
f473e3e45b Merge topic 'cleanup_cmake_style'
7897d23c3 Cleanup some minor CMake style issues

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !2365
2020-12-28 11:49:32 -05:00
Robert Maynard
7897d23c39 Cleanup some minor CMake style issues 2020-12-28 10:36:00 -05: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