Commit Graph

9293 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
5530d86e4a update cuda examples to use RuntimeDeviceConfiguration 2021-09-02 09:17:36 -06: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
e34eafa09b Merge topic 'mir'
52ae3e4de Adding missing header
57711cab8 Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into mir
c64bf9b3d removing wrong fix that added additional errors
c13ed21ef Fixing failing CUDA test 32bit IDs 64bit Floats
e53f419f4 Fixing failing CUDA test 32bit IDs 64bit Floats
816c29eda Adding missing header VectorAnalysis
da19ea2ee Removing unnecessesary header ImplicitFunctionHandle
b185944d3 Adding fixes from Ken's review
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2550
2021-09-01 16:09:56 -04: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
3f888b4ba1 Merge topic 'no-error-on-cast-map-fail'
546dd608e Suppress exception when mapping field of unknown type

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Abhishek Yenpure <abhishek@uoregon.edu>
Merge-request: !2567
2021-09-01 08:15:56 -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
Kenneth Moreland
9d79bdaf0b Merge topic 'cuda-shared-no-virtual'
d348b1118 Enable shared CUDA builds when not compiling virtuals
a6c4e8479 KOKKOS: resolved issue with KOKKOS_LAMBDA

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2487
2021-08-24 22:51:23 -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
ca4ae322d4 Merge topic 'update-license-date'
67fbcc49a Update the date on the license

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2560
2021-08-23 15:15:09 -04:00
Kenneth Moreland
67fbcc49a3 Update the date on the license
Also add a note to the release instructions to update the license
file on each release.
2021-08-23 12:51:52 -06:00
Kenneth Moreland
0855de1b47 Collect the get methods for Field in the header definition 2021-08-23 11:11:01 -06:00
Kenneth Moreland
4e764be361 Merge topic 'bad-rdc-condition'
c89d70934 Fix condition in RuntimeDeviceConfiguration

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2559
2021-08-23 12:28:37 -04: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
James
d28bdec48d Merge remote-tracking branch 'upstream/master' 2021-08-19 12:23:17 -04: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 Bolea
675cdfe959 Merge topic 'ci-provide-cmake'
5353934e6 CI: Add Junit support
4b6175980 CI: download/install cmake in each build

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !2537
2021-08-17 16:58:26 -04:00
Vicente Bolea
d3ca53bc11 Merge topic 'change-doxygen-rsync-path'
5cd911589 CI: edits doxygen rsync path

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2557
2021-08-16 14:37:48 -04:00
Vicente Bolea
3fa59aeb72 Merge topic 'add-cmake-instantiatior'
b6fc78363 Filters: Add cmake instantiations generator
0b5e3e786 CI: Remove warnings of CUDA & use attributes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2524
2021-08-14 14:48:54 -04: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
5cd911589d CI: edits doxygen rsync path
Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2021-08-14 13:28:17 -04:00
Vicente Adolfo Bolea Sanchez
5353934e6b CI: Add Junit support
Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2021-08-12 19:35:39 -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
Vicente Adolfo Bolea Sanchez
4b6175980c CI: download/install cmake in each build
Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2021-08-12 19:19:17 -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
Li-Ta Lo
b9f55e5639 Merge topic 'mk_config'
e7db8ef72 add build/config to the list of file to be packed for windows
a5f40f7a7 add build/config to the list of file to be packed
c6e06d45b more trial
167afd89d move configure_file after configure_package_config_file
e5338b60e how about the other
6cd30dac9 restore install of vtkm_config.mk
4f699218a temporary disable config files
ecf27e06a Merge branch 'master' into mk_config
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Matt Larsen <larsen30@llnl.gov>
Merge-request: !2536
2021-08-11 12:20:06 -04: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