Commit Graph

543 Commits

Author SHA1 Message Date
Kenneth Moreland
124f08381b Added ListReduce, ListAll, and ListAny
These new features to VTK-m lists allow you to compute a single value
from a list. `ListReduce` allows you to compute a value based on a
predicate. `ListAll` and `ListAny` use this feature to determine if all
or any of a list of `true_type` or `false_type` objects are true.
2022-03-08 06:53:05 -07:00
Kenneth Moreland
18c4b3258b Remove brigand from List.h
The brigand third party library has become more problematic as we move
forward. Replace the use of brigand in List.h with our own
implementation.
2022-02-03 11:53:27 -07:00
Vicente Bolea
ad11b198fd Merge topic 'update-to-v1.7.1'
bac755992 1.7.1 is our 11th official release of VTK-m.
6463a8c0b Add release notes for 1.7.1

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2690
2022-01-31 13:39:35 -05:00
Kenneth Moreland
45e9b7fa76 Merge topic 'vectraits-range'
ca032801a Allow ArrayExtractComponent to work with Vec-like value types
f48b4b761 Add implementation of VecTraits for Range and Bounds

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Gunther Weber <ghweber@lbl.gov>
Merge-request: !2683
2022-01-31 10:15:12 -05:00
Vicente Adolfo Bolea Sanchez
6463a8c0b7 Add release notes for 1.7.1 2022-01-28 18:16:04 -05:00
Kenneth Moreland
5bd60a0b77 Add CreateResult to NewFilter and absorb field mapping
The original version of `Filter` classes had a helper header file named
`CreateResult.h` that had several forms of a `CreateResult` function that
helped correctly create the `DataSet` to be returned from a filter's
`DoExecute`. With the move to the `NewFilter` structure, these functions
did not line up very well with how `DataSet`s should actually be created.

A replacement for these functions have been added as protected helper
methods to `NewFilter` and `NewFilterField`. In addition to moving them
into the filter themselves, the behavior of `CreateResult` has been merged
with the map field to output functionality. The original implementation of
`Filter` did this mapping internally in a different step. The first design
of `NewFilter` required the filter implementer to call a
`MapFieldsOntoOutput` themselves. This new implementation wraps the
functionality of `CreateResult` and `MapFieldsOntoOutput` together so that
the `DataSet` will be created correctly with a single call to
`CreateResult`. This makes it easier to correctly create the output.
2022-01-27 13:27:39 -07:00
Kenneth Moreland
f48b4b761e Add implementation of VecTraits for Range and Bounds
Added specializations of `vtkm::VecTraits` for the simple structures of
`vtkm::Range` and `vtkm::Bounds`. This expands the support for using
these structures in things like `ArrayHandle` and `UnknownArrayHandle`.
2022-01-25 10:55:35 -07:00
Kenneth Moreland
00609b0af2 Make ArrayCopy not depend on a device compiler
Rather than require `ArrayCopy` to create special versions of copy for
all arrays, use a precompiled versions. This should speed up compiles,
reduce the amount of code being generated, and require the device
compiler on fewer source files.

There are some cases where you still need to copy arrays that are not
well supported by the precompiled versions in `ArrayCopy`. (It will
always work, but the fallback is very slow.) In this case, you will want
to switch over to `ArrayCopyDevice`, which has the old behavior.
2022-01-24 12:17:23 -07:00
Kenneth Moreland
e8a6d37190 Merge topic 'allocate-and-fill'
d7b4390d1 Specify end position when filling values in Buffer
7a4cbaf10 Suggestions during review by Gunther Weber
8e4fb7ebd Suppress unhelpful nvcc warning
bacca0693 Add Fill method for non-standard Storage
9da66ff32 Prefer ArrayHandle::Fill over Algorithm::Fill
f79cf1d5f Add BitField::Fill and BitField::AllocateAndFill
926164049 Add Fill and AllocateAndFill to ArrayHandle
0cf996f41 Add ability to fill values in a Buffer

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2660
2022-01-13 17:15:37 -05:00
Li-Ta Lo
e5639b1f91 Merge topic 'NewFilter'
0801b2423 add newline
c9b8a31b5 add NewFilterField.cxx so EXPORT_CORE would work
548df8436 add CORE_EXPORT
9ff52a98c Set default ActiveCoordinateSystemIndex to 0.
90992406f Merge branch 'NewFilter' of gitlab.kitware.com:ollielo/vtk-m into NewFilter
4a63b745a uniform treatment of primary/secondary field/coordinate_system
6461857e4 Merge branch 'master' into NewFilter
3720006d0 change based on code review
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2648
2022-01-06 09:31:25 -05:00
Kenneth Moreland
de14629c1f Merge topic 'render-test-improvements'
1981f9061 Add secondary image for MapperConnectivity test
d4d1ef955 Add secondary image for MapperQuad test
54c1a85d0 Reduce templating in RenderTest code
c0fbe5f30 Remove antiquated templated render test functions
0fe9300ee Expand test_equal_images
12e116417 Redefine RenderTest interface for library
afa8c9082 Add struct for passing options to render tests
9173d6bba Rename RegressionTests to RenderTests
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Nickolas Davis <nadavi@sandia.gov>
Merge-request: !2657
2022-01-04 14:54:31 -05:00
Kenneth Moreland
f79cf1d5f7 Add BitField::Fill and BitField::AllocateAndFill 2022-01-04 08:50:57 -07:00
Kenneth Moreland
926164049f Add Fill and AllocateAndFill to ArrayHandle
These allow you to create an `ArrayHandle` filled with an inital value
without having to compile code for the device.
2022-01-04 08:50:57 -07:00
Li-Ta Lo
6461857e4e Merge branch 'master' into NewFilter 2022-01-04 07:54:04 -07:00
Kenneth Moreland
5b34e6f70b Better fallback for ArrayGetValue
To avoid having to use a device compiler every time you wish to use
`ArrayGetValue`, the actual implementation is compiled into the `vtkm_cont`
library. To allow this to work for all the templated versions of
`ArrayHandle`, the implementation uses the extract component features of
`UnknownArrayHandle`. This works for most common arrays, but not all
arrays.

For arrays that cannot be directly represented by an `ArrayHandleStride`,
the fallback is bad. The entire array has to be pulled to the host and then
copied serially to a basic array.

For `ArrayGetValue`, this is just silly. So, for arrays that cannot be
simply represented by `ArrayHandleStride`, make a fallback that just uses
`ReadPortal` to get the data. Often this is not the most efficient method,
but it is better than the current alternative.
2022-01-03 10:08:39 -07:00
Kenneth Moreland
0fe9300eed Expand test_equal_images
The `test_equal_images` function has been expanded to supply the
generated image in a `Canvas` or a `DataSet` in addition to a `View`.
Much of the templating code has been removed from `test_equal_images`
and most of the code has moved into the `vtkm_rendering_testing`
library.
2021-12-30 10:53:30 -07:00
Kenneth Moreland
12e1164179 Redefine RenderTest interface for library
The previous functions that enabled the render regression tests were
heavily templated, which required every test using rendering to
recompile the entire rendering system being used. Changed the interface
to not rely on templating so that the RenderTest method can be moved
into a library.

