Commit Graph

9219 Commits

Author SHA1 Message Date
Kenneth Moreland
f768fb11bc Merge topic 'scan-extended'
35b646011 Clarify ScanExtended

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Li-Ta Lo <ollie@lanl.gov>
Merge-request: !2582
2021-09-24 16:42:04 -04:00
Vicente Bolea
546d491d46 Merge topic 'ci-fix-kokkos-version'
11bf684f3 CI: updates kokkos version

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2579
2021-09-24 10:56:20 -04:00
Vicente Adolfo Bolea Sanchez
11bf684f3c CI: updates kokkos version 2021-09-20 18:23:16 -04:00
Vicente Bolea
5c3fa80afc Merge topic 'fix-instatiations-paths'
c0eb7138c Instatiations: fix paths templates inside project

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Li-Ta Lo <ollie@lanl.gov>
Merge-request: !2583
2021-09-20 17:25:22 -04:00
Vicente Adolfo Bolea Sanchez
c0eb7138cb Instatiations: fix paths templates inside project
When VTKm is used inside another CMAKE project the instatitations will
include its filers with the relative path from the top lever of the
parent project instead of the top level of the VTKm project. This commit
resolves that.
2021-09-20 16:10:29 -04:00
Nickolas Davis
c5569012e2 Merge topic 'tbb-runtime-device-config'
166e76f66 implement tbb runtime device configuration testing
9baa7cd9f Implement tbb runtime device configuration and update vtkm to use it

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2574
2021-09-20 15:35:41 -04:00
Nickolas Davis
166e76f66a implement tbb runtime device configuration testing 2021-09-20 10:25:03 -06:00
Nickolas Davis
9baa7cd9fa Implement tbb runtime device configuration and update vtkm to use it 2021-09-20 10:24:23 -06:00
Kenneth Moreland
585ac97043 Merge topic 'consolidate-count-to-offset'
4c6522de2 Precompile ConvertNumComponentsToOffsets
b1343474c Consolidate count-to-offset algorithms

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Li-Ta Lo <ollie@lanl.gov>
Merge-request: !2580
2021-09-17 11:44:34 -04:00
Kenneth Moreland
44472f460e Merge topic 'warning-no-logging'
964ef29e0 Suppress warning when logging is turned off

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Vicente Bolea <vicente.bolea@kitware.com>
Merge-request: !2581
2021-09-17 11:35:47 -04:00
Kenneth Moreland
35b6460110 Clarify ScanExtended
Make it more clear that ScanExtended increases the array size by
1, what ranges the exclusive and inclusive scan cover, and the
features of the first and last entries.
2021-09-17 09:09:38 -06:00
Kenneth Moreland
964ef29e06 Suppress warning when logging is turned off
There was a case where a VTK-m exception was caught and then used in a
logging message. That is fine, but if VTK-m logging is turned off, that
code is removed and the exception variable goes unused.

There was a time when it was common to have logging turned off in VTK-m,
but now it is almost always on. There is one old-style dashboard that
has logging turned off and is giving a warning about this variable not
being used. It went unnoticed because the dashboard was down at the
time. This should fix the issue.
2021-09-17 05:34:26 -06:00
Nickolas Davis
b168c2003b Merge topic 'openmp-runtime-device-config'
277c33600 implement openmp runtime device configuration testing
1c4d6810a implement openmp runtime device configuration and update code to use it

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2573
2021-09-16 19:21:32 -04:00
Kenneth Moreland
4c6522de2b Precompile ConvertNumComponentsToOffsets
`ConvertNumComponentsToOffsets` has been changed to provide a pre-
compiled version for common arrays. This helps with the dual goals of
compiling less device code and allowing data set builders to not have to
use the device compiler. For cases where you need to compile
`ConvertNumComponentsToOffsets` for a different kind of array, you can
use the internal `ConvertNumComponentsToOffsetsTemplate`.
2021-09-16 14:27:14 -06:00
Kenneth Moreland
b1343474c1 Consolidate count-to-offset algorithms
For no particularly good reason, there were two functions that converted
and array of counts to an array of offsets: `ConvertNumComponentsToOffsets`
and `ConvertNumIndicesToOffsets`. These functions were identical, except
one was defined in `ArrayHandleGroupVecVariable.h` and the other was
defined in `CellSetExplicit.h`.

