Commit Graph

7054 Commits

Author SHA1 Message Date
Abhishek Yenpure
3fe41d7a8b Merge topic 'warpX-streams'
8704ff253 Removing host/device being called from device warning
f0d267e81 Adding WarpX particle advection streamlines

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2569
2021-09-02 16:09:06 -04:00
Nickolas Davis
a2e2d5631a Merge topic 'cuda-runtime-device-config'
5530d86e4 update cuda examples to use RuntimeDeviceConfiguration
eaba40724 Call GetRuntimeConfiguration before GetRuntimeDeviceTracker in Initialize
9730de807 remove cudaGetDevice calls, favor runtime device config
adac415f1 implement cuda runtime device configuraton

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2565
2021-09-02 12:43:54 -04:00
Kenneth Moreland
a2a8dcdfd5 Allow a const ArrayHandle to be reallocated
Previously, the `Allocate` method of `ArrayHandle` was _not_ declared as
`const`. Likewise, the methods that depended on `Allocate`, namely
`ReleaseResources` and `PrepareForOutput` were also not declared `const`.
The main consequence of this was that if an `ArrayHandle` were passed as a
constant reference argument to a method (e.g. `const ArrayHandle<T>& arg`),
then the array could not be reallocated.

This seems right at first blush. However, we have changed these methods to
be `const` so that you can in fact reallocate the `ArrayHandle`. This is
because the `ArrayHandle` is in principle a pointer to an array pointer.
Such a structure in C will allow you to change the pointer to the array,
and so in this context it makes sense for `ArrayHandle` to support that as
well.

Although this distinction will certainly be confusing to users, we think
this change is correct for a variety of reasons.

  1. This change makes the behavior of `ArrayHandle` consistent with the
     behavior of `UnknownArrayHandle`. The latter needed this behavior to
     allow `ArrayHandle`s to be passed as output arguments to methods that
     get automatically converted to `UnknownArrayHandle`.
  2. Before this change, a `const ArrayHandle&` was still multible is many
     way. In particular, it was possible to change the data in the array
     even if the array could not be resized. You could still call things
     like `WritePortal` and `PrepareForInOut`. The fact that you could
     change it for some things and not others was confusing. The fact that
     you could call `PrepareForInOut` but not `PrepareForOutput` was doubly
     confusing.
  3. Passing a value by constant reference should be the same, from the
     calling code's perspective, as passing by value. Although the function
     can change an argument passed by value, that change is not propogated
     back to the calling code. However, in the case of `ArrayHandle`,
     calling by value would allow the array to be reallocated from the
     calling side whereas a constant reference would prevent that. This
     change makes the two behaviors consistent.
  4. The supposed assurance that the `ArrayHandle` would not be reallocated
     was easy to break even accidentally. If the `ArrayHandle` was assigned
     to another `ArrayHandle` (for example as a class' member or wrapped
     inside of an `UnknownArrayHandle`), then the array was free to be
     reallocated.
2021-09-02 10:29:09 -06:00
Kenneth Moreland
40f26ff4cd Merge topic 'array-copy-const-ref'
e74093470 Allow ArrayCopy into const ref of UnknownArrayHandle

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Li-Ta Lo <ollie@lanl.gov>
Merge-request: !2568
2021-09-02 11:20:06 -04:00
Nickolas Davis
eaba40724a Call GetRuntimeConfiguration before GetRuntimeDeviceTracker in Initialize 2021-09-02 09:17:36 -06:00
Nickolas Davis
9730de8074 remove cudaGetDevice calls, favor runtime device config 2021-09-02 09:17:36 -06:00
Nickolas Davis
adac415f15 implement cuda runtime device configuraton 2021-09-02 09:12:21 -06:00
Abhishek Yenpure
8704ff2537 Removing host/device being called from device warning 2021-09-01 17:54:41 -07:00
Abhishek Yenpure
f0d267e813 Adding WarpX particle advection streamlines 2021-09-01 17:22:51 -07:00
Abhishek Yenpure
52ae3e4dee Adding missing header 2021-09-01 12:04:31 -07:00
Kenneth Moreland
e740934700 Allow ArrayCopy into const ref of UnknownArrayHandle
Added the following form of `ArrayCopy`:

```cpp
VTKM_CONT_EXPORT void ArrayCopy(
  const vtkm::cont::UnknownArrayHandle& source,
  const vtkm::cont::UnknownArrayHandle& destination);
```

Note that the destination array is a constant reference. This is
actually OK because you can change the contents of an
`UnknownArrayHandle` (as long as you don't change the array being
referenced). The main motivation for this change is to allow you to call
this form of `ArrayCopy` while passing in a `ArrayHandle` as the second
argument. C++ will automatically make the conversion, but the function
has to accept a const reference for it to be passed correctly.

Note that there is still a form of `ArrayCopy` that accepts a non-const
reference to the destination array. The two arrays behave the same
except for one difference. For the non-const version, if the
`UnknownArrayHandle` does not already point to an array (i.e. is not
valid), a new array will be created and placed in the destination
object. However, because this cannot be done for a const reference, an
exception is thrown instead.
2021-09-01 12:11:04 -06:00
Abhishek Yenpure
57711cab8c Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into mir 2021-09-01 09:40:27 -07:00
Kenneth Moreland
b65e8bfcc7 Merge topic 'arraygetvalues-precompiled'
835467753 Fix link issue with discarded section
42acb9a66 Properly check whether ArrayHandleRecombineVec is on device
c17a5569f Do not try to use ArrayGetValue on arrays of non-basic types
9ca0cd1f6 Report array type when UnknownArrayHandle::ExtractComponent fails
e1ac918bc Compile ArrayGetValues implementation in library

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Li-Ta Lo <ollie@lanl.gov>
Merge-request: !2551
2021-09-01 08:54:15 -04:00
Kenneth Moreland
546dd608e1 Suppress exception when mapping field of unknown type
By default, the `FilterDataSet` class will iterate over all fields and
use `CastAndCall` on each one to call the subclass' mapping function
with the appropriate array type.

This only works if the array is of a known type. If it is not
`CastAndCall` throws an exception. However, having the entire filter
exception out just because one field cannot be converted does not make
sense. Instead, catch the exception, log a warning, and drop the field.
2021-08-31 14:24:50 -06:00
James
0e6228bbd8 Updating threshold to return all or part in range. 2021-08-31 15:33:45 -04:00
Abhishek Yenpure
c64bf9b3df removing wrong fix that added additional errors 2021-08-30 13:22:32 -07:00
Ben Boeckel
73353fea70 Merge topic 'allow-skip-version-links'
09d5b9471 cmake: allow VTK to skip soname links for libraries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Vicente Bolea <vicente.bolea@kitware.com>
Merge-request: !2563
2021-08-26 13:58:44 -04:00
Ben Boeckel
09d5b9471e cmake: allow VTK to skip soname links for libraries
VTK's wheels do not want these symlinks because they are useless in
Python wheels.
2021-08-26 12:06:09 -04:00
Vicente Adolfo Bolea Sanchez
d348b11183 Enable shared CUDA builds when not compiling virtuals
The reason why we did not support shared libraries when CUDA compiles
were on is that virtual methods require a special linking step to pull
together all virtual methods that might be called. I other words, you
cannot call a virtual CUDA method defined inside a library. This
requirement goes away when virtuals are removed.

Also removed the necessity of using seprable compilation with cuda.
Again, this is only needed when a CUDA function is defined in one
translation unit and used in another. Now we can enforce that all
translation units define their own CUDA functions.

Also, suppress warnings in cuda/internal/ExecutionPolicy.h

This is where we call the thrust algorithms. There must be some loop
where it, on some code path, calls back a host function. This must be in
an execution path that never happens. The thrust version has its own
suppress, but that does not seem to actually suppress the warning (it
just means that the warning does not tell you where the actual call is).