Also moved the options into a struct where they can be better managed.
The render testing functions tended to have lots of arguments that were
difficult to manage. Instead, created a single `struct` that holds all
the potential options. That way when someone specifies on option, it is
clear what option is being set.
2021-12-30 10:53:23 -07:00
Vicente Bolea
385ea820be Merge topic 'add-olcf-ci'
67b92d336 ci: Add OLCF GitLab-CI

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2638
2021-12-17 10:51:37 -05:00
Kenneth Moreland
d7a4e0d757 Merge topic 'unknown-cell-set'
1dc3d145a Allow `UnknownCellSet::Cast` return a reference
030ac1fff Fix some copy/paste errors with comments and variable names
4cb392ca2 Make DynamicCellSet directly an UnknownCellSet
6da5aa456 Replace DynamicCellSet implementation with UnknownCellSet
ac024587a Add UncertainCellSet

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Li-Ta Lo <ollie@lanl.gov>
Merge-request: !2647
2021-12-17 09:44:53 -05:00
Kenneth Moreland
4204e4455e Add changelog for perline noise generator 2021-12-16 09:46:01 -07:00
Li-Ta Lo
a3c4460077 add changelog 2021-12-15 16:29:38 -07:00
Kenneth Moreland
ac024587a6 Add UncertainCellSet
This is a replacement for DynamicCellSet that requires less templating.
2021-12-15 12:59:18 -07:00
Vicente Adolfo Bolea Sanchez
67b92d3365 ci: Add OLCF GitLab-CI
Co-authored-by: Vicente Bolea <vicente.bolea@kitware.com>
Co-authored-by: Chuck Atkins <chuck.atkins@kitware.com
2021-12-15 13:00:47 -05:00
Li-Ta Lo
06428e2bc7 Merge topic 'NewFilter'
ba2a710e7 Update NewFitlerInterface.md
1469d34b4 rename DoExecutePartitions
74905a05c use new header file
161391656 Add ChangeLog
0e3cc8076 restore deprecated filter::GenerateIds
130d0d9df Updated Doxygen comments
8cf02d363 New Filter Interface Design

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2641
2021-12-13 16:33:11 -05:00
Li-Ta Lo
ba2a710e7f Update NewFitlerInterface.md 2021-12-13 16:31:29 -05:00
Li-Ta Lo
1469d34b43 rename DoExecutePartitions 2021-12-13 12:17:15 -07:00
Li-Ta Lo
161391656a Add ChangeLog 2021-12-13 09:28:20 -07:00
Dave Pugmire
4177f6697a Remove blank line at top of script. 2021-12-08 14:40:51 -05:00
Dave Pugmire
7c975497a3 Updates to build recipe. 2021-12-08 14:18:08 -05:00
Dave Pugmire
924a69d24c Update text for build. 2021-12-08 14:16:12 -05:00
Dave Pugmire
de335b0032 Add build instructions for Spock. 2021-12-08 14:13:59 -05:00
Vicente Adolfo Bolea Sanchez
555013cdda CMAKE: add unity builds support 2021-11-10 15:03:11 -05:00
Vicente Adolfo Bolea Sanchez
9ae4a3ed79 Add release notes for 1.7.0-rc1 2021-10-21 13:08:40 -04:00
Abhishek Yenpure
39934257cb Merge topic 'cell-velocity-field'
5109ba2a7 Adding changelog for cell centered velocities
4e9220ddd Removing unnecessary header
3237c58c2 Updating particle advection filters to use field associativity
79bb38c2b Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into cell-velocity-field
a11d9ad10 removing print statements
e28476df5 Assigning default associativity for velocity field
53167f076 Fix Field constructors
e6fa5fd4b Fixing Field class
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2588
2021-10-18 13:00:07 -04:00
Li-Ta Lo
81fe1254ea Merge branch 'master' into vtkm_io_sans_device_source 2021-10-15 19:10:40 -06:00
Abhishek Yenpure
5109ba2a7d Adding changelog for cell centered velocities 2021-10-15 09:19:12 -07:00
Li-Ta Lo
2c33a23d39 added changelog 2021-10-14 16:42:24 -06:00
Sujin Philip
02f0a809fb Merge topic 'probe-point-fields-changelog'
9deb36132 Add release notes for commit abedf61e5cbfaee4abac

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Vicente Bolea <vicente.bolea@kitware.com>
Merge-request: !2603
2021-10-14 08:29:18 -04:00
Sujin Philip
9deb36132b Add release notes for commit abedf61e5cbfaee4abac 2021-10-12 17:41:57 -04:00
Kenneth Moreland
8f1c453c0b Support writing binary files to legacy VTK files
The legacy VTK file writer writes out in ASCII. This is helpful when a
human is trying to read the file. However, if you have more than a
trivial amount of data, the file can get impractically large. To get
around this, `VTKDataSetWriter` now has a flag that allows you to write
the data in binary format.
2021-10-11 13:08:59 -06:00
Kenneth Moreland
ae3c7c096b Merge topic 'source-field-names'
03a4750a3 Change Oscillator output field name to oscillating
a3462b41c Change Wavelet output field name to RTData
ea1a55359 Name tangle source fields appropriately
a68422d45 Add GenerateIds filter

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Li-Ta Lo <ollie@lanl.gov>
Merge-request: !2595
2021-10-05 10:59:48 -04:00
Kenneth Moreland
03a4750a3f Change Oscillator output field name to oscillating 2021-10-05 08:20:27 -06:00
Kenneth Moreland
a68422d454 Add GenerateIds filter
This filter adds a pair of fields to a `DataSet` which mirror the
indices of the points and cells, respectively. These fields are useful
for tracking the provenance of the elements of a `DataSet` as it gets
manipulated by the filters. It is also convenient for adding indices to
operations designed for fields and for testing purposes.
2021-10-04 13:44:18 -06:00
Kenneth Moreland
d1160638b7 Add copy methods to UnknownArrayHandle
`vtkm::cont::UnknownArrayHandle` now provides a set of method that
allows you to copy data from one `UnknownArrayHandle` to another. The
first method, `DeepCopyFrom`, takes a source `UnknownArrayHandle` and
deep copies the data to the called one. If the `UnknownArrayHandle`
already points to a real `ArrayHandle`, the data is copied into that
`ArrayHandle`. If the `UnknownArrayHandle` does not point to an existing
`ArrayHandle`, then a new `ArrayHandleBasic` with the same value type as
the source is created and copied into.

The second method, `CopyShallowIfPossibleFrom` behaves similarly to
`DeepCopyFrom` except that it will perform a shallow copy if possible.
That is, if the target `UnknownArrayHandle` points to an `ArrayHandle`
of the same type as the source `UnknownArrayHandle`, then a shallow copy
occurs and the underlying `ArrayHandle` will point to the source. If the
types differ, then a deep copy is performed. If the target
`UnknownArrayHandle` does not point to an `ArrayHandle`, then the
behavior is the same as the `=` operator.

One of the intentions of these new methods is to allow you to copy
arrays without using a device compiler (e.g. `nvcc`). Calling
`ArrayCopy` requires you to include the `ArrayCopy.h` header file, and
that in turn requires device adapter algorithms. These methods insulate
you from these.
2021-09-28 10:46:58 -06:00
Kenneth Moreland
36352912bc Support scatter/mask for CellSetExtrude
Scheduling topology map workets for `CellSetExtrude` always worked, but
the there were indexing problems when a `Scatter` or a `Mask` was used.
This has been corrected, and now `Scatter`s and `Mask`s are supported on
topology maps on `CellSetExtrude`.
2021-09-27 13:27:02 -06:00
Kenneth Moreland
e74c0732c5 Compile reverse connectivity builder into vtkm_cont library
Because `CellSetExplicit` is a templated class, the implementation of
most of its features is part of the header files. One of the things that
was included was the code to build the reverse connectivity links. That
is, it figured out which cells were incident on each point using the
standard connections of which points comprise which cells.

Of course, building these links is non-trivial, and it used multiple
DPPs to engage the device. It meant that header had to include the
device adapter algorithms and therefore required a device compiler. We
want to minimize this where possible.

To get around this issue, a non-templated function was added to find the
reverse connections of a `CellSetExplicit`. It does this by passing in
`UnknownArrayHandle`s for the input arrays. (The output visit-points-
with-cells arrays are standard across all template instances.) The
implementation first iterates over all `CellSetExplicit` versions in
`VTKM_DEFAULT_CELL_SETS` and attempts to retrieve arrays of those types.
In the unlikely event that none of these arrays work, it copies the data
to `ArrayHandle<vtkm::Id>` and uses those.
2021-09-17 09:48:21 -06: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
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
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
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
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
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
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
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
Kenneth Moreland
fc58f4edc6 Turn on CUDA warnings for unknown stack sizes
These were previously suppressed because they are unavoidable when
calling virtual methods. But we no longer support virtual methods on
devices (it is deprecated).

These warnings can still happen if you have unbounded recursion. But we
would like to avoid unbounded recursion, so we would like to see these
warnings.

Also turned on other nvlink warnings, which include when a recursive
function call means that the compiler cannot figure out the full
stack depth.
2021-08-02 09:50:41 -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
Vicente Adolfo Bolea Sanchez
81076385f7 DOCS: add GitLab issue template new-release.md
It updates the ReleaseProcess.md document to describe our bi-branchial
workflow composed by a release branch and master branch

It also adds ReleaseHotFix.md which describes how to perform a HotFix
onto master/release branch.

Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2021-06-18 19:59:01 -04:00
Kenneth Moreland
25e6daf93f Add changelog for depreciating VariantArrayHandle 2021-04-07 16:12:42 -06:00
Vicente Adolfo Bolea Sanchez
19c1b99f18 1.6.0-rc1 is our 7th official release of VTK-m.
The major changes to VTK-m from 1.5.1 can be found in:
  docs/changelog/1.6.0/release-notes.md

Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2021-04-06 18:28:53 -04:00
Vicente Adolfo Bolea Sanchez
4e94d830a9 Add release notes for v1.6.0 2021-04-02 16:33:45 -04:00
Vicente Adolfo Bolea Sanchez
9d345733bf Merge commit 'd2d1c854adc8c0518802f153b48afd17646b6252' into update-to-1.6.0-rc1
* commit 'd2d1c854adc8c0518802f153b48afd17646b6252': (1346 commits)
  extend the default clipping plane
  Fix unintended cast in TBB Reduce's return value
  follow coding conventions
  make scalar normilization consistent across rendering
  correct a potential divide by zero
  Do not assume CUDA reduce operator is unary
  Fix casting issues in TBB functors
  Add casts to FunctorsGeneral.h
  Allow for different types in basic type operators
  kick the builds
  Cleanup per review.
  Fixes per review
  Add ArrayHandleSOA to default
  Disallow references in Variant
  Be more conservative about is_trivial support
  Removed two TODO comments after verifying parameters
  Port bug fix from distributed to augmented contour tree filter
  Fix hang in distributed contour tree
  more missing sstream headers
  add another missing header
  ...
2021-04-02 16:32:05 -04:00
Kenneth Moreland
75597e240b Merge topic 'array-range-compute-unknown'
04f020ae6 Update Field to use new ArrayRangeCompute features
2a41428fe Add implementation of ArrayRangeCompute for UnknownArrayHandle

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Sujin Philip <sujin.philip@kitware.com>
Merge-request: !2409
2021-02-17 15:43:53 -05:00
Kenneth Moreland
b9430c52e6 Create ArrayHandleOffsetsToNumComponents
This is a fancy array that takes an array of offsets and converts it to
an array of the number of components for each packed entry.

This replaces the use of `ArrayHandleDecorator` in `CellSetExplicit`.
The two implementation should do the same thing, but the new
`ArrayHandleOffsetsToNumComponents` should be less complex for
compilers.
2021-02-17 10:44:47 -07:00
Kenneth Moreland
2a41428fe4 Add implementation of ArrayRangeCompute for UnknownArrayHandle
This allows you to easily compute the range of any ArrayHandle, even if
you don't know the type.