These two functions have been consolidated into one (which is now called
`ConvertNumComponentsToOffsets`). The consolidated function has also been
put in its own header file: `ConvertNumComponentsToOffsets.h`.

Normally, backward compatibility would be established using deprecated
features. However, one of the things being worked on is the removal of
device-specific code (e.g. `vtkm::cont::Algorithm`) from core classes like
`CellSetExplicit` so that less code needs to use the device compiler
(especially downstream code).

Part of this change removed unnecessary includes of `Algorithm.h` in
`ArrayHandleGroupVecVariable.h` and `CellSetExplicit.h`. This header had to
be added to some classes that were not including it themselves.
2021-09-16 14:24:41 -06:00
Nickolas Davis
277c336000 implement openmp runtime device configuration testing 2021-09-15 14:23:00 -06:00
Nickolas Davis
1c4d6810aa implement openmp runtime device configuration and update code to use it 2021-09-15 14:22:59 -06:00
James Kress
ff71975709 Merge topic 'Update_Threshold'
0e6228bbd Updating threshold to return all or part in range.
d28bdec48 Merge remote-tracking branch 'upstream/master'
f42d73fa0 Merge remote-tracking branch 'upstream/master'
74c4d3479 Merge remote-tracking branch 'upstream/master'

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2566
2021-09-09 13:32:52 -04:00
Kenneth Moreland
3309fe1760 Merge topic 'triangulate-single-cell-type'
4239d13b3 Make triangulate implementation more general
1bd70d9c2 Enable triangulation on CellSetSingleType

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2572
2021-09-09 08:11:28 -04:00
Kenneth Moreland
2f3a3d7e6e Merge topic 'cell-metrics-single-cell-type'
5191909b5 Fix MeshQuality to work with CellSetSingleType
ecf36ed39 Fix compile errors in CellSetSingleType::CompleteAddingCells

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2556
2021-09-08 15:11:55 -04:00
Kenneth Moreland
1797819b14 Merge topic 'example-fixes'
32870353b Remove use of deprecated items from StreamlineMPI example
264a8a4b6 Remove dependence of examples on testing files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Nickolas Davis <nadavi@sandia.gov>
Merge-request: !2571
2021-09-08 15:08:13 -04:00
Kenneth Moreland
4239d13b3e Make triangulate implementation more general
The triangulate and tetrahedra worklet implementations were for some
reason grabbing raw arrays out of `CellSetExplicit` and using those for
lookup tables. Rather than do that, simply use a
`WorkletVisitCellsWithPoints` automatically provide the values of these
cells. The advantage of this approach is that it simplifies the code and
also generalize it to cell sets that do not provide this explicit
representation. For example, the new implementation also works with
`CellSetExtrude`.
2021-09-08 12:49:11 -06:00
Kenneth Moreland
1bd70d9c22 Enable triangulation on CellSetSingleType
The code path for doing either tetrahedralization or triangulation on a
CellSetSingleType was not actually doing any work. Changed the worklet
implementation so that these work on CellSetExplicit with any template
parameters (which includes CellSetSingleType).
2021-09-08 09:53:51 -06:00
Kenneth Moreland
32870353bc Remove use of deprecated items from StreamlineMPI example 2021-09-08 08:57:13 -06:00
Kenneth Moreland
264a8a4b6c Remove dependence of examples on testing files
The testing files (even the headers) are not available if
`VTKm_ENABLE_TESTING` is off.

Mostly, the testing was used to generate example data sets. Instead,
change the examples to load data files.
2021-09-08 08:54:15 -06:00
Kenneth Moreland
c494963626 Merge topic 'arrayhandle-mutable-const'
a2a8dcdfd Allow a `const ArrayHandle` to be reallocated

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Li-Ta Lo <ollie@lanl.gov>
Merge-request: !2570
2021-09-02 19:39:57 -04:00
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