Get around the problem by suppressing the warnings in VTK-m.

Co-authored-by: Kenneth Moreland <morelandkd@ornl.gov>
Co-authored-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>

Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2021-08-24 13:14:58 -04:00
Vicente Adolfo Bolea Sanchez
a6c4e8479f KOKKOS: resolved issue with KOKKOS_LAMBDA 2021-08-24 13:14:58 -04:00
Kenneth Moreland
24621e95ed Merge topic 'convert-to-expected'
0855de1b4 Collect the get methods for `Field` in the header definition
47371bb5e Add ability to convert fields to known types

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Vicente Bolea <vicente.bolea@kitware.com>
Merge-request: !2558
2021-08-23 15:15:44 -04:00
Kenneth Moreland
0855de1b47 Collect the get methods for Field in the header definition 2021-08-23 11:11:01 -06:00
Kenneth Moreland
c89d709345 Fix condition in RuntimeDeviceConfiguration
`RuntimeDeviceConfiguration` is supposed to log a warning if a specific
device returns a non-success status other than simply an invalid option.
However, the condition was wrong and warnings never happened.
2021-08-20 08:51:44 -06:00
Kenneth Moreland
47371bb5e6 Add ability to convert fields to known types
In VTK-m we have a constant tension between minimizing the number of
types we have to compile for (to reduce compile times and library size)
and maximizing the number of types that our filters support.
Unfortunately, if you don't compile a filter for a specific array type
(value type and storage), trying to run that filter will simply fail.

To compromise between the two, added methods to `DataSet` and `Field`
that will automatically convert the data in the `Field` arrays to a type
that VTK-m will understand. Although this will cause an extra data copy,
it will at least prevent the program from failing, and thus make it more
feasible to reduce types.
2021-08-19 07:10:20 -06:00
Nickolas Davis
56cbd0abe2 Merge topic 'kokkos-runtime-device-config'
cd2a6c138 implement kokkos runtime device configuration

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2549
2021-08-18 16:35:43 -04:00
nadavi
cd2a6c1385 implement kokkos runtime device configuration 2021-08-18 13:23:30 -06:00
Vicente Adolfo Bolea Sanchez
b6fc783631 Filters: Add cmake instantiations generator
Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2021-08-14 13:39:53 -04:00
Vicente Adolfo Bolea Sanchez
0b5e3e786e CI: Remove warnings of CUDA & use attributes
Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2021-08-12 19:20:02 -04:00
Kenneth Moreland
5191909b51 Fix MeshQuality to work with CellSetSingleType
The `MeshQuality` filter only worked with `CellSetExplicit<>`. However,
`MeshQuality` should also work with `CellSetSingleType`. Fix
`MeshQuality` to work with both.

The handling of cell sets was actually worse than that. After forcing
the type to `CellSetExplicit<>`, it then applied a policy that converted
the types back to all possible cell sets. Thus, the filter made lots of
code paths that were impossible to follow.
2021-08-12 12:42:56 -06:00
Sujin Philip
09e508cd86 Merge topic 'probe-point-fields'
abedf61e5 Fix probe filter field mapping

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2555
2021-08-12 14:10:00 -04:00
Kenneth Moreland
ecf36ed39f Fix compile errors in CellSetSingleType::CompleteAddingCells
Apparently, no code actually used this in a while and it has avoided
being compiled in a long time.
2021-08-12 12:02:02 -06:00
Abhishek Yenpure
c13ed21ef3 Fixing failing CUDA test 32bit IDs 64bit Floats 2021-08-11 11:59:39 -07:00
Abhishek Yenpure
e53f419f48 Fixing failing CUDA test 32bit IDs 64bit Floats 2021-08-11 11:54:43 -07:00
Kenneth Moreland
8354677535 Fix link issue with discarded section
In one of the dashboards, we got a link error about one of the
UnknownArrayHandle internal methods being discarded and then used. Add
an explicit `__attribute__((used))` modifier to prevent this from
happening.
2021-08-11 07:56:32 -06:00
Kenneth Moreland
42acb9a66c Properly check whether ArrayHandleRecombineVec is on device
The `ArrayCopy` was simply calling `IsOnDevice` to see if the array from
the `UnknownArrayHandle` was on a device. Seems right, but it is
actually operating on an `ArrayHandleRecombineVec`. This is a special
array that mostly behaves like other `ArrayHandle`s, but because it has
variable vec size, it breaks some `ArrayHandle` conventions.

One of the iffy things it has to do is stick the dependent `Buffer`
objects into the metadata of its own `Buffer` rather than list them in
the `Buffer` list. This means that `ArrayHandle` cannot properly check
them to see where they are located. Instead, it just sees that the one
`Buffer` it has is empty.

A recent change to `IsOnDevice` made it return true for any device if
the `Buffer` is empty. So previously this was broken in that it reported
that the array was not on any device. That changed to report that it was
on all devices, even inactive ones. So the code went from not
efficiently copying to throwing an exception.

This has been fixed by pulling one of the dependent arrays and checking
that one.
2021-08-11 07:56:32 -06:00
Kenneth Moreland
c17a5569f5 Do not try to use ArrayGetValue on arrays of non-basic types
This is no longer supported.
2021-08-11 07:56:32 -06:00
Kenneth Moreland
9ca0cd1f6c Report array type when UnknownArrayHandle::ExtractComponent fails
Sneak this into an unrelated MR because I missed it in the last one.
2021-08-11 07:56:32 -06:00
Kenneth Moreland
e1ac918bc7 Compile ArrayGetValues implementation in library
Previously, all of the `ArrayGetValues` implementations were templated
functions that had to be built. That meant that any code using them had
to be compiled with a device compiler and create special code for it.
This change uses an `UnknownArrayHandle` to encapsulate the
`ArrayHandle` and call a per-compiled library function. This means that
the code only has to be compiled once.
2021-08-11 07:56:32 -06:00
Kenneth Moreland
bfb693c1d2 Merge topic 'fix-unknownah-circular-dependency'
bb7661c16 Fix recursive header file dependancies

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Li-Ta Lo <ollie@lanl.gov>
Merge-request: !2552
2021-08-11 09:36:41 -04:00
Kenneth Moreland
599fd4f582 Merge topic 'device-select-on-threads'
3feff3689 Save device choice on spawned control threads

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Li-Ta Lo <ollie@lanl.gov>
Merge-request: !2543
2021-08-11 08:53:48 -04:00
Abhishek Yenpure
816c29eda7 Adding missing header VectorAnalysis 2021-08-10 16:34:18 -07:00
Abhishek Yenpure
da19ea2ee1 Removing unnecessesary header ImplicitFunctionHandle 2021-08-10 16:31:40 -07:00
Abhishek Yenpure
b185944d3f Adding fixes from Ken's review 2021-08-10 16:17:11 -07:00
Abhishek Yenpure
1a3a139f4a Updating portal types to newer 1.6 requirements 2021-08-10 13:36:37 -07:00
Sujin Philip
abedf61e5c Fix probe filter field mapping
All probed fields should become point fields in output
2021-08-09 12:56:28 -04:00
Sujin Philip
707dfd3c82 Merge topic 'fix-dataset-writer'
9bb10b396 Fix VTKDataSetWriter writing `char` types

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2538
2021-08-09 09:53:55 -04:00
Sujin Philip
9bb10b3961 Fix VTKDataSetWriter writing char types 2021-08-06 09:58:26 -04:00
Kenneth Moreland
bb7661c169 Fix recursive header file dependancies
Having UnknownArrayHandle.h include DefaultTypes.h is problematic,
because that header includes lots of other classes like cell sets.
Keeping these from in turn depending back on UnknownArrayHandle.h is
difficult. So this dependancy is broken.
2021-08-06 06:16:29 -06:00
Abhishek Yenpure
7f4b66d057 Adding MIR filter
-- Adding MIR filter and tables for material reconstruction
2021-08-05 15:15:28 -07:00
Dave Pugmire
82f5b5ebcf Merge topic 'threaded_filters'
0ea4470f1 Simplify the code a little.
179643107 Cleanup. remove prints.
50a42a144 Forgot to add header to CMakeLists.txt
f8021dbc0 Add threaded filters for multiblock dataset.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2548
2021-08-05 14:59:38 -04:00
Dave Pugmire
0ea4470f19 Simplify the code a little. 2021-08-05 12:16:33 -04:00
Dave Pugmire
179643107b Cleanup. remove prints. 2021-08-05 11:50:34 -04:00
Dave Pugmire
50a42a1447 Forgot to add header to CMakeLists.txt 2021-08-05 10:44:54 -04:00
Dave Pugmire
f8021dbc0d Add threaded filters for multiblock dataset. 2021-08-04 14:27:41 -04:00
Kenneth Moreland
1ec4e5d62c Improve type reporting in UnknownArrayHandle
Added features with reporting types with `UnknownArrayHandle`. First,
added a method named `GetArrayTypeName` that returns a string containing
the type of the contained array. There were already methods
`GetValueType` and `GetStorageType`, but this provides a convenience to
get the whole name in one go.