A unit test for ArrayRangeCompute was also added.
2021-02-17 09:18:31 -07:00
Kenneth Moreland
fa4da95eb2 Add changelog for copying UnknownArrayHandle 2021-02-02 17:34:12 -07:00
Kenneth Moreland
a6edc832da Merge topic 'soa-array-default'
cecd81d5d Add types appropriate for Ascent
865855ea0 Add changelog for making ArrayHandleSOA a default array
50ff9c22a Add support of `ArrayHandleSOA` as a default storage type
bc09a9cd1 Add precompiled versions of `ArrayRangeCompute` for `ArrayHandleSOA`
77f9ae653 Support `ArrayHandleSOA` only for `Vec` value types

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2349
2021-01-14 12:40:58 -05:00
Kenneth Moreland
06c59fed13 Update MapFieldMergeAverage/Permuation to use new CastAndCall
These functions now use
`UnknownArrayHandle::CastAndCallWithExtractedArray` to reduce the number
of times the worklet is run.
2021-01-13 09:19:33 -07:00
Kenneth Moreland
865855ea02 Add changelog for making ArrayHandleSOA a default array 2021-01-06 13:20:59 -07:00
Kenneth Moreland
439c18cfc0 Add changedoc for ArrayHandleRecombineVec 2021-01-04 15:10:18 -07:00
Kenneth Moreland
8dfd019423 Add changelog for extract component 2020-12-16 17:23:35 -07:00
Kenneth Moreland
0ab3edd87d Add VecFlat class
`vtkm::VecFlat` is a wrapper around a `Vec`-like class that may be a
nested series of vectors. For example, if you run a gradient operation
on a vector field, you are probably going to get a `Vec` of `Vec`s that
looks something like `vtkm::Vec<vtkm::Vec<vtkm::Float32, 3>, 3>`. That
is fine, but what if you want to treat the result simply as a `Vec` of
size 9?

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

There is a `vtkm::make_VecFlat` convenience function that takes an
object and returns a `vtkm::VecFlat` wrapped around it.
2020-12-16 17:22:44 -07:00
Kenneth Moreland
1df732cdb3 Add changedocs for removing ArrayTransfer 2020-12-08 15:22:07 -07:00
Robert Maynard
dfe63ddc05 CI-README: Correct how to compile VTK-m with CI's image settings 2020-11-18 11:14:36 -05:00
Robert Maynard
9bd6f3e6da Disable VTKM_ASSERT when using HIP 2020-09-25 11:06:57 -04:00
Robert Maynard
2278fdfd94 Deprecation macro has to come before VTKM_EXEC or VTKM_EXEC_CONT
This order is needed by CUDA-clang and HIP-clang compilers
2020-09-23 10:02:37 -04:00
Kenneth Moreland
cd08fd4995 Add changelog for removing virtual methods
The changelog is not quite accurate because it is claiming that all
virtual methods are removed when that is not quite the case.
Hopefully soon the changelog text will be accurate.
2020-09-04 22:52:45 -06:00
Kenneth Moreland
94aa6449b9 Add UncertainArrayHandle 2020-08-31 09:46:57 -06:00
Kenneth Moreland
ebbebd7369 Add atomic free functions
Previously, all atomic functions were stored in classes named
`AtomicInterfaceControl` and `AtomicInterfaceExecution`, which required
you to know at compile time which device was using the methods. That in
turn means that anything using an atomic needed to be templated on the
device it is running on.

That can be a big hassle (and is problematic for some code structure).
Instead, these methods are moved to free functions in the `vtkm`
namespace. These functions operate like those in `Math.h`. Using
compiler directives, an appropriate version of the function is compiled
for the current device the compiler is using.
2020-08-20 13:40:43 -06:00
Sujin Philip
452f61e290 Add Kokkos backend 2020-08-12 13:55:24 -04:00
Robert Maynard
6fa170ae60 Update gitlab ci to make sure CUDA builds occur with CUDA runtime
The CUDA runtime is required so that linking occurs correctly
2020-08-11 16:33:40 -04:00
Robert Maynard
f22dd9f571 Allow VTK-m Buffer to have ownership transferred 2020-08-06 10:31:57 -04:00
Vicente Bolea
922a570703 Merge topic 'fix-515-vtkdatasetwriter-remove-justpoints'
ab0fecda7 VTKDataSetWriter: remove just_points argument

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2185
2020-07-28 20:26:37 -04:00
Vicente Adolfo Bolea Sanchez
ab0fecda7f VTKDataSetWriter: remove just_points argument
Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2020-07-24 15:54:13 -04:00
Kenneth Moreland
d1a4aecc59 Improvements to moving data into ArrayHandle
We have made several improvements to adding data into an `ArrayHandle`.

## Moving data from an `std::vector`

For numerous reasons, it is convenient to define data in a `std::vector`
and then wrap that into an `ArrayHandle`. It is often the case that an
`std::vector` is filled and then becomes unused once it is converted to an
`ArrayHandle`. In this case, what we really want is to pass the data off to
the `ArrayHandle` so that the `ArrayHandle` is now managing the data and
not the `std::vector`.

C++11 has a mechanism to do this: move semantics. You can now pass
variables to functions as an "rvalue" (right-hand value). When something is
passed as an rvalue, it can pull state out of that variable and move it
somewhere else. `std::vector` implements this movement so that an rvalue
can be moved to another `std::vector` without actually copying the data.
`make_ArrayHandle` now also takes advantage of this feature to move rvalue
`std::vector`s.

There is a special form of `make_ArrayHandle` named `make_ArrayHandleMove`
that takes an rvalue. There is also a special overload of
`make_ArrayHandle` itself that handles an rvalue `vector`. (However, using
the explicit move version is better if you want to make sure the data is
actually moved.)

## Make `ArrayHandle` from initalizer list

A common use case for using `std::vector` (particularly in our unit tests)
is to quickly add an initalizer list into an `ArrayHandle`. Now you can
by simply passing an initializer list to `make_ArrayHandle`.

## Deprecated `make_ArrayHandle` with default shallow copy

For historical reasons, passing an `std::vector` or a pointer to
`make_ArrayHandle` does a shallow copy (i.e. `CopyFlag` defaults to `Off`).
Although more efficient, this mode is inherintly unsafe, and making it the
default is asking for trouble.

To combat this, calling `make_ArrayHandle` without a copy flag is
deprecated. In this way, if you wish to do the faster but more unsafe
creation of an `ArrayHandle` you should explicitly express that.

This requried quite a few changes through the VTK-m source (particularly in
the tests).

## Similar changes to `Field`

`vtkm::cont::Field` has a `make_Field` helper function that is similar to
`make_ArrayHandle`. It also features the ability to create fields from
`std::vector`s and C arrays. It also likewise had the same unsafe behavior
by default of not copying from the source of the arrays.

That behavior has similarly been depreciated. You now have to specify a
copy flag.

The ability to construct a `Field` from an initializer list of values has
also been added.
2020-07-23 10:53:38 -06:00
Kenneth Moreland
453e314044 Deprecate ArrayHandleVirtualCoordinates
We are in the process of deprecating virtual classes in VTK-m
(that run in the execution environment).
2020-07-14 08:51:47 -06:00
Kenneth Moreland
058927c82f Write uniform and rectilinear grids to legacy VTK files
As a programming convenience, all `vtkm::cont::DataSet` written by
`vtkm::io::VTKDataSetWriter` were written as a structured grid. Although
technically correct, it changed the structure of the data. This meant that
if you wanted to capture data to run elsewhere, it would run as a different
data type. This was particularly frustrating if the data of that structure
was causing problems and you wanted to debug it.

Now, `VTKDataSetWriter` checks the type of the `CoordinateSystem` to
determine whether the data should be written out as `STRUCTURED_POINTS`
(i.e. a uniform grid), `RECTILINEAR_GRID`, or `STRUCTURED_GRID`
(curvilinear).
2020-07-08 19:12:14 -06:00
Kenneth Moreland
56bec1dd7b Replace basic ArrayHandle implementation to use Buffers
This encapsulates a lot of the required memory management into the
Buffer object and related code.

Many now unneeded classes were deleted.
2020-06-25 14:02:26 -06:00
Robert Maynard
f6c3132268 Merge topic 'remove_ecp_nm_gitlab'
aaaa748ff Remove New Mexico Consortium CI as hardware has been removed

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2158
2020-06-24 08:56:47 -04:00
Kenneth Moreland
270ba214d5 Disable asserts for CUDA architecture builds
`assert` is supported on recent CUDA cards, but compiling it appears to be
very slow. By default, the `VTKM_ASSERT` macro has been disabled whenever
compiling for a CUDA device (i.e. when `__CUDA_ARCH__` is defined).

Asserts for CUDA devices can be turned back on by turning the
`VTKm_NO_ASSERT_CUDA` CMake variable off. Turning this CMake variable off
will enable assertions in CUDA kernels unless there is another reason
turning off all asserts (such as a release build).
2020-06-22 13:54:22 -06:00
Robert Maynard
aaaa748ffd Remove New Mexico Consortium CI as hardware has been removed
ECP is no longer offering CI via NMC, so we can now remove the
infrastructure we used for that.

See merge request 2115 for how we are adding gitlab-ci at OLCF
2020-06-22 15:14:20 -04:00
Kenneth Moreland
22f227a91e Merge topic 'ordered-async-access'
de3bda373 Use deque instead of list for ArrayHandle queue
498d44548 Pass Token::Reference by value
c32c9e8e8 Fix deadlock when changing device during read
99e14ab8a Add proper enqueuing of Tokens for ArrayHandle

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2130
2020-06-11 21:55:27 -04:00
Li-Ta Lo
c04b8440eb Merge topic 'uniform_real'
c0dee7402 make it explicit that we are using 64-bit unsigned integer in bit op
34f350588 Added changelog
e9f584a91 ArrayHandleRandomUniformReal

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !2116
2020-06-11 08:41:38 -04:00
Kenneth Moreland
99e14ab8a6 Add proper enqueuing of Tokens for ArrayHandle
An issue that was identified for the thread safety of `ArrayHandle` is
that if several threads are waiting to use an `ArrayHandle`, there might
be an expectation of the order in which the operations happen. For
example, if one thread is modifying the contents of an `ArrayHandle` and
another is reading those results, we would need the first one to start
before the second one.