Also improved the reporting when an `AsArrayHandle` call failed. Before,
the thrown method just reported that the `UnknownArrayHandle` could not
be converted to the given type. Now, it also reports the type actually
held by the `UnknownArrayHandle` so the user can better understand why
the conversion failed.
2021-08-04 12:11:10 -06:00
Kenneth Moreland
6f5455d0d6 Enable TypeToString for type_info
VTK-m contains a helpful method named `vtkm::cont::TypeToString` that
either takes a type as a template argument or a `std::type_info` object
and returns a human-readable string for that type.

The standard C++ library has an alternate for `std::type_info` named
`std::type_index`, which has the added ability to be used in a container
like `set` or `map`. The `TypeToString` overloads have been extended to
also accept a `std::type_info` and report the name of the type stored in
it (rather than the name of `type_info` itself).
2021-08-04 12:11:10 -06:00
Dave Pugmire
6f8d1466bc Fixes for compiler warnings. 2021-08-04 12:25:55 -04:00
Dave Pugmire
bde0672a4c Merge topic 'fix_smallstep_advection'
39054e644 Add corner case unit test.
0a3fd2629 Add test file for corner case.
4b0896bd8 Fix for corner case in particle advection.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Abhishek Yenpure <abhishek@uoregon.edu>
Merge-request: !2545
2021-08-04 07:10:35 -04:00
Dave Pugmire
39054e644f Add corner case unit test. 2021-08-03 21:40:28 -04:00
Dave Pugmire
4b0896bd8c Fix for corner case in particle advection. 2021-08-02 13:39:32 -04:00
Kenneth Moreland
869535b23f Remove uses of ScopedCudaStackSize
Since we have (hopefully) gotten rid of all unbounded recursion and
calls to function pointers or virtual methods, the CUDA compiler should
be able to statically determine the size of the stack needed. Thus, we
shouldn't need `ScopedCudaStackSize` at all.

However, there is one odd case where using it seems to be necessary. It
is unclear why, but that is an issue for another day.
2021-08-02 09:53:02 -06:00
Kenneth Moreland
4bf8bfb1fa Deprecate KdTree3D worklets
The implementation of the search in the k-d tree is problematic because
it uses unbounded recursion. This is a problem for GPU devices, which
have very short stacks set by how many calls the compiler determines.
This is fixable, but the fix is not trivial.

This class is not used anywhere in VTK-m other than a trivial test.
Thus, I am just deprecating the class. I am also deleting the test, so
the code is not run anymore.
2021-08-02 09:50:41 -06:00
Kenneth Moreland
5fa402ac28 Remove recursion from FloatDistance
The maximum recursion that could happen was 1 call in, but compilers had
trouble determining that. Split this into 2 non-recursive functions so
the compiler can easily determine the stack depth.
2021-08-02 09:50:41 -06:00
Kenneth Moreland
3feff36891 Save device choice on spawned control threads
The `RuntimeDeviceTracker` is a thread-local variable that monitors the
devices to use separately on each thread. This is an important feature
to allow different threads to control different devices.

When a tracker is created on a new thread, it was simply reset, which
makes sense. However, the reset does not take into account the device
selected by `vtkm::cont::Initialize`. This means that if VTK-m was used
in a different thread than it was initialized, it would ignore the
`--vtkm-device` parameter.

To get around this problem, keep track of the `RuntimeDeviceTracker` on
the "main" thread. When a `RuntimeDeviceTracker` is created on a new
thread, it copies the state from that tracker.
2021-07-29 16:57:27 -06:00
Kenneth Moreland
822eb8f165 Merge topic 'copy-runtime-state'
624117963 Add RuntimeDeviceTracker::CopyState

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Li-Ta Lo <ollie@lanl.gov>
Merge-request: !2540
2021-07-29 10:37:52 -04:00
Kenneth Moreland
3b9e028a5e Merge topic 'deprecate-arrayhandle-getdeviceadapterid'
34615a985 Deprecate ArrayHandle::GetDeviceAdapterId

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Li-Ta Lo <ollie@lanl.gov>
Merge-request: !2534
2021-07-29 10:37:05 -04:00
Kenneth Moreland
6241179631 Add RuntimeDeviceTracker::CopyState
It is sometimes the case that you want to copy the state of one
`RuntimeDeviceTracker` to another. This is particularly the case when
creating threads in the control environment. Each thread has its own
copy of `RuntimeDeviceTracker`, so when you spawn a thread you probably
want to copy the state of the tracker from the calling thread.
2021-07-28 13:16:12 -06:00
Kenneth Moreland
34615a9858 Deprecate ArrayHandle::GetDeviceAdapterId
This method is a remenant of when `ArrayHandle` could only store data on
one device at a time. It is now capable of storing data on any number of
devices (as well as the host), so asking for "the" device no longer
makes sense. Thus, this method is deprecated in favor of
`ArrayHandle::IsOnDevice`.

This deprecation leads to fixing some older functionality that still
assumed data could only be on one device at a time.

Fixes #592.
2021-07-28 12:51:51 -06:00
Kenneth Moreland
bf6d6ca517 Merge topic 'shallow-array-copy'
1fb114172 Update code to use ArrayCopyShallowIfPossible
5c36eafe5 Add ArrayCopyShallowIfPossible

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Li-Ta Lo <ollie@lanl.gov>
Merge-request: !2529
2021-07-21 11:29:48 -04:00
Gunther H. Weber
f9eab2eeec Replace STL exception in contour tree with VTKM exception 2021-07-15 14:00:23 -07:00
Kenneth Moreland
1fb1141723 Update code to use ArrayCopyShallowIfPossible
There were several places in the code that had to check the type of an
`UnknownArrayHandle` and conditionally get or copy that array. This code
is simplified by using `ArrayCopyShallowIfPossible`.
2021-07-15 08:53:52 -06:00
Kenneth Moreland
5c36eafe56 Add ArrayCopyShallowIfPossible
Often times you have an array of an unknown type (likely from a data set),
and you need it to be of a particular type (or can make a reasonable but
uncertain assumption about it being a particular type). You really just
want a shallow copy (a reference in a concrete `ArrayHandle`) if that is
possible.

`ArrayCopyShallowIfPossible` pulls an array of a specific type from an
`UnknownArrayHandle`. If the type is compatible, it will perform a shallow
copy. If it is not possible, a deep copy is performed to get it to the
correct type.

Fixes #572.
2021-07-15 08:52:07 -06:00
Gunther Weber
6c7a062b01 Merge topic 'contour-tree-performance-improvements'
851c32718 Clean-up 0f CopyArrayByIndices and CopyVecArrayByIndices helpers
89fc3be8f Changed comment style to avoid warning
17caf7f3a Fixed incorrect filename in CMakeLists.txt
c3b3c44eb Update CMakeLists.txt
b625ef7db Removed helper function for debugging
dffb7afbc Clean-up. Move functor class outside template.
51f737041 Clean-up. Move functor class outside template.
749232665 Added missing const qualifier
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2443
2021-07-14 13:04:06 -04:00
Gunther Weber
fa0ce37b96 Merge topic 'add/ct_iter_check'
ca86402f9 Provide additional debug info in case contour tree hangs
48d91b99f Throw exception if merge tree gets stuck in a loop
c7ea03ee2 Throw exception if contour tree gets stuck in a loop

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2420
2021-07-13 21:29:04 -04:00
Sujin Philip
c5b72c9d97 Merge topic 'fix-cuda-interop'
8d62bf128 Fix cuda-opengl interop

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2528
2021-07-13 10:48:25 -04:00
Kenneth Moreland
f883b5e036 Avoid divide by zero in rendering TriangleIntersections 2021-07-12 11:23:24 -06:00
Kenneth Moreland
ede7756929 Allow for empty Z bounds in ResetToBounds
If the camera is not a 3D camera, then it might be the case that the
calling code has not set the bounds in the Z direction. Allow this to
happen as long as you are not using a 3D camera.
2021-07-12 10:57:19 -06:00
Kenneth Moreland
4c1514bb3a Fix divide by zero in CanvasRayTracer
The divide by zero happened when mapping a surface to a depth buffer.
Some rays terminated at the origin, which is a singularity in the
project matrix.

This might be indicative of a larger problem. Rays really shouldn't
terminate before the near plane.
2021-07-12 10:29:46 -06:00
Kenneth Moreland
83369ed95a Remove unused fields from Ortho2DRayGen
There were apparently some fields copy/pasted from the 3D version were
not used in the 2D version (probably because they had no meaning). In
one case, one was erroneously normalized, and could cause a floating
point exception.
2021-07-12 10:29:46 -06:00
Kenneth Moreland
c1a790db2d Fix BIH split calculations for empty regions
When computing the cost for splitting, if a regions was empty you would
get a floating point error when multiplying the (invalid) region bound
(inf or -inf) with the number of points (0). It would then check for NaN
costs and reset that. This worked but caused a floating point exception,
which is problematic for some users.

Instead, check for empty regions before computing the cost and reset the
cost that way.
2021-07-12 10:29:46 -06:00
Kenneth Moreland
9ce97352d9 Fix divide-by-zero in UnitTestCellInterpolate 2021-07-12 10:29:46 -06:00
Kenneth Moreland
e4ae3cee1b Avoid floating point exception in Orthonormalize 2021-07-12 10:29:46 -06:00
Kenneth Moreland
f74a2239eb Break LUP factorization when invalid matrix found
Singular matrices cannot be LUP factorized, so this condition is
detected and returned in a `valid` flag. However, when the detection
happened, the rest of the computation continued to happen. This could
lead to floating point exceptions, which some applications do not like.
So, when an invalid array is detected, return immediately.
2021-07-12 10:29:46 -06:00
Kenneth Moreland
6447b17303 Disable floating point exception traps when testing NaNs
Some functions are supposed to behave correctly when given a NaN. This
might only be valid if floation point exceptions are not trapped, so
disable trapping for these tests.
2021-07-12 10:29:45 -06:00
Kenneth Moreland
b01ca530b8 Turn on floating point exception trapping for GCC in tests
Some simulations trap floating point exceptions to ensure that their
code is working correctly, and we want VTK-m to work correctly in their
code. To check this, we want to turn on floating point exception
trapping in our test code. This is very implementation-specific, so for
now we are just turning it on for GCC. This will at least alert a
problem on some of the dashboards.
2021-07-12 10:29:37 -06:00
Sujin Philip
8d62bf1286 Fix cuda-opengl interop
1. Use cudaPerThreadStream instead of the default streams
2. Since there have been changes to ArrayHandle code, the API to create
ArrayHandle from a device pointer has changed.
2021-07-12 10:32:44 -04:00
Kenneth Moreland
80d622cd92 Merge topic 'unknown-array-better-allocate'
8d7cf2c85 Support all Allocate flags in UnknownArrayHandle

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Li-Ta Lo <ollie@lanl.gov>
Merge-request: !2522
2021-06-30 14:06:18 -04:00
Gunther H. Weber
851c327188 Clean-up 0f CopyArrayByIndices and CopyVecArrayByIndices helpers 2021-06-28 15:44:44 -07:00
Gunther H. Weber
89fc3be8fa Changed comment style to avoid warning 2021-06-28 15:44:44 -07:00
Gunther H. Weber
17caf7f3a4 Fixed incorrect filename in CMakeLists.txt 2021-06-28 15:44:44 -07:00
Gunther H. Weber
c3b3c44eb1 Update CMakeLists.txt 2021-06-28 15:44:44 -07:00
Gunther H. Weber
b625ef7dbd Removed helper function for debugging 2021-06-28 15:44:44 -07:00
Gunther H. Weber
dffb7afbcd Clean-up. Move functor class outside template. 2021-06-28 15:44:44 -07:00
Gunther H. Weber
51f737041b Clean-up. Move functor class outside template. 2021-06-28 15:44:44 -07:00
Gunther H. Weber
749232665b Added missing const qualifier 2021-06-28 15:44:44 -07:00
Gunther H. Weber
32dcd3d0c5 Refactor merging to be restricted to only common vertices 2021-06-28 15:44:44 -07:00
Gunther H. Weber
47cc80e42c Add missing ArrayRangeComputeTemplate.h include to avoid memory copy 2021-06-28 15:44:44 -07:00
Gunther H. Weber
f5b95fe42d Clean up/remove contour tree mesh worklets no longer used. 2021-06-28 15:44:43 -07:00
Gunther H. Weber
35da705571 Add missing contour tree mesh worklets to CMakeLists.txt 2021-06-28 15:44:43 -07:00
Gunther H. Weber
b2fd0f9178 Added missing VTKM_EXEC in CopyNeighborsToPackedArray worklet 2021-06-28 15:44:43 -07:00
Gunther H. Weber
608dec63e8 Disable debug output in UnitTestContourTreeUniformDistributed 2021-06-28 15:44:43 -07:00
Gunther H. Weber
4da3fb57e9 Improved merge by keeping track of insert position 2021-06-28 15:44:43 -07:00
Gunther H. Weber
9ccde88d0f Commented out debug output/added comment. 2021-06-28 15:44:43 -07:00
Gunther H. Weber
9548ba5100 Add debug out and refactor for debugging 2021-06-28 15:44:43 -07:00
Gunther H. Weber
968ccfc351 Refactored ContourTreeMesh based on Ken Moreland's suggestions 2021-06-28 15:44:43 -07:00
Gunther H. Weber
39aad140ef More uses of ArrayGetValue where appropriate 2021-06-28 15:44:43 -07:00
Gunther H. Weber
85503c55d3 Fix dash board compiler warnings 2021-06-28 15:44:43 -07:00
Gunther H. Weber
abe7de6cc1 Avoid inner loop branch through compile time optimization 2021-06-28 15:44:43 -07:00
Gunther H. Weber
8ff6461ee7 Use vtkm::LowerBound/vtkm::UpperBound instead of custom binary search 2021-06-28 15:44:43 -07:00
Gunther H. Weber
5e98005227 Use ArrayGetValue to avoid array transfer to control environment 2021-06-28 15:44:43 -07:00
Gunther H. Weber
b490727324 Replace ScanExclusive with ScanExtended based on review feedback. 2021-06-28 15:44:43 -07:00
Gunther H. Weber
7f46a21bf0 Fix compile error on ubuntu1804_clang_cuda 2021-06-28 15:44:43 -07:00
Gunther H. Weber
84022a02eb Refactor changes to CombinedVectorDifferentFromNext.h 2021-06-28 15:44:43 -07:00
Oliver Ruebel
7ff30cb0c4 Avoid extra array copy and use ScanExclusive in ContourTreeMesh::MergeWith 2021-06-28 15:44:43 -07:00
Oliver Ruebel
9603c9f9bc Avoid pulling arrys to host to compute nCombinedNeighbours 2021-06-28 15:44:42 -07:00
Gunther H. Weber
4403947746 Fix MergeCombinedOtherStartIndexWorklet instead of using STL; clean up 2021-06-28 15:44:42 -07:00
Gunther H. Weber
b1ace58809 Use worklet to combine sorted lists instead of serial std::merge 2021-06-28 15:44:42 -07:00
Oliver Ruebel
f28961af94 Add time profiling for ContourTreeMesh::MergeWith 2021-06-28 15:44:42 -07:00
Vicente Adolfo Bolea Sanchez
dd727b9af5 General: remove warnings in the CI
Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2021-06-26 18:12:56 -04:00
Dave Pugmire
f7826d1efd Merge topic 'temporal_particle_advection'
f878ba8da Move the check for 0 inputs. With mpi, 0 input is ok for a rank.
4b2dbfbad Remove unused header.
b08082472 Clean up the code a bit.
c4341adfe update cmakelists.txt. The merge somehow missed this..
90bed8d0c refactor particle adv-based filters and make a temporal particle adv filter.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2515
2021-06-24 07:26:33 -04:00
Nickolas Davis
f949d8adea Merge topic 'device-resource-management'
fe3b82b99 implement return codes and protected virtual parsing of arguments
ce9c27bc0 Implement tests for RuntimeDeviceConfiguration helpers
408beefc0 Implement RuntimeDeviceConfiguration

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2513
2021-06-23 16:11:32 -04:00
nadavi
fe3b82b99c implement return codes and protected virtual parsing of arguments 2021-06-23 17:58:38 +00:00
Dave Pugmire
f878ba8dab Move the check for 0 inputs. With mpi, 0 input is ok for a rank. 2021-06-23 13:53:56 -04:00
Dave Pugmire
4b2dbfbad2 Remove unused header. 2021-06-22 14:21:45 -04:00
Dave Pugmire
b080824723 Clean up the code a bit. 2021-06-22 13:36:14 -04:00
Kenneth Moreland
8d7cf2c858 Support all Allocate flags in UnknownArrayHandle
`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.
2021-06-21 11:25:51 -06:00
nadavi
ce9c27bc0e Implement tests for RuntimeDeviceConfiguration helpers 2021-06-17 17:56:39 +00:00
nadavi
408beefc0a Implement RuntimeDeviceConfiguration 2021-06-17 17:56:38 +00:00
Kenneth Moreland
2589e5b740 Merge topic 'latest-tbb'
3be3529ff Export tbb interface as vtkm::tbb
a8825db59 Disable loading the TBBConfig.cmake file
5eb688da2 Update parallel radix sort for OpenMP
1eea0bee1 Use TBB task_group for radix sort
904e784e8 Remove TBB parallel_sort patch
0390c8b07 Pull FindTBB.cmake from VTK

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Vicente Bolea <vicente.bolea@kitware.com>
Merge-request: !2509
2021-06-14 09:27:16 -04:00
Kenneth Moreland
67aa4782ae Merge topic 'benchmark-does-not-need-testing'
9d5d9e38a Remove testing headers from benchmarking

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Vicente Bolea <vicente.bolea@kitware.com>
Merge-request: !2512
2021-06-12 01:18:56 -04:00
Dave Pugmire
c4341adfe2 update cmakelists.txt. The merge somehow missed this.. 2021-06-11 08:08:30 -04:00
Dave Pugmire
90bed8d0cf refactor particle adv-based filters and make a temporal particle adv filter. 2021-06-11 08:00:25 -04:00
Kenneth Moreland
5eb688da2a Update parallel radix sort for OpenMP
Some changes required for TBB bled into the implementation of OpenMP.
2021-06-10 10:39:18 -06:00
Kenneth Moreland
1eea0bee12 Use TBB task_group for radix sort
TBB 2020 introduced a new class called `task_group`. TBB 2021 removed
the old class `task` as its functionality was replaced by `task_group`.
Our parallel radix sort for TBB was implemented using `task`s, so change
it to use `task_group` (which actually cleans up the code a bit).
2021-06-10 10:39:13 -06:00
Kenneth Moreland
9d5d9e38a1 Remove testing headers from benchmarking
The code in `vtkm/cont/Testing.h` now requires a library, which is not
built if testing is not built. Thus, the benchmarking code was giving a
compile error if benchmarking was on but testing was off.

Change the benchmarking to not rely on anything in the Testing
framework. This means using classes in `vtkm/source` instead of
`MakeTestData`. Also avoid using the `TestValue` defined for the tests.
(In one case, we have a simple replacement.) Also had to fix a problem
with a header file not defining everything it needed to compile.
2021-06-10 09:41:26 -06:00
Kenneth Moreland
904e784e89 Remove TBB parallel_sort patch
Years ago we discovered a problem with TBB's parallel sort, which we
patch in our local repo and submitted a change to TBB, which has been
accepted.

The code to decide whether to use our parallel_sort patch does not work
with the latest versions of TBB because it requires including a header
that changed names to get the TBB version.

We no longer support any TBB version with this bug, so just remove the
patch from VTK-m.
2021-06-10 09:18:08 -06:00
Dave Pugmire
3bd15950bd Clarify dimension values for 2d, 1d. fix test 2021-06-09 16:16:34 -04:00
Dave Pugmire
651345b491 cleanup included headers. 2021-06-09 14:02:42 -04:00
Dave Pugmire
aaa6855a6f Clean the code up a little. 2021-06-09 13:58:27 -04:00
Dave Pugmire
3588209562 Add helper class to build curvilinear datasets. 2021-06-09 13:50:01 -04:00
Ben Boeckel
7e576483cb Merge topic 'cmake-guard-testing-directories'
b719911d1 cmake: use `if (TEST)` to detect tests that are enabled
4c7fe13a9 cmake: avoid adding testing directories if testing is disabled

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Vicente Bolea <vicente.bolea@kitware.com>
Merge-request: !2508
2021-06-02 18:05:59 -04:00
Sujin Philip
749e972772 Merge topic 'add-slice-filter'
d1b22046e Add Slice filter and tests

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2501
2021-06-02 09:38:27 -04:00
Ben Boeckel
b719911d1b cmake: use if (TEST) to detect tests that are enabled
It's just simpler in this case.
2021-06-01 18:40:46 -04:00
Ben Boeckel
4c7fe13a98 cmake: avoid adding testing directories if testing is disabled
Some testing directories have side effects such as installing headers or
compiling code that ultimately doesn't end up getting used.
2021-06-01 18:40:40 -04:00
Vicente Adolfo Bolea Sanchez
9bcf78b830 diy: update tag 2021-06-01 10:33:46 -04:00
Vicente Adolfo Bolea Sanchez
9c267d1770 Merge branch 'upstream-diy' into add-update-diy
# By Diy Upstream
* upstream-diy:
  diy 2021-05-26 (b21d798e)
2021-06-01 10:33:30 -04:00
Sujin Philip
d1b22046eb Add Slice filter and tests 2021-05-28 11:35:51 -04:00
Sujin Philip
0a401c2ace Merge topic 'fix-dataset-reader'
57f516811 Support reading Global and Pedigree ids
a01e4335d Support reading new format cells
d7b2fec44 Fix reading of string arrays

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2490
2021-05-17 12:52:41 -04:00
Sujin Philip
57f5168114 Support reading Global and Pedigree ids 2021-05-17 09:52:21 -04:00
Sujin Philip
a01e4335d2 Support reading new format cells 2021-05-17 09:51:21 -04:00
Sujin Philip
d7b2fec447 Fix reading of string arrays 2021-05-17 09:51:12 -04:00
Kenneth Moreland
e0abb39810 Unify common storage types
The list defining the common storage types was defined in
DefaultTypes.h.in. The problem was that derived default types could not
just add their own type. They had to redefine the whole list.

Instead, move the list to StorageList.h. Also updated
DefaultTypesVTK.h.in to use this list when using XGC. This enables
ArrayHandleSOA for this case.
2021-05-13 08:18:33 -06:00
Nickolas Davis
c4117ede8a Merge topic 'prefix-cmd-line-args'
968c66f94 add TODO to update kokkos initialize
18d7827db update vtkm test arguments
5fa8734bb update vtkm initialize flags to have 'vtkm' prefix and deprecate old flags

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2456
2021-05-12 09:57:47 -04:00
Sujin Philip
7972070d7c PartitionedDataSet GetField should be const 2021-04-30 16:27:58 -04:00
nadavi
968c66f949 add TODO to update kokkos initialize 2021-04-29 00:58:50 +00:00
nadavi
18d7827db7 update vtkm test arguments 2021-04-29 00:58:50 +00:00
nadavi
5fa8734bbc update vtkm initialize flags to have 'vtkm' prefix and deprecate old flags 2021-04-29 00:58:50 +00:00
Kenneth Moreland
8eed21d085 Do not declare headers for virtual classes that are removed 2021-04-28 15:28:06 -06:00
Kenneth Moreland
cb3bb43ff9 Completely deprecate virtual methods
Deprecate `VirtualObjectHandle` and all other classes that are used to
implement objects with virtual methods in the execution environment.

Additionally, the code is updated so that if the
`VTKm_NO_DEPRECATED_VIRTUAL` flag is set none of the code is compiled at
all. This opens us up to opportunities that do not work with virtual
methods such as backends that do not support virtual methods and dynamic
libraries for CUDA.
2021-04-28 07:28:32 -06:00
Kenneth Moreland
e3e1a76072 Disable deprecation for MSVC 2017
Although technically supported, this version of the visual studio likes
to put the warnings where templates are defined (rather than
instantiated). That makes it impossible to suppress a warning when, for
example, when a deprecated class is legitmately used in an std template
to implement other deprecated functionality.

To prevent this, disable deprecations on MSVC compilers before 2019. I
doubt any developers are using this compiler anywhere but the dashboard,
and the warnings should legitimately appear elsewhere.
2021-04-26 12:47:44 -06:00
Li-Ta Lo
e763873739 explicitly cast cell set to structured 3D to supress warnings 2021-04-23 09:48:29 -06:00
Nick Thompson
25c14a7ea9 Fix uninitialized variable warning on gcc-10.3 2021-04-21 16:31:31 +00:00
Nick Thompson
9f1ef651c4 Update UnitTestError.cxx 2021-04-16 17:46:43 +00:00
Nick Thompson
9d46f7981d Merge topic 'print_particle'
7e7d41a73 Make sure to #include<ostream>
dee5d209d Overload stream operator to print vtkm::Particle.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2479
2021-04-15 10:14:43 -04:00
Kenneth Moreland
237aff05e6 Merge topic 'rendering-mesh-conn-no-virtual'
6b144abe4 Remove virtual methods from MeshConnectivity in rendering

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2464
2021-04-15 10:09:24 -04:00
Nick Thompson
7e7d41a730 Make sure to #include<ostream> 2021-04-15 09:19:55 -04:00
Nick Thompson
dee5d209d4 Overload stream operator to print vtkm::Particle. 2021-04-15 08:36:53 -04:00
Nick Thompson
82361fc45e Better message on failure for DifferenceOfProducts. 2021-04-13 19:09:55 -04:00
Nick Thompson
384fea5ced Make sure arguments are placed in correct order. 2021-04-13 16:00:23 -04:00
Nick Thompson
cddb6f7b6d Do not flush the stream when you're just going to convert it to string. 2021-04-13 14:37:20 -04:00
Nick Thompson
794872eb07 Fix error in unit test. 2021-04-13 11:21:42 -04:00
Nick Thompson
76877b7982 Merge topic 'speed_up_tests'
021c3ff86 Print additional information on failure to facilitate debugging.
36b8c0d2a Merge branch 'speed_up_tests' of gitlab.kitware.com:NAThompson/vtk-m into speed_up_tests
9d6b73275 Use better variable names.
4133e40c0 Remove printing of expected errors.
eb760e04e Revert removal of print statements.
e7c075b5c Remove unused variable.
cb83b8179 Save another 10 seconds.
b0c2bc9d6 Ignore computationTime.
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2465
2021-04-13 10:07:50 -04:00
Li-Ta Lo
40c1b9d717 Merge topic 'particle_density'
148cad2ce Merge branch 'master' into particle_density
7bebc1c49 Disable passing input scalar field

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@acm.org>
Merge-request: !2471
2021-04-13 09:21:57 -04:00
Nick Thompson
021c3ff86d Print additional information on failure to facilitate debugging. 2021-04-13 09:08:52 -04:00
Nick Thompson
9d6b732750 Use better variable names. 2021-04-12 18:51:53 -04:00
Nick Thompson
4133e40c06 Remove printing of expected errors. 2021-04-12 18:51:53 -04:00
Nick Thompson
eb760e04ef Revert removal of print statements. 2021-04-12 18:51:53 -04:00
Nick Thompson
e7c075b5c4 Remove unused variable. 2021-04-12 18:51:53 -04:00
Nick Thompson
cb83b81793 Save another 10 seconds. 2021-04-12 18:51:52 -04:00
Nick Thompson
b0c2bc9d61 Ignore computationTime. 2021-04-12 18:51:52 -04:00
Nick Thompson
dc89c79fdc Remove unused variable. 2021-04-12 18:51:52 -04:00
Nick Thompson
be2ad7dd4b Speed up bounding interval hierarchy test. 2021-04-12 18:51:52 -04:00
Nick Thompson
bdc73333c9 Speed up UnitTestMath. 2021-04-12 18:51:52 -04:00
Nick Thompson
1b11348cc3 Reduce data size to operate on in unit tests. 2021-04-12 18:51:52 -04:00
Nick Thompson
14ccd6d98f Speed up particle density unit test. 2021-04-12 18:51:51 -04:00
Nick Thompson
134c6c3d4e Speed up CellLocator tests. 2021-04-12 18:51:51 -04:00
Nick Thompson
33993db2df Reduce runtime of unit tests. 2021-04-12 18:51:51 -04:00
Kenneth Moreland
6b144abe41 Remove virtual methods from MeshConnectivity in rendering
Virtual methods were used in the `MeshConnectivity` classes for the
internal ray casting system. However, using virtual methods in the
execution environment is being deprecated.

This change replaces the virtual object with an object containing a
`Variant`. The `Variant` holds one of the supported mesh connectivities
and selects the correct one at runtime rather than jumping into a
virtual method.
2021-04-12 15:53:36 -06:00
Nick Thompson
e64a3ce4d4 Merge topic 'add_func_2'
ff4ad96ef Do not print extra information on Kokkos and CUDA.
321571fab Make sure operator precedence is correct over macro invocation.
94a32bf64 Improve code in response to review.
568c0b5d2 Small formatting changes.
a8e25da0a Add __func__ to unit test metadata printed on failure.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@acm.org>
Merge-request: !2469
2021-04-12 17:53:04 -04:00
Li-Ta Lo
148cad2ce5 Merge branch 'master' into particle_density 2021-04-12 15:32:04 -06:00
Li-Ta Lo
7bebc1c497 Disable passing input scalar field
Inherit from FilterDataSetWithField and implemented a trivial
DoMapField whcih just return fales.
2021-04-12 14:31:27 -06:00
Nick Thompson
ff4ad96efc Do not print extra information on Kokkos and CUDA. 2021-04-12 15:01:07 -04:00
Nick Thompson
321571fabe Make sure operator precedence is correct over macro invocation. 2021-04-12 13:50:27 -04:00
Vicente Adolfo Bolea Sanchez
ff84915bc3 Merge branch 'upstream-diy' into fix-use-c++14-in-every-target
# By Diy Upstream
* upstream-diy:
  diy 2021-04-12 (bc7dcda5)
2021-04-12 13:45:01 -04:00
Nick Thompson
94a32bf64c Improve code in response to review. 2021-04-12 13:42:19 -04:00
Vicente Adolfo Bolea Sanchez
f60a45bc63 Enforce C++14 in the whole project
Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2021-04-12 13:29:46 -04:00
Nick Thompson
568c0b5d29 Small formatting changes. 2021-04-12 13:05:36 -04:00
Nick Thompson
a8e25da0ab Add __func__ to unit test metadata printed on failure. 2021-04-12 12:54:38 -04:00
Kenneth Moreland
49d6200413 Merge topic 'deprecate-variant-array-handle'
14839a032 Fix deprecation warnings with MSVC
5510521a0 Fix VariantArrayHandle::AsVirtual with cast arrays
25e6daf93 Add changelog for depreciating VariantArrayHandle
b4ef9fcac Fix UnknownArrayHandle::CastAndCall for special arrays
68f39b86a Deprecate VariantArrayHandle

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Sujin Philip <sujin.philip@kitware.com>
Merge-request: !2459
2021-04-12 10:15:08 -04:00
Nick Thompson
d4ead2d767 Remove superfluous subbraces. 2021-04-08 16:23:42 -04:00
Nick Thompson
a7ecd30cdd Commute #ifdef with braces to make clang-format happy. 2021-04-08 16:23:42 -04:00
Nick Thompson
dd8863637a Return a vec<T,2> rather than a vtkm::Pair<T,T>. 2021-04-08 16:23:42 -04:00
Nick Thompson
91bec19e97 Additional comments and fix typo in unit test. 2021-04-08 16:23:42 -04:00
Nick Thompson
6f9515aa94 Quadratic roots to 3 ulps. 2021-04-08 16:23:42 -04:00
Kenneth Moreland
14839a0325 Fix deprecation warnings with MSVC 2021-04-08 09:28:03 -06:00
Kenneth Moreland
5510521a06 Fix VariantArrayHandle::AsVirtual with cast arrays
The both the underlying `UnknownArrayHandle` and `ArrayHandleVirtual`
handle `ArrayHandleCast` specially. This caused problems when passing an
`ArrayHandleCast` to `VariantArrayHandle::AsVirtual`. Solve the problem
by stripping out the cast storage tags and letting these classes handle
it internally.

It's annoying to have to fix a problem in a method of a deprecated class
that returns another class that is deprecated for a different reason. No
one should really be running this.
2021-04-08 09:21:39 -06:00
Kenneth Moreland
b4ef9fcac3 Fix UnknownArrayHandle::CastAndCall for special arrays
`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.
2021-04-07 16:12:42 -06:00
Kenneth Moreland
68f39b86a8 Deprecate VariantArrayHandle
`VaraintArrayHandle` has been replaced by `UnknownArrayHandle` and
`UncertainArrayHandle`. Officially make it deprecated and point users to
the new implementations.
2021-04-07 16:12:38 -06:00
Nickolas Davis
21b36a6429 Merge topic 'rename-algorithms'
1c9ae402b Deprecate vtkm/BinarySearch.h, it is unused and similar to LowerBound
26d9ecb39 split vtkm/Algorithms.h into UpperBound.h, LowerBound.h, and BinarySearch.h

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@acm.org>
Merge-request: !2455
2021-04-07 17:08:34 -04:00
Li-Ta Lo
f2a4361c03 Merge topic 'alpine_sampling_2d'
ed8d2fb35 Merge branch 'master' into alpine_sampling_2d
93b8ee97d Pasing range explicitly to NDHistogram worklet for ALPINE 2D sampling milestone

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Li-Ta Lo <ollie@lanl.gov>
Merge-request: !2257
2021-04-07 16:10:09 -04:00
nadavi
1c9ae402b0 Deprecate vtkm/BinarySearch.h, it is unused and similar to LowerBound 2021-04-07 19:10:28 +00:00
nadavi
26d9ecb398 split vtkm/Algorithms.h into UpperBound.h, LowerBound.h, and BinarySearch.h 2021-04-07 18:53:09 +00:00
nadavi
7f86a16b37 add missing include 2021-04-07 17:54:34 +00:00
Nick Thompson
b00f5b4430 Merge topic 'diff_of_products'
068399b81 Fix build errors on Windows and compiler warnings on Ubuntu.
8d54138d3 Kahan's difference of products algorithm

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@acm.org>
Merge-request: !2460
2021-04-07 09:11:44 -04:00
Nick Thompson
068399b817 Fix build errors on Windows and compiler warnings on Ubuntu. 2021-04-07 08:09:39 -04:00
Nick Thompson
8d54138d3e Kahan's difference of products algorithm 2021-04-05 15:20:56 -04:00
Kenneth Moreland
294a30fd7e Check that all execution objects are trivially copyable
When the dispatcher does it's "transport" phase, it returns an
"execution object", but this object is held in the control environment
(on the host) although it may point to resources in the execution
environment (on the device). For this object to get from host to device,
it must be trivially copyable. If it is not, compile and/or runtime
errors could occur. So force this condition with a static assert.
2021-04-02 07:37:26 -06:00
Kenneth Moreland
3813fb515c Make ArrayPortalRecombineVec trivially copyable
Using this internal class is a bit tricky because it requires a pointer
to a C array that is expected to contain portals. Both the C array and
the portals must be defined for the expected device. This is already
handled by the associated Storage. Assuming all of this holds, make sure
the `ArrayPortalRecombineVec` is trivially copyable. This is a
requirement for passing objects to the execution environment.
2021-04-02 07:37:26 -06:00
Kenneth Moreland
2bd4805fe0 Merge topic 'variant-safe-punning2'
6921b5cc3 Minor style changes in UnitTestVariant
6ccb32d27 Slight comment changes
647bc94fe Reduce the number of lines required to implement Variant::CastAndCall
991eeba9f Reduce the number of lines required to implement VariantUnion
7607736ef Reduce the number of lines required to implement AllTrivially*
9816c422b Add padding to Grid struct in CellLocatorTwoLevel
e480fd7a2 Support copying a Variant to itself
d2d9ba332 Make connectivity structures trivially copyable
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2444
2021-04-01 18:04:30 -04:00
Kenneth Moreland
6921b5cc3d Minor style changes in UnitTestVariant 2021-04-01 14:47:51 -06:00
Kenneth Moreland
6ccb32d27b Slight comment changes 2021-03-31 14:35:06 -06:00
Nickolas Davis
46c2af2997 Merge topic 'remove-render-annotations'
a683a8802 add support for removing annotations and remove from regression tests

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Matt Larsen <larsen30@llnl.gov>
Merge-request: !2433
2021-03-31 15:38:56 -04:00
nadavi
a683a8802a add support for removing annotations and remove from regression tests 2021-03-31 17:08:46 +00:00
Kenneth Moreland
647bc94fed Reduce the number of lines required to implement Variant::CastAndCall 2021-03-31 09:49:40 -06:00
Kenneth Moreland
991eeba9f3 Reduce the number of lines required to implement VariantUnion 2021-03-30 14:35:44 -06:00
Kenneth Moreland
7607736ef4 Reduce the number of lines required to implement AllTrivially* 2021-03-30 14:05:53 -06:00
Kenneth Moreland
9816c422b1 Add padding to Grid struct in CellLocatorTwoLevel
There appears to be a bug in CUDA 9.2 where if you have a class that
contains a struct that itself has to have padding in the middle for
alignment purposes and you then put that class in a union with other
classes, it seems like that padding can cause problems with other
objects in the union.
2021-03-30 12:59:07 -06:00
Kenneth Moreland
e480fd7a24 Support copying a Variant to itself 2021-03-30 12:59:07 -06:00
Kenneth Moreland
d2d9ba3321 Make connectivity structures trivially copyable
It always worked to trivially copy these classes, but the compiler did
not think so because copy constructors were defined. Change these
constructors to be default so that the compler can properly check
triviality.
2021-03-30 12:59:07 -06:00
Kenneth Moreland
cad5dc7b71 Avoid is_trivially_copyable on VariantUnion
For some reason some versions of the CUDA compiler would return true for
`is_trivially_copyable` on a `VariantUnion` even when the types of the
union caused the copy constructor to get deleted.

Solve the problem by using `AllTriviallyCopyable` instead of directly
caling `is_trivially_copyable` on the union.
2021-03-30 12:58:57 -06:00
Kenneth Moreland
cb60401a63 Use specialized class instead of function overload for Variant::Get
Nvcc was having troubles resolving the return type of the overloaded
function to get a value out of a `VariantUnion`. Replace the
implementation with a class with specializations. This is more verbose,
but easier on the compiler.
2021-03-30 10:16:16 -06:00
Kenneth Moreland
c9bcdd0195 Use a union in Variant for safe type punning
Create a `VaraintUnion` that is an actual C++ `union` to store the data
in a `Variant`.

You may be asking yourself, why not just use an `std::aligned_union`
rather than a real union type? That was our first implementation, but
the problem is that the `std::aligned_union` reference needs to be
recast to the actual type. Typically you would do that with
`reinterpret_cast`. However, doing that leads to undefined behavior. The
C++ compiler assumes that 2 pointers of different types point to
different memory (even if it is clear that they are set to the same
address). That means optimizers can remove code because it "knows" that
data in one type cannot affect data in another type. To safely change
the type of an `std::aligned_union`, you really have to do an
`std::memcpy`. This is problematic for types that cannot be trivially
copied. Another problem is that we found that device compilers do not
optimize the memcpy as well as most CPU compilers. Likely, memcpy is
used much less frequently on GPU devices.
2021-03-30 10:16:16 -06:00
Kenneth Moreland
26d5168b4d Fix types used for coordinates in ArrayRangeCompute
Was using scalar types for `ArrayRangeCompute` for storage of types like
Cartesian product. It should be `Vec3` types.
2021-03-30 09:37:34 -06:00
Kenneth Moreland
eadaf06f0c Set what string in Error::SetMessage
`vtkm::cont::Error` inherits from `std::exception`. As such, it has a
special `what` string that reports an error message in a standard way.
This is particularly useful when a `vtkm::cont::Error` exception remains
uncaught because the system will print the `what` string before
crashing.