To solve this, a queue is added to `ArrayHandle` such that when waiting
to read or write an `ArrayHandle` the `Token` has to be at the top of
the queue in addition to other requirements being met.

Additionally, an `Enqueue` method is added to add a `Token` to the queue
without blocking. This allows a control thread to queue the access and
then spawn a thread where the actual work will be done. As long as
everything is enqueued on the main thread, the operations will happen in
the expected order.
2020-06-08 16:49:02 -06:00
Kenneth Moreland
7be44c847f Enable setting invalid value in probe filter
Initially, the probe filter would simply not set a value if a sample was
outside the input `DataSet`. This is not great as the memory could be
left uninitalized and lead to unpredictable results. The testing
compared these invalid results to 0, which seemed to work but is
probably unstable.

This was partially fixed by a previous change that consolidated to
mapping of cell data with a general routine that permuted data. However,
the fix did not extend to point data in the input, and it was not
possible to specify a particular invalid value.

This change specifically updates the probe filter so that invalid values
are set to a user-specified value.
2020-06-03 15:29:37 -06:00
Li-Ta Lo
34f3505885 Added changelog 2020-06-03 10:15:00 -06:00
NAThompson
f33578d6f6 Add newline to docs file. 2020-05-27 16:29:20 -04:00
NAThompson
fe4f71ab92 Deprecate DataSetFieldAdd. 2020-05-27 15:27:47 -04:00
Ben Boeckel
0488aab201 docs: update gitlab links to include /-/ component 2020-05-26 14:48:49 -04:00
Kenneth Moreland
d4ff67a226 Merge topic 'deprecate-execute-with-policy'
544a078cd Remove use of deprecated policies in examples
06f5119c2 Fix deprecation warning
f29a4712b Correct field types for ComputeMoments filter
a20ec03d0 Disable proxies in filter benchmark
72cd0107e Deprecate Execute with policy

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2093
2020-05-20 18:28:37 -04:00
Kenneth Moreland
dce576bd11 Add BOVDataSetReader implementation to vtkm_io 2020-05-19 14:33:45 -06:00
Kenneth Moreland
086439e71e Update variants of VTKDataSetReaders to compile into vtkm_io 2020-05-19 13:04:12 -06:00
Kenneth Moreland
569adda002 Update changelogs
There have been several new features that were merged without
appropriate documentation in the changelogs. This adds some
new changelogs for some of these new features.
2020-05-19 10:37:36 -06:00
Kenneth Moreland
72cd0107ee Deprecate Execute with policy
The version of `Filter::Execute` that takes a policy as an argument is now
deprecated. Filters are now able to specify their own fields and types,
which is often why you want to customize the policy for an execution. The
other reason is that you are compiling VTK-m into some other source that
uses a particular types of storage. However, there is now a mechanism in
the CMake configuration to allow you to provide a header that customizes
the "default" types used in filters. This is a much more convenient way to
compile filters for specific types.

One thing that filters were not able to do was to customize what cell sets
they allowed using. This allows filters to self-select what types of cell
sets they support (beyond simply just structured or unstructured). To
support this, the lists `SupportedCellSets`, `SupportedStructuredCellSets`,
and `SupportedUnstructuredCellSets` have been added to `Filter`. When you
apply a policy to a cell set, you now have to also provide the filter.
2020-05-18 12:38:41 -06:00
nadavi
24d022b02b Implement and test ImageReader and ImageWriter capabilities in the io library 2020-05-13 16:10:21 -06:00
NAThompson
46faf574fa ReadPortal().Get(idx) is slow in a loop. 2020-05-08 11:30:59 -04:00
NAThompson
9a68931c0b Do not add half-baked 1.6 release notes; let Robert consolidate release notes. 2020-05-01 07:31:35 -04:00
NAThompson
01b61be464 Start release notes for 1.6 2020-04-30 13:58:06 -04:00
Robert Maynard
24a264fce8 Add scripts to allow developers to replicate CI environments
To simplify reproducing docker based CI workers locally, VTK-m has python program that handles all the
work automatically for you.

The program is located in `[Utilities/CI/reproduce_ci_env.py ]` and requires python3 and pyyaml.

To use the program is really easy! The following two commands will create the `build:rhel8` gitlab-ci
worker as a docker image and setup a container just as how gitlab-ci would be before the actual
compilation of VTK-m. Instead of doing the compilation, instead you will be given an interactive shell.

```
./reproduce_ci_env.py create rhel8
./reproduce_ci_env.py run rhel8
```

To compile VTK-m from the the interactive shell you would do the following:
```
> src]# cd build/
> build]# cmake --build .
```
2020-04-09 13:54:20 -04:00
Robert Maynard
cbed21696d gitlab-ci won't trigger when just pushing remote branches
At the same time I have added the controls to allow for master only
builders which is required for nightly ubsan/asan testing
2020-03-30 09:51:45 -04:00
Robert Maynard
142d151caf Update CONTRIBUTING.md to cover gitlab piplines 2020-03-26 13:40:47 -04:00
Robert Maynard
5bc09b976e Add gitlab-ci infrastructure 2020-03-26 13:40:47 -04:00
Kenneth Moreland
dc112b5169 Enable changing policy used for library compiles
Previously, the PolicyDefault used to compile all the filters was hard-
coded. The problem was that if any external project that depends on VTK-
m needs a different policy, it had to recompile everything in its own
translation units with a custom policy.

This change allows an external project provide a simple header file that
changes the type lists used in the default policy. That allows VTK-m to
compile the filters exactly as specified by the external project.
2020-03-19 15:07:07 -06:00
Kenneth Moreland
e05588a199 Add changelog for Tuple 2020-03-16 17:12:17 -06:00
Kenneth Moreland
5773ea3e13 Add porting layer for future std features
Currently, VTK-m is using C++11. However, it is often useful to use
features in the `std` namespace that are defined for C++14 or later. We
can provide our own versions (sometimes), but it is preferable to use
the version provided by the compiler if available.

There were already some examples of defining portable versions of C++14
and C++17 classes in a `vtkmstd` namespace, but these were sprinkled
around the source code.

There is now a top level `vtkmstd` directory and in it are header files
that provide portable versions of these future C++ classes. In each
case, preprocessor macros are used to select which version of the class
to use.
2020-03-16 17:12:16 -06:00
Kenneth Moreland
10e8a4a7f9 Remove locking control ArrayPortals
Previously, when a ReadPortal or a WritePortal was returned from an
ArrayHandle, it had wrapped in it a Token that was attached to the
ArrayHandle. This Token would prevent other reads and writes from the
ArrayHandle.

This added safety in the form of making sure that the ArrayPortal was
always valid. Unfortunately, it also made deadlocks very easy. They
happened when an ArrayPortal did not leave scope immediately after use
(which is not all that uncommon).

Now, the ArrayPortal no longer locks up the ArrayHandle. Instead, when
an access happens on the ArrayPortal, it checks to make sure that
nothing has happened to the data being accessed. If it has, a fatal
error is reported to the log.
2020-03-16 07:10:10 -06:00
Vicente Adolfo Bolea Sanchez
f67dcfc3fd Add release notes for v1.5.1
Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2020-03-13 12:55:43 -04:00
Vicente Adolfo Bolea Sanchez
9d0da855b3 ConvertNumComponentsToOffsets using ScanExtented vs. ScanExclusive
This commit also:
- Removes a corner case not longer used at ArrayPortalGroupVecVariable::get
- Changes doc regarding the number of offset elements in the input
  array handler of ConvertNumComponentsToOffsets.
- Updates invokation of make_ArrayGroupVectVariable in multiple files
- Adds its corresponding changelog entry
2020-03-05 10:57:34 -05:00
Robert Maynard
aa820aecc3 Add changelog for mask and scatter 3d scheduling support 2020-02-27 08:25:54 -05:00
Kenneth Moreland
6b089be03e Add ArrayPortalToken object and implement Read/WritePortal
To get a portal to access ArrayHandle values in the control
environment, you now use the ReadPortal and WritePortal methods.
The portals returned are wrapped in an ArrayPortalToken object
so that the data between the portal and the ArrayHandle are
guaranteed to be consistent.
2020-02-26 13:10:37 -07:00
Kenneth Moreland
1149a0f7fb Add change log for scoping tokens 2020-02-25 09:39:26 -07:00
Robert Maynard
7a6430e3d8 Add CODEOWNERS to vtk-m to improve merge request reviewer suggestions 2020-02-11 12:53:07 -05:00
Allison Vacanti
539f6e5ad7 Port benchmarking framework to Google Benchmark. 2020-01-08 10:58:51 -05:00
Kenneth Moreland
4a52a3f7a9 Shorter StorageTag for ArrayHandleZip 2020-01-07 07:01:34 -07:00
Kenneth Moreland
4a626b2e93 Shorter storage tag for ArrayHandleView 2020-01-07 07:01:13 -07:00
Kenneth Moreland
4c8c28d1f1 Shorter storage tag for ArrayHandleReverse
Also discovered that many C++ compilers have trouble giving warnings
for partial specialization of classes marked as deprecated. Fix
the problem by instead deprecating the items in the class.
2020-01-07 07:01:12 -07:00
Kenneth Moreland
1ec716e5d2 Shorten storage tag for ArrayHandlePermutation 2020-01-07 07:01:10 -07:00
Kenneth Moreland
ca0ad1dc22 Shorten storage tag for ArrayHandleIndex 2020-01-07 07:01:10 -07:00
Kenneth Moreland
7bd5802dd8 Shorter storage tag for ArrayHandleGroupVecVariable 2020-01-07 07:01:09 -07:00
Kenneth Moreland
74df1b3857 Shorten storage tag for ArrayHandleGroupVec 2020-01-07 07:01:08 -07:00
Kenneth Moreland
1f5846b49e Shorten storage tag for ArrayHandleCounting 2020-01-07 07:01:07 -07:00
Kenneth Moreland
31898fd887 Shorten tag name for ArrayHandleConstant 2020-01-07 07:01:06 -07:00
Kenneth Moreland
b2f07511fb Shorten storage tags for ArrayHandleConcatenate 2020-01-07 07:01:05 -07:00
Kenneth Moreland
2688fc7d50 Shorten tag name for ArrayHandleCompositeVector 2020-01-07 07:01:05 -07:00
Kenneth Moreland
8516fa7ac6 Shorten tag name for ArrayHandleCartesianProduct 2020-01-07 07:01:04 -07:00
Kenneth Moreland
591d1ba264 Make ArrayHandleUniformPointCoordinates storage type shorter 2020-01-07 07:01:03 -07:00
Kenneth Moreland
944a3c4c14 Make ArrayHandleCast storage type shorter 2020-01-07 07:00:55 -07:00
Allison Vacanti
07283f74c1 Merge topic 'binary_search_algorithms'
44c4f0838 Add vtkm/Algorithms.h header with device-friendly binary search algorithms.
6d4e37e95 Fix brigand for CUDA 10.2.
84eedc885 Make BinaryOperators/Predicates more flexible.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1920
2019-12-26 10:48:21 -05:00
Allison Vacanti
88bf38afe2 Add support for ArrayHandleDecorator resizing.
Fixes #428.
2019-12-20 17:03:36 -05:00
Allison Vacanti
44c4f0838f Add vtkm/Algorithms.h header with device-friendly binary search algorithms. 2019-12-20 12:35:10 -05:00
Allison Vacanti
813f5a422f Fixup custom portal iterator logic.
The convenience functions `ArrayPortalToIteratorBegin()` and
`ArrayPortalToIteratorEnd()` wouldn't detect specializations of
`ArrayPortalToIterators<PortalType>` since the specializations aren't
visible when the `Begin`/`End` functions are declared.