Unfortunately, the `what` string was only being set in the `Error`
constructor that took a message. That is a problem for subclasses like
`ErrorCuda` that used the default constructor and then used
`SetMessage`. The `what` string did not get set in this case.

Change the behavior to capture the stack trace in the default
constructor and update the `what` string if a subclass uses
`SetMessage`.
2021-03-29 06:04:22 -06:00
Abhishek Yenpure
43400995dd Merge topic 'particle_adv_virtuals_removal'
b316cf58f Fix compiler warnings
5f7287bc1 Removing virtuals from particle advection
2897b7a11 Fix missing include
4c781374c Removing virtuals v1

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@acm.org>
Merge-request: !2445
2021-03-25 17:26:19 -04:00
Kenneth Moreland
d1dba170e8 Do not use volatile when calling CUDA atomicCAS
Although it makes sense to assume a pointer is `volatile` when doing an
atomic operation, the arguments to the `atomicCAS` overloads take
regular pointers. The overload resolution can fail if you use the
`volatile` keyword.
2021-03-25 10:11:44 -06:00
Nickolas Davis
6f612107d0 Merge topic 'support-subdir-data-folders'
268e882c9 raise allowed num of error pixels a bit
78e3cbb50 Move regression test images into subdirs, implement io library support
d25453165 Implement additional wireframer rendering regression tests

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@acm.org>
Merge-request: !2442
2021-03-24 20:15:18 -04:00
nadavi
268e882c97 raise allowed num of error pixels a bit 2021-03-24 22:57:32 +00:00
nadavi
78e3cbb501 Move regression test images into subdirs, implement io library support 2021-03-24 22:57:32 +00:00
Abhishek Yenpure
b316cf58fc Fix compiler warnings 2021-03-24 15:51:26 -07:00
Subhashis Hazarika
ed8d2fb356 Merge branch 'master' into alpine_sampling_2d 2021-03-24 14:08:10 -06:00
Abhishek Yenpure
5f7287bc1b Removing virtuals from particle advection
-- Removing virtuals from CellInterpolationHelpers
2021-03-23 22:27:28 -07:00
Li-Ta Lo
197a9b3ff9 fixed an oversight on the correct way to get CoordinateSystem. 2021-03-23 15:31:55 +00:00
Li-Ta Lo
e95d922408 Merge topic 'particle_density_cic'
508b992cb Merge branch 'particle_density_cic' of gitlab.kitware.com:ollielo/vtk-m into particle_density_cic
056ee7269 fixed another copy paste bug
f71a01b39 Fixed misunderstanding of tolerance.
afe0a3e5f correct uncareful search and replace error
b3c6ea396 install ParticleDensityBase.h
7b8cc401c public CUDA
6796b1a45 consolidate two particle density filters
4a22f54bd Merge branch 'master' into particle_density_cic
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@acm.org>
Merge-request: !2434
2021-03-23 11:14:57 -04:00
Abhishek Yenpure
2897b7a118 Fix missing include 2021-03-22 23:53:05 -07:00
Abhishek Yenpure
4c781374c2 Removing virtuals v1
-- Remove virtuals from Integrators, Fields, Particles
-- Remaining virtuals are in the CellInterpolationHelpers
2021-03-22 23:00:36 -07:00
Matt Larsen
b64502e22d Merge topic 'identify_xl'
292ac2e4c clang is not is_trivially safe
8e588504f Merge branch 'identify_xl' of gitlab.kitware.com:mclarsen/vtk-m into identify_xl
9c5396394 Merge remote-tracking branch 'upstream/master' into identify_xl
8d8228f36 correct type in comment
4d7a08c18 add xl compiler identification

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@acm.org>
Merge-request: !2440
2021-03-20 13:00:53 -04:00
Li-Ta Lo
508b992cb4 Merge branch 'particle_density_cic' of gitlab.kitware.com:ollielo/vtk-m into particle_density_cic 2021-03-19 14:39:08 -06:00
Li-Ta Lo
056ee7269c fixed another copy paste bug 2021-03-19 12:48:51 -06:00
Li-Ta Lo
f71a01b39c Fixed misunderstanding of tolerance. 2021-03-19 14:31:01 +00:00