Since the CUDA iterators rely on a specialization, the convenience
functions would not compile on CUDA.

Now, instead of specializing `ArrayPortalToIterators` to provide custom
iterators for a particular portal, the portal may advertise custom
iterators by defining `IteratorType`, `GetIteratorBegin()`, and
`GetIteratorEnd()`. `ArrayPortalToIterators` will detect such portals
and automatically switch to using the specialized portals.

This eliminates the need for the specializations to be visible to the
convenience functions and allows them to be usable on CUDA.
2019-12-17 15:39:51 -05:00
Kenneth Moreland
80d2948300 Add List changelog 2019-12-04 17:21:32 -07:00
Kenneth Moreland
9ff1f5d8a9 Merge topic 'deprecation'
f62b50259 Refactor deprecated macros
fec1c4995 Re-enable Visual Studio warning 4996
ed4d0d50c Add VTKM_DEPRECATED macro

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1902
2019-12-04 09:01:17 -05:00
Kenneth Moreland
f62b50259e Refactor deprecated macros
Previously we relied on CMake's compiler detection module to build the
macros for using the deprecated attribute. However, CMake created macros
for pre-C++14 versions of the feature, which do not work in all cases.
Also, we have the need to be able to suppress deprecation warnings when
we are implementing a deprecated thing. Since we have to query compilers
ourself, we might as well figure out if the deprecated attribute we want
is supported.

Worst case is that we won't support deprecation warnings everywhere we
could. That will not create incorrect code and we can always add that
later.
2019-11-06 14:47:59 -07:00
Kenneth Moreland
ed4d0d50c3 Add VTKM_DEPRECATED macro
The `VTKM_DEPRECATED` macro allows us to remove (and usually replace)
features from VTK-m in minor releases while still following the conventions
of semantic versioning. The idea is that when we want to remove or replace
a feature, we first mark the old feature as deprecated. The old feature
will continue to work, but compilers that support it will start to issue a
warning that the use is deprecated and should stop being used. The
deprecated features should remain viable until at least the next major
version. At the next major version, deprecated features from the previous
version may be removed.
2019-11-06 09:58:53 -07:00
Kenneth Moreland
5676cd1758 Add changelog for ListTagRemoveIf 2019-11-02 11:08:34 -06:00
Robert Maynard
552d473496 Initial documentation on how to cut a VTK-m release 2019-10-17 09:16:57 -04:00
Robert Maynard
3c54de5fdb Add release notes for v1.5.0 2019-10-15 13:40:46 -04:00
Robert Maynard
c3f0060cc5 ExecutionSignatures are now optional for simple worklets
If a worklet doesn't explicitly state an ExecutionSignature, VTK-m
assumes the worklet has no return value, and each ControlSignature
argument is passed to the worklet in the same order.

For example if we had this worklet:
```cxx
struct DotProduct : public vtkm::worklet::WorkletMapField
{
  using ControlSignature = void(FieldIn, FieldIn, FieldOut);
  using ExecutionSignature = void(_1, _2, _3);

  template <typename T, vtkm::IdComponent Size>
  VTKM_EXEC void operator()(const vtkm::Vec<T, Size>& v1,
                            const vtkm::Vec<T, Size>& v2,
                            T& outValue) const
  {
    outValue = vtkm::Dot(v1, v2);
  }
};
```

It can be simplified to be:

```cxx
struct DotProduct : public vtkm::worklet::WorkletMapField
{
  using ControlSignature = void(FieldIn, FieldIn, FieldOut);

  template <typename T, vtkm::IdComponent Size>
  VTKM_EXEC void operator()(const vtkm::Vec<T, Size>& v1,
                            const vtkm::Vec<T, Size>& v2,
                            T& outValue) const
  {
    outValue = vtkm::Dot(v1, v2);
  }
};
2019-10-08 11:14:11 -04:00
Allison Vacanti
3886b7dfb8 Refactor CellSetExplicit to remove NumIndices.
See #408 for details.
2019-09-30 12:27:13 -04:00
Robert Maynard
8520d70e0d Compile most frequently used VTK-m filters into a library
VTK-m now provides the following filters with the default policy
as part of the vtkm_filter library:
  - CellAverage
  - CleanGrid
  - ClipWithField
  - ClipWithImplicitFunction
  - Contour
  - ExternalFaces
  - ExtractStructured
  - PointAverage
  - Threshold
  - VectorMagnitude

By building these as a library we hope to provide faster compile
times for consumers of VTK-m when using common configurations.
2019-09-18 12:06:13 -04:00
Allison Vacanti
024b8a3067 Fix formatting of CodingConventions.md.
The current page has some issue:

https://gitlab.kitware.com/vtk/vtk-m/blob/master/docs/CodingConventions.md
2019-09-12 15:16:30 -04:00
Li-Ta Lo
d8cbc990f5 Merge topic 'tangle_source'
05b679250 Merge branch 'master' into tangle_source
a6c044df9 added changelog
0d818701c put VTKM_SOURCE_EXPORT in .cxx
e0aae7d86 remove EXPORT from .cxx
4d7de67ee use VTKM_SOURCE_EXPORT
cd49136d5 add copyright notice, add installation of header
0c094a568 used the Tangle source
aeb8877a9 add newline at EOF, minor change based review
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1804
2019-09-12 11:18:52 -04:00
Robert Maynard
fc28908788 Merge topic 'vtkm_supports_dropping_unused_symbols'
1bfcce19d VTK-m builds with separate function sections to allow smaller binaries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Allison Vacanti <allison.vacanti@kitware.com>
Merge-request: !1831
2019-09-11 15:12:36 -04:00
Allison Vacanti
f8c60bd958 Merge topic '412_ArrayHandleDecorator'
885cce391 Add ArrayPortalDecorator.
29ea46fa5 Refactor IsWritableArrayHandle to use PortalSupportsSets.
dc98517b9 Clean up ArrayHandleCounting.
0dad55a04 Remove return statements in functions that return void.
abdd458b8 Remove unused member variable in Algorithm functor.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1828
2019-09-11 14:34:57 -04:00
Li-Ta Lo
05b6792500 Merge branch 'master' into tangle_source 2019-09-11 12:06:58 -06:00
Robert Maynard
1bfcce19dd VTK-m builds with separate function sections to allow smaller binaries
Consumers of VTK-m when enabling of dropping of unused functions
will see VTK-m functions dropped. Previously this didn't happen
as VTK-m didn't build object files with the correct flags for this.

By allowing the linker to remove unused symbols we see a significant
saving the file size of VTK-m tests, examples, and benchmarks.
An OpenMP build of the tests and benchmarks goes from 168MB to
141MB which is roughly a 16% filesize reduction.

Initially I had presumed that these changes would increase link times.
But in measurements the total wall time for compilation of VTK-m has
stayed about the same ( seeing a decrease of 1.5% ). Presumably the
increased computation is offset by the reduction in file writing.
2019-09-11 13:34:25 -04:00
Allison Vacanti
885cce3914 Add ArrayPortalDecorator. 2019-09-11 12:50:59 -04:00
Li-Ta Lo
a6c044df9a added changelog 2019-09-11 10:19:54 -06:00
Robert Maynard
e37c2061cf vtkm_add_target_information now supports multiple targets
Instead of having to be called for each target you can now
pass multiple targets at once. Do note that if you pass multiple
targets you will need to pass all the sources from those targets
that need to be 'device' compiled.
2019-09-11 09:17:52 -04:00
Kenneth Moreland
6c136b978e Remove vtkm::BaseComponent
This functionality has been superseded by VecTraits::BaseComponentType.
The new functionality also supports replacing the BaseComponentType.
2019-09-09 13:01:03 -06:00
Kenneth Moreland
07c59fcf72 Update filters with secondary fields to use new policy method
Rather than do a CastAndCall on all possible field types when calling a
worklet with two fields (where they all typically get cast to the same
type as the primary field), use the new mechanism with
ArrayHandleMultiplexer to create one code path.

Also update the ApplyPolicy to accept the Field type, which is used to
determine any additional storage types to support.
2019-09-09 08:19:16 -06:00
Kenneth Moreland
3039a18baf Add ability to get an array from a Field for a particular type
This is done through a new version of ApplyPolicy. This version takes
a type of the array as its first template argument, which must be
specified.

This requires having a list of potential storage to try. It will use
that to construct an ArrayHandleMultiplexer containing all potential
types. This list of storages comes from the policy. A StorageList
item was added to the policy.

Types are automatically converted. So if you ask for a vtkm::Float64 and
field contains a vtkm::Float32, it will the array wrapped in an
ArrayHandleCast to give the expected type.
2019-09-09 08:19:15 -06:00
Kenneth Moreland
6323d6803e Add recursive component queries to VecTraits
Added a BaseComponentType to VecTraits that recursively finds the base
(non-Vec) type of a Vec. This is useful when dealing with potentially
nested Vec's (e.g. Vec<Vec<T, M>, N>) and you need to keep the structure
but know the base type.

Also added a couple of templates for keeping the structure but changing
the type. These are ReplaceComponentType and ReplaceBaseComponentType.
These allow you to create new Vec's with the same structure as the query
Vec but with differen component types.
2019-09-09 08:19:15 -06:00
Allison Vacanti
e8afcfd7d8 Merge topic '405_partitioned_ds'
63050f68f `MultiBlock` renamed to `PartitionedDataSet`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Utkarsh Ayachit <utkarsh.ayachit@kitware.com>
Merge-request: !1821
2019-09-04 07:22:07 -04:00
Allison Vacanti
e143eaf2e6 Merge topic 'ScanExclusiveExtend'
afe1bd12d Add `ScanExtended` device algorithm.
1480efaeb Add perf logging to DeviceAdapterAlgorithmSerial.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1824
2019-09-04 07:21:37 -04:00
Allison Vacanti
afe1bd12dd Add ScanExtended device algorithm.
This behaves just like `ScanExclusive`, but rather than returning the
total sum, it is appended to the end of the output array.

This is in preparation for the CellSetExplicit refactoring described in
issue #408.
2019-09-03 15:02:41 -04:00
Allison Vacanti
63050f68fc MultiBlock renamed to PartitionedDataSet
The `MultiBlock` class has been renamed to `PartitionedDataSet`, and its API
has been refactored to refer to "partitions", rather than "blocks".
Additionally, the `AddBlocks` method has been changed to `AppendPartitions` to
more accurately reflect the operation performed. The associated
`AssignerMultiBlock` class has also been renamed to
`AssignerPartitionedDataSet`.

This change is motivated towards unifying VTK-m's data model with VTK. VTK has
started to move away from `vtkMultiBlockDataSet`, which is a hierarchical tree
of nested datasets, to `vtkPartitionedDataSet`, which is always a flat vector
of datasets used to assist geometry distribution in multi-process environments.
This simplifies traversal during processing and clarifies the intent of the
container: The component datasets are partitions for distribution, not
organizational groupings (e.g. materials).

Ref #405
2019-09-03 12:42:23 -04:00
Robert Maynard
3b89bc0db2 CellSet classes don't require a name 2019-09-02 10:39:58 -04:00
Robert Maynard
89fa2c0293 Remove multiple vtkm::cont::CellSet from vtkm::cont::DataSet
By removing the ability to have multiple CellSets in a DataSet
we can simplify the following things:

  - Cell Fields now don't require a CellSet name when being constructed
  - Filters don't need to manage what the active cellset is
2019-09-02 09:04:51 -04:00
Kenneth Moreland
75a060a243 Fix cell derivatives for polygon cell shape
For polygon cell shapes (that are not triangles or quadrilaterals),
interpolations are done by finding the center point and creating a
triangle fan around that point. Previously, the gradient was computed in
the same way as interpolation: identifying the correct triangle and
computing the gradient for that triangle.

The problem with that approach is that makes the gradient discontinuous
at the boundaries of this implicit triangle fan. To make things worse,
this discontinuity happens right at each vertex where gradient
calculations happen frequently. This means that when you ask for the
gradient at the vertex, you might get wildly different answers based on
floating point imprecision.

Get around this problem by creating a small triangle around the point in
question, interpolating values to that triangle, and use that for the
gradient. This makes for a smoother gradient transition around these
internal boundaries.
2019-08-29 17:37:42 -06:00
Nick Davis
2d9f7ea95b add changelog entry 2019-08-28 12:45:44 -06:00
Allison Vacanti
8bb9873389 Merge topic '355_fetch_single_value'
bfe357319 Add a missing header to StorageExtrude.
d3fbe535f Check the source array's active device in ArrayCopy.
399f23963 Add ArrayGetValue[s] to address issue #355.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1790
2019-08-22 11:18:00 -04:00
Allison Vacanti
399f23963e Add ArrayGetValue[s] to address issue #355. 2019-08-22 11:16:16 -04:00
Robert Maynard
f1c09529d1 Merge topic 'correct_improper_cellset_indexing'
fa9ffac7c Correct improper cellset indexing
b0c6e18ea DataSet queries for cellset and coordinate index won't trow

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1777
2019-08-22 08:39:36 -04:00
Robert Maynard
169480e4f0 Merge topic 'make_more_of_vtkm_vec_constexpr'
a529b90c7 vtkm::Vec const& operator[] is now constexpr

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1792
2019-08-22 08:35:51 -04:00
Robert Maynard
a529b90c73 vtkm::Vec const& operator[] is now constexpr
This allows for developers to do things such as the following
as constexpr's:
```cxx
constexpr vtkm::Id2 dims(16,16);
constexpr vtkm::Float64 dx = vtkm::Float64(4.0 * vtkm::Pi()) / vtkm::Float64(dims[0] - 1);
```
2019-08-22 08:34:25 -04:00
Kenneth Moreland
54456bea76 Merge topic 'threshold-explicit-cells'
d7bfbbda8 Remove GhostCellRemove::ConvertOutputToUnstructured option
42e8a9125 Copy Threshold output to a CellSetExplicit

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Matt Larsen <larsen30@llnl.gov>
Merge-request: !1791
2019-08-21 16:23:04 -04:00
Robert Maynard
fa9ffac7c9 Correct improper cellset indexing 2019-08-21 15:16:26 -04:00
Kenneth Moreland
42e8a9125d Copy Threshold output to a CellSetExplicit
Perhaps a better title for this change would be "Make the Threshold
filter not totally useless."

A long standing issue with the Threshold filter is that its output
CellSet was stored in a CellSetPermutation. This made Threshold hyper-
efficient because it required hardly any data movement to implement.
However, the problem was that any other unit that had to use the CellSet
failed. To have VTK-m handle that output correctly in other filters and
writers, they all would have to check for the existance of
CellSetPermutation. And CellSetPermutation is templated on the CellSet
type it is permuting, so all units would have to compile special cases
for all these combinations. This is not likely to be feasible in any
static solution.

The simple solution, implemented here, is to deep copy the cells to a
CellSetExplicit, which is a known type that is already used everywhere
in VTK-m. The solution is a bit disappointing since it requires more
memory and time to build. But it is on par with solutions in other
libraries (like VTK). And it really does not matter how efficient the
old solution was if it was useless.
2019-08-20 16:04:26 -06:00
Kenneth Moreland
20c758108c Add make_ArrayHandleSOA for std::vectors and C arrays 2019-08-20 12:09:57 -06:00
Kenneth Moreland
869d665806 Add ArrayHandleSOA
This ArrayHandle should behave just like the one with basic storage but
external arrays stored by component can be shallow-copied to them.
2019-08-20 12:09:54 -06:00
Robert Maynard
78c7a8d8e8 Add changelog for make_Field changes 2019-08-20 08:23:20 -04:00
Robert Maynard
5087b17250 Add changelog for CreateResult changes 2019-08-20 08:23:20 -04:00
Robert Maynard
b0c6e18ea7 DataSet queries for cellset and coordinate index won't trow
Queries for cellset and coordinates by name will not throw exceptions
when looking just for the index value. Instead they will return -1
2019-08-19 09:36:03 -04:00
Abhishek Yenpure
46d4e50622 Merge topic 'lagrangian-coherent-structures'
ac8d8c95b Separating GridMetaData class
4aa51fcab Adding custom dataset name to LCS filter output
ec8a29e07 Resolving nvcc implicit conversion warning
469e60430 Resolving nvcc compiler warnings
d5ef47040 LCS fixes
da3983d21 Changes from Ken's review
6b8aa3f24 Fixing missing header in install issue
9634924e1 Fixing issues with LCS Filter files
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1764
2019-08-13 19:13:37 -04:00
Abhishek Yenpure
da3983d213 Changes from Ken's review
- Fixing nvcc compiler warnings
- Changes from Ken's review
2019-08-09 10:34:01 -07:00
Robert Maynard
bc440670f6 Merge topic 'vtkm_filters_use_invoker_to_hightlight_best_practises'
3a7d3cb5f VTK-m filters now launch all worklets via a vtkm::cont::Invoker

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1760
2019-08-09 11:40:59 -04:00
Robert Maynard
3a7d3cb5ff VTK-m filters now launch all worklets via a vtkm::cont::Invoker
This has been done as to showcase the recommend best practices
for new VTK-m contributors.
2019-08-09 10:37:35 -04:00
Abhishek Yenpure
321f1b6201 Merge topic 'particle_status_merge'
f1e9282b2 Adding changelog for the changes
39e278cf0 Fixing unreachable statement nvcc warning
2798c737a Fixing issues raised by Ken on Gitlab
a6df11732 Removing unnecessary commented code
aefc5faca Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into particle_status_merge
647afd159 Passing point to evaluate by reference
577694579 Adding binary search for Rectilinear locator
06d05196b Adding fast path to Uniform Grid Locator
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1756
2019-08-08 17:08:04 -04:00
Abhishek Yenpure
f1e9282b23 Adding changelog for the changes
1. 2D cell locators
2. Particle advection module statuses
2019-08-08 12:33:53 -07:00
Kenneth Moreland
c50843cdb1 Add changedoc for simplifying examples 2019-08-07 09:14:04 -06:00
Robert Maynard
d7b2ff04c9 Provide a simpler way to restrict value types for filters 2019-08-06 17:04:07 -04:00
Allison Vacanti
5db762ee71 Refactor topology mappings to clarify meaning.
The `From` and `To` nomenclature for topology mapping has been confusing for
both users and developers, especially at lower levels where the intention of
mapping attributes from one element to another is easily conflated with the
concept of mapping indices (which maps in the exact opposite direction).

These identifiers have been renamed to `VisitTopology` and `IncidentTopology`
to clarify the direction of the mapping. The order in which these template
parameters are specified for `WorkletMapTopology` have also been reversed,
since eventually there may be more than one `IncidentTopology`, and having
`IncidentTopology` at the end will allow us to replace it with a variadic
template parameter pack in the future.

Other implementation details supporting these worklets, include `Fetch` tags,
`Connectivity` classes, and methods on the various `CellSet` classes (such as
`PrepareForInput` have also reversed their template arguments. These will need
to be cautiously updated.

The convenience implementations of `WorkletMapTopology` have been renamed for
clarity as follows:

```
WorkletMapPointToCell --> WorkletVisitCellsWithPoints
WorkletMapCellToPoint --> WorkletVisitPointsWithCells
```

The `ControlSignature` tags have been renamed as follows:

```
FieldInTo --> FieldInVisit
FieldInFrom --> FieldInMap
FromCount --> IncidentElementCount
FromIndices --> IncidentElementIndices
```
2019-08-06 11:27:26 -04:00
Robert Maynard
2eeeafc1f5 Merge topic 'move_invoker_to_cont'
7e04b0511 Move Invoker into vtkm/cont

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1745
2019-08-01 12:36:00 -04:00
Robert Maynard
7e04b0511f Move Invoker into vtkm/cont
The Invoker is a control side object that handles the construction
of the relevant worklet dispatcher. Moving it to control makes it
obvious that it isn't an algorithm itself but a way to launch
worklets.
2019-08-01 12:34:27 -04:00
Allison Vacanti
91e7c4d0b9 Add orientation and winding options to SurfaceNormals. 2019-08-01 11:02:13 -04:00
Kenneth Moreland
53e8689385 Add changedoc for common vec types 2019-07-31 12:55:40 -06:00
Kenneth Moreland
eaf87e4519 Remove special ArrayHandleMultiplexer template case
There was a special case for ArrayHandleMultiplexer where if you gave it
just one type it would treat that as a value type rather than an array
to support and instead provide a default list of types. However, GCC 4.8
is having trouble compiling the code to create the default list, the
semantics are confusing, and the more I think about it the less likely I
think we will need this functionality. So, just getting rid of that.
2019-07-30 14:48:35 -06:00
Kenneth Moreland
d451064525 Add changedoc for ArrayHandleMultiplexer 2019-07-22 08:36:28 -06:00
Kenneth Moreland
468ee61cac Merge topic 'write-to-array-handle-cast'
6592e5288 Fix IsWritableArrayHandle for portals that exist but cannot be written
0e15a1116 Enable writing to ArrayHandleCast
6d37ce945 Remove invalid PortalType

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1731
2019-07-22 10:34:54 -04:00
Allison Vacanti
694d1e113d Add methods to BoundaryState to query specific offsets.
The existing functionality worked on radii, but it's helpful to
know if a specific sample location will be in bounds, too.
2019-07-19 15:09:57 -04:00
Kenneth Moreland
0e15a1116c Enable writing to ArrayHandleCast
Previously, `ArrayHandleCast` was considered a read-only array handle.
However, it is trivial to reverse the cast (now that `ArrayHandleTransform`
supports an inverse transform). So now you can write to a cast array
(assuming the underlying array is writable).

One trivial consequence of this change is that you can no longer make a
cast that cannot be reversed. For example, it was possible to cast a simple
scalar to a `Vec` even though it is not possible to convert a `Vec` to a
scalar value. This was of dubious correctness (it is more of a construction
than a cast) and is easy to recreate with `ArrayHandleTransform`.
2019-07-17 18:40:45 -06:00
Robert Maynard
774d7a566e Add release notes for v1.4.0 2019-06-26 12:13:47 -04:00
Robert Maynard
c97ff042e6 Document the adding of lodepng to thirdparty 2019-06-20 17:03:28 -04:00
Robert Maynard
8aaf922aa4 Introduce a log level that details kernel launch parameters 2019-06-18 15:01:07 -04:00
Robert Maynard
bcaf7d9beb ScopedRuntimeDeviceTracker have better controls of setting devices.
The ScopedRuntimeDeviceTracker now can force, enable, or disable
devices. Additionally the ScopedRuntimeDeviceTracker and the
RuntimeDeviceTracker handle the DeviceAdapterTagAny robustly
across all methods.
2019-05-21 15:32:10 -04:00
Robert Maynard
fa03dc664a ScopedRuntimeDeviceTracker requires a device to execute on when constructed.
To simplify using the ScopedRuntimeDeviceTracker it now takes the
device id you want to run on during construction.
2019-05-21 11:17:37 -04:00
Robert Maynard
4020f51988 RuntimeDeviceTracker can't be copied and is only accessible via reference.
As the RuntimeDeviceTracker is a per thread construct we now make
it explicit that you can only get a reference to the per-thread
version and can't copy it.
2019-05-20 11:43:05 -04:00
Robert Maynard
18a0cd35b0 vtkm::worklet::Invoker now supports scatter types
Fixes #297
2019-05-15 11:04:14 -04:00
Robert Maynard
674fe1fbf2 StealArray now returns the array and free function as a Pair.
This helps reduces bugs when the callers ask to steal arrays
without getting the free function, or ask for the free function
after stealing the array.
2019-05-01 09:42:57 -04:00
nadavi
fbcea82e78 conslidate the license statement 2019-04-17 10:57:13 -06:00
Robert Maynard
047b646517 VTK-m now provides better scheduling parameters controls
VTK-m now offers a more GPU aware set of defaults for kernel scheduling.
When VTK-m first launches a kernel we do system introspection and determine
what GPU's are on the machine and than match this information to a preset
table of values. The implementation is designed in a way that allows for
VTK-m to offer both specific presets for a given GPU ( V100 ) or for
an entire generation of cards ( Pascal ).

Currently VTK-m offers preset tables for the following GPU's:
- Tesla V100
- Tesla P100

If the hardware doesn't match a specific GPU card we than try to find the
nearest know hardware generation and use those defaults. Currently we offer
defaults for
- Older than Pascal Hardware
- Pascal Hardware
- Volta+ Hardware

Some users have workloads that don't align with the defaults provided by
VTK-m. When that is the cause, it is possible to override the defaults
by binding a custom function to `vtkm::cont::cuda::InitScheduleParameters`.
As shown below:

```cpp
  ScheduleParameters CustomScheduleValues(char const* name,
                                          int major,
                                          int minor,
                                          int multiProcessorCount,
                                          int maxThreadsPerMultiProcessor,
                                          int maxThreadsPerBlock)
  {

    ScheduleParameters params  {
        64 * multiProcessorCount,  //1d blocks
        64,                        //1d threads per block
        64 * multiProcessorCount,  //2d blocks
        { 8, 8, 1 },               //2d threads per block
        64 * multiProcessorCount,  //3d blocks
        { 4, 4, 4 } };             //3d threads per block
    return params;
  }
  vtkm::cont::cuda::InitScheduleParameters(&CustomScheduleValues);
```
2019-04-17 08:32:16 -04:00
Robert Maynard
a5dbe1ece3 Merge topic 'bitfields'
661fb64de AtomicInterfaceControl functions are marked with VTKM_SUPPRESS_EXEC_WARNINGS
0c70f9b9a Add BitFieldIn/Out/InOut worklet signature tags.
a66510e81 Add ArrayHandleBitField, a boolean-valued AH backed by a BitField.
56cc5c3d3 Add support for BitFields.
d01b97382 Allow VTKM_SUPPRESS_EXEC_WARNINGS to be used inside macros.
2f2ca9370 Add bit operations FindFirstSetBit and CountSetBits to Math.h.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1629
2019-04-11 12:32:03 -04:00
Allison Vacanti
a66510e819 Add ArrayHandleBitField, a boolean-valued AH backed by a BitField. 2019-04-11 08:27:17 -04:00
Allison Vacanti
56cc5c3d3a Add support for BitFields.
BitFields are:
- Stored in memory using a contiguous buffer of bits.
- Accessible via portals, a la ArrayHandle.
- Portals operate on individual bits or words.
- Operations may be atomic for safe use from concurrent kernels.

The new BitFieldToUnorderedSet device algorithm produces an ArrayHandle
containing the indices of all set bits, in no particular order.

The new AtomicInterface classes provide an abstraction into bitwise
atomic operations across control and execution environments and are used
to implement the BitPortals.
2019-04-11 08:27:17 -04:00
Robert Maynard
89ec4aae2f Reduction on CUDA handles different input and output types better
When reducing an input type that differs from the output type
you need to write a custom binary operator that also implements
how to do the unary transformation.
2019-04-10 14:44:44 -04:00
Sujin Philip
e408537608 Merge topic 'update-CellLocatorTwoLevelUniformGrid'
566e220ea Suppress dashboard warnings
f20d7e788 Document the changes that are part of this MR.
f78e763be Add CellLocatorGeneral
c6bead838 Rename CellLocatorTwoLevelUniformGrid to CellLocatorUniformBins
ee838b829 Stylistic changes to CellLocators to match VTK-m

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1615
2019-04-03 15:56:27 -04:00
Sujin Philip
f20d7e7884 Document the changes that are part of this MR. 2019-04-03 15:13:34 -04:00
Kenneth Moreland
4e34feecb4 Add ability to specialize worklet for device
This adds an ExecutionSignature tag named Device that passes the
DeviceAdapterTag as an argument to the worklet's operator(). This allows
worklets to specialize their code based on the device.
2019-04-01 10:01:54 -06:00
Robert Maynard
e787d52afc Merge branch 'optionparser-to-third-party' into 'master'
Wrap third party optionparser.h in vtkm/cont/internal/OptionParser.h

See merge request vtk/vtk-m!1593
2019-04-01 10:56:01 -04:00
Kenneth Moreland
7237c46898 Wrap third party optionparser.h in vtkm/cont/internal/OptionParser.h
Previously we just took the optionparser.h file and stuck it right in
our source code. That was problematic for a variety of reasons.

1. It incorrectly assigned our license to external code.
2. It made lots of unnecessary changes to the original source (like
reformatting).
3. It made it near impossible to track patches we make and updates to
the original software.

Instead, use the third-party system to track changes to optionparser.h
in a different repository and then pull that into ours.
2019-03-26 15:47:17 -06:00
Kenneth Moreland
b0303c96ed Allow Initialize to parse only some arguments
When a library requires reading some command line arguments through a
function like Initialize, it is typical that it will parse through
arguments it supports and then remove those arguments from argc and argv
so that the remaining arguments can be parsed by the calling program.
VTK-m's initialize did not do that, so add that functionality.
2019-03-26 12:04:18 -06:00
Robert Maynard
d1a957bf5c Merge topic 'refactor_runtime_device_tracker'
838cb4337 Redesign RuntimeDeviceTracker and RuntimeDeviceInformation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1600
2019-03-26 10:08:31 -04:00
Robert Maynard
838cb43375 Redesign RuntimeDeviceTracker and RuntimeDeviceInformation
The RuntimeDeviceTracker had grown organically to handle multiple
different roles inside VTK-m. Now that we have device tags
that can be passed around at runtime, large portions of
the RuntimeDeviceTracker API aren't needed.

Additionally the RuntimeDeviceTracker had a dependency on knowing
the names of each device, and this wasn't possible
as that information was part of its self. Now we have moved that
information into RuntimeDeviceInformation and have broken
the recursion.
2019-03-26 08:36:18 -04:00
Allison Vacanti
ad15ae1553 Merge topic 'Variant_As'
e1f5c4dd9 Modify VariantAH::AsVirtual to cast to new ValueType if needed.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1585
2019-03-25 16:39:39 -04:00
Allison Vacanti
e1f5c4dd9b Modify VariantAH::AsVirtual to cast to new ValueType if needed.
E.g:

```
    ArrayHandle<Float64> doubleArray;
    VariantArrayHandle varHandle{doubleArray};
    ArrayHandleVirtual<Float32> = varHandle.AsVirtual<Float32>();
```

If there is a loss in range and/or precision, a warning is logged. If
the ValueTypes are Vecs with mismatched widths, an ErrorBadType is thrown.
Internally, an ArrayHandleCast is used between the VariantArrayHandle's
stored array and the ArrayHandleVirtual.
2019-03-25 11:39:45 -04:00
Li-Ta Lo
9b479c8e12 finish the change log for connected component filters 2019-03-24 23:22:55 -06:00
Li-Ta Lo
84351eff6d Merge branch 'master' into connected_component 2019-03-24 10:13:32 -06:00
Robert Maynard
256e0c3c11 Merge topic 'rename_to_GetRuntimeDeviceTracker'
ae11e115a RuntimeDeviceTracker: Remove `Global` from names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1592
2019-03-24 08:17:02 -04:00
Robert Maynard
ae11e115a0 RuntimeDeviceTracker: Remove Global from names 2019-03-22 08:53:26 -07:00
Kenneth Moreland
0af017b038 Move virtual methods of other CellLocators to vtkm_cont
These changes caused some warnings in clang to show up based on virtual
methods in other cell locators. Hence, the rest of the cell locators
have also had some of their code moved to vtkm_cont.
2019-03-20 17:38:50 -06:00
Kenneth Moreland
e87864b0e3 Put CellLocatorBoundingIntervalHierarchy in vtkm_cont library
All of the methods in CellLocatorBoundingIntervalHierarchy were listed in
header files. This is sometimes problematic with virtual methods. Since
everything implemented in it can just be embedded in a library, move the
code into the vtkm_cont library.
2019-03-20 17:33:08 -06:00
Li-Ta Lo
cbd04b4bed minor change based on code review feedback 2019-03-20 11:58:22 -06:00
Kenneth Moreland
bfe06d6d18 Merge topic 'point-merge'
6aa99aec0 Add ability to remove degenerate cells in CleanGrid
5688375c9 Add point merge capabilities to CleanGrid filter

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Abhishek Yenpure <abhishek@uoregon.edu>
Merge-request: !1558
2019-03-07 20:33:36 -05:00
Robert Maynard
508a704d60 Document vtkm_filter 2019-03-05 15:52:14 -05:00
Kenneth Moreland
0b32831afd Make ArrayHandleVirtual conform with other ArrayHandle structure
Previously, ArrayHandleVirtual was defined as a specialization of
ArrayHandle with the virtual storage tag. This was because the storage
object was polymorphic and needed to be handled special. These changes
moved the existing storage definition to an internal class, and then
managed the pointer to that implementation class in a Storage object
that can be managed like any other storage object.

Also moved the implementation of StorageAny into the implementation of
the internal storage object.
2019-03-01 15:50:14 -07:00
Kenneth Moreland
5688375c99 Add point merge capabilities to CleanGrid filter 2019-02-26 12:44:33 -07:00
Kenneth Moreland
f010a6931f Merge topic 'mask-worklets'
191d6e558 Add Mask capabilities to worklets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Allison Vacanti <allison.vacanti@kitware.com>
Merge-request: !1528
2019-02-25 18:23:59 -05:00
Haocheng LIU
634f523d92 Merge benchmark executables into a device dependent shared library
VTK-m has been updated to replace old per device benchmark executables with a device
dependent shared library so that it's able to accept a device adapter at runtime through
the "--device=" argument.
2019-02-25 12:26:47 -05:00
Kenneth Moreland
191d6e5580 Add Mask capabilities to worklets
Mask objects allow you to specify which output values should be
generated when a worklet is run. That is, the Mask allows you to skip
the invocation of a worklet for any number of outputs.
2019-02-25 08:58:39 -07:00
Kenneth Moreland
1ca55ac319 Add specialized operators for ArrayPortalValueReference
The ArrayPortalValueReference is supposed to behave just like the value
it encapsulates and does so by automatically converting to the base type
when necessary. However, when it is possible to convert that to
something else, it is possible to get errors about ambiguous overloads.
To avoid these, add specialized versions of the operators to specify
which ones should be used.

Also consolidated the CUDA version of an ArrayPortalValueReference to the
standard one. The two implementations were equivalent and we would like
changes to apply to both.
2019-02-20 13:33:55 -07:00
Robert Maynard
ad98d818ce VTK-m now doesn't clobber external DIY installations
Fixes #334
2019-02-05 13:05:14 -05:00
Robert Maynard
6b3f60ee86 Merge topic 'remove_check_build_test'
4b47a4d92 Remove VTKmCheckSourceInBuild
45c24109a Add changelog for VTKmCheckSourceInInstall

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1537
2019-02-05 12:58:35 -05:00
Haocheng LIU
0696ae135e Merge topic 'asynchronize-timer'
415252c66 Introduce asynchronous and device independent timer

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Haocheng LIU <haocheng.liu@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1530
2019-02-05 12:02:59 -05:00
Haocheng LIU
415252c662 Introduce asynchronous and device independent timer
The timer class now is asynchronous and device independent. it's using an
similiar API as vtkOpenGLRenderTimer with Start(), Stop(), Reset(), Ready(),
and GetElapsedTime() function. For convenience and backward compability, Each
Start() function call will call Reset() internally and each GetElapsedTime()
function call will call Stop() function if it hasn't been called yet for keeping
backward compatibility purpose.

Bascially it can be used in two modes:

* Create a Timer without any device info. vtkm::cont::Timer time;

  * It would enable timers for all enabled devices on the machine. Users can get a
specific elapsed time by passing a device id into the GetElapsedtime function.
If no device is provided, it would pick the maximum of all timer results - the
logic behind this decision is that if cuda is disabled, openmp, serial and tbb
roughly give the same results; if cuda is enabled it's safe to return the
maximum elapsed time since users are more interested in the device execution
time rather than the kernal launch time. The Ready function can be handy here
to query the status of the timer.

* Create a Timer with a device id. vtkm::cont::Timer time((vtkm::cont::DeviceAdapterTagCuda()));

  * It works as the old timer that times for a specific device id.
2019-02-05 12:01:56 -05:00
Robert Maynard
d0a70946b8 Simplify the DeviceAdapterRuntimeDetectorCuda to not do a kernel launch.
The kernel launch component of the runtime device adapter is fairly
pointless. If the hardware supports CUDA we should expect that
VTK-m has the correct kernel versions.

Plus in the original version if the CUDA device was being used
and the kernel launch returns cudaErrorDevicesUnavailable it
was never possible to restore CUDA support. Now what happens
is that the runtime tracker is marked as failed, but the
calling code can always go back and trying the device again.
2019-02-04 13:27:20 -05:00
Robert Maynard
45c24109af Add changelog for VTKmCheckSourceInInstall 2019-02-04 12:09:25 -05:00