Commit Graph

116 Commits

Author SHA1 Message Date
Li-Ta Lo
e680815d58 add include sstream and see if it clears the dashboard 2021-10-14 07:24:55 -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
ea1a55359f Name tangle source fields appropriately
The `Tangle` source would create a point field generically named
`nodevar`. This name was not indicitive of the data or its source. Thus,
the output point field has been renamed `tangle`.

The `Tangle` source was also creating a cell field (named `cellvar`).
This field was really just a mirror of the cell indices (counting from 0
on up). This field has been removed from the input. If you want such a
field, you can now use the `GenerateIds` filter to add it to any data
set.
2021-10-04 13:44:27 -06:00
Jieyang Chen
a157c0e846 Add changes for supporting Kokkos/HIP
Some of the unit tests for serial and kokkos are disable for hipcc to
properly compile.
VTKM_MATH_ASSERT and VTKM_TEST_ASSERT fail to compile with HIP in
execution environment so they are disabled with building with HIP.
Kokkos::finalize is causing error so it is temporarily disabled.
2021-10-01 15:27:00 -04:00
Vicente Adolfo Bolea Sanchez
46b0268825 CI: add ubuntu2004 with tbb 2020 build 2021-09-28 19:46:11 +00:00
Nickolas Davis
9baa7cd9fa Implement tbb runtime device configuration and update vtkm to use it 2021-09-20 10:24:23 -06:00
Nickolas Davis
1c4d6810aa implement openmp runtime device configuration and update code to use it 2021-09-15 14:22:59 -06:00
Kenneth Moreland
c17a5569f5 Do not try to use ArrayGetValue on arrays of non-basic types
This is no longer supported.
2021-08-11 07:56:32 -06:00
Kenneth Moreland
218429fd6b Make benchmarks work with most recent TBB 2021-06-15 10:48:48 -06:00
Kenneth Moreland
9d5d9e38a1 Remove testing headers from benchmarking
The code in `vtkm/cont/Testing.h` now requires a library, which is not
built if testing is not built. Thus, the benchmarking code was giving a
compile error if benchmarking was on but testing was off.

Change the benchmarking to not rely on anything in the Testing
framework. This means using classes in `vtkm/source` instead of
`MakeTestData`. Also avoid using the `TestValue` defined for the tests.
(In one case, we have a simple replacement.) Also had to fix a problem
with a header file not defining everything it needed to compile.
2021-06-10 09:41:26 -06:00
Kenneth Moreland
68f39b86a8 Deprecate VariantArrayHandle
`VaraintArrayHandle` has been replaced by `UnknownArrayHandle` and
`UncertainArrayHandle`. Officially make it deprecated and point users to
the new implementations.
2021-04-07 16:12:38 -06:00
Kenneth Moreland
a6725b3acd Remove use of deprecated ImplicitFunctions with virtual methods
Unfortunately, this introduces a backward-incompatible change with the
filters that use ImplicitFunctions. Before, they would get an
ImplicitFunctionHandle. This class is deprecated, and there is no easy
way to get back the actual type of implicit function stored in it.
2021-02-22 06:40:02 -07:00
Kenneth Moreland
0cddbef0b9 Deprecated virutal methods in ImplicitFunctions
The `ImplicitFunction` classes are now trivial classes that can be
passed among host and devices. Because of this, we now need to know the
type of the `ImplicitFunction` in order to use it.

The old functionality still exists (when virtual methods are still being
compiled), but will give deprecation warnings. It is also not possible
to get a pointer from `ImplicitFunctionHandle` and cast it back to the
original data type (because the type changed). This is a weird testing
feature that makes little sense in practice.

Also unsupported in the deprecated classes is the ability to change
the object and have those changes reflected in the handle. This is
unfortunate, but it would have been difficult to implement this
feature that is going away and only appears to be used in some of
the tests.
2021-02-22 06:40:02 -07:00
Kenneth Moreland
0797359c57 Make ExecutionWholeArray objects not depend on device type
With recent changes to `Arrayhandle`, the type for the associated array
portal is now the same across all devices. This means that almost all
exec objects no longer need to be specialized on the device types. Thus,
clean up the whole array exec objects to no longer need to be templated
on device.
2021-02-09 19:16:51 -07:00
Kenneth Moreland
4d8f05baef Update CellSetExtrude to not specify exec types by device
Somewhere during this edit I removed a header file that didn't strictly
need to be there. This caused me to have to add

```cpp
```

in several places in the code.
2021-02-08 16:57:16 -07:00
Kenneth Moreland
e0e24090a4 Correct argument check for benchmark --file argument
The condition was completely backwards so no file could ever be loaded.
2020-12-21 15:56:45 -07:00
Vicente Adolfo Bolea Sanchez
1add731eff BenchmarkFilters: Add Unstructured bench for Contour 2020-10-21 19:12:51 -04:00
Vicente Adolfo Bolea Sanchez
b22823a547 Contour: Zero-init arrays in Flying Edges
- It fixes a lingering error triggered with BenchContour
- It reenables BenchContour

Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2020-10-21 19:12:51 -04:00
Kenneth Moreland
28ecf3636d Change interface of atomic compare and swap
The old atomic compare and swap operations (`vtkm::AtomicCompareAndSwap`
and `vtkm::exec::AtomicArrayExecutionObject::CompareAndSwap`) had an
order of arguments that was confusing. The order of the arguments was
shared pointer (or index), desired value, expected value. Most people
probably assume expected value comes before desired value. And this
order conflicts with the order in the `std` methods, GCC atomics, and
Kokkos.

Change the interface of atomic operations to be patterned off the
`std::atomic_compare_exchange` and `std::atomic<T>::compare_exchange`
methods. First, these methods have a more intuitive order of parameters
(shared pointer, expected, desired). Second, rather than take a value
for the expected and return the actual old value, they take a pointer to
the expected value (or reference in `AtomicArrayExecutionObject`) and
modify this value in the case that it does not match the actual value.
This makes it harder to mix up the expected and desired parameters.
Also, because the methods return a bool indicating whether the value was
changed, there is an additional benefit that compare-exchange loops are
implemented easier.

For example, consider you want to apply the function `MyOp` on a
`sharedValue` atomically. With the old interface, you would have to do
something like this.

```cpp
T oldValue;
T newValue;
do
{
  oldValue = *sharedValue;
  newValue = MyOp(oldValue);
} while (vtkm::AtomicCompareAndSwap(sharedValue, newValue, oldValue) != oldValue);
```

With the new interface, this is simplfied to this.

```cpp
T oldValue = *sharedValue;
while (!vtkm::AtomicCompareExchange(sharedValue, &oldValue, MyOp(oldValue));
```
2020-10-20 08:39:22 -06:00
Vicente Adolfo Bolea Sanchez
a290de5bcc BenchmarkFilters: adds unstructured Dataset for some filters
- It also remove termination on bench error
- It disables passing fields in Countour to skip an error.

Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2020-10-07 18:46:36 -04:00
Kenneth Moreland
2e918c58dc Move ColorTable mapping to its own header
We would really like to be able to include `vtkm::cont::ColorTable` in
such a way that you don't have to compile device code (unless you are
actually compiling functions for the device). Thus, the `Map` functions
of `ColorTable` were in a special `ColorTable.hxx` that contains the
"implementation" for `ColorTable`.

That is confusing to many users. It is more clear to simply have `.h`
headers that do a specific thing. To achieve these two goals, the `Map`
functionality of `ColorTable` is separated out into its own header file.
So you don't need to be using a device compiler just to use `ColorTable`
(including `ColorTable.h`), but you do need to use a device compiler if
mapping values to colors (including `ColorTableMap.h`).
2020-09-14 16:40:26 -06:00
Kenneth Moreland
f7cc03107d Fix deprecated warnings
Supress the deprecated class warnings for the implementation of
deprecated features.
2020-09-09 06:13:07 -06:00
Kenneth Moreland
63ef84ed78 Optionally remove all use of ArrayHandleVirtual
As we remove more and more virtual methods from VTK-m, I expect several
users will be interested in completely removing them from the build for
several reasons.

1. They may be compiling for hardware that does not support virtual
methods.
2. They may need to compile for CUDA but need shared libraries.
3. It should go a bit faster.

To enable this, a CMake option named `VTKm_NO_DEPRECATED_VIRTUAL` is
added. It defaults to `OFF`. But when it is `ON`, none of the code that
both uses virtuals and is deprecated will be built.

Currently, only `ArrayHandleVirtual` is deprecated, so the rest of the
virtual classes will still be built. As we move forward, more will be
removed until all virtual method functionality is removed.
2020-09-04 22:52:45 -06:00
Dave Pugmire
d64deb00f2 rename vtkm::Massless to Particle 2020-08-26 12:44:17 -04:00
Kenneth Moreland
b5ed6e7257 Fix some conversion warnings
Fixes some compiler warnings that were missed on recent dashboards.
2020-08-25 08:30:44 -06:00
Kitware Robot
cf0cdcf7d1 clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
NAThompson
7b17e38892 Benchmark ODE integrators. 2020-08-18 15:47:13 -04:00
Kenneth Moreland
cb34cbbaf2 Make BenchmarkArrayTransfer actually benchmark transfers
Previously, most of the benchmarks just measured time spent reading or
writing the array on the device. The transfer only happened on the first
iteration and was then cached on the device.

This change clears out the array every iteration so that the array has
to be transferred afresh.
2020-08-04 09:16:46 -06: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
fbeea75f32 Print out all options to BenchmarkFilters
Previously, if you used the `--help` option, you would get VTK-m's
initialize options and Google benchmark's options, but you would not get
the special options for the algorithms in this benchmark. Now, all the
potential options should be printed when `--help` is added to the
command line.
2020-07-13 10:20:19 -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
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
0612be9c5b Move VTKDataSetReaderBase code to vtkm_io
Most of this code is not templated methods. Rather, it implements over
several types to call templated functions, which creates quite a bit of
code. Rather than have all code using a reader recompile the code, just
compile it once and put it in a library.
2020-05-19 12:27:01 -06:00
Kenneth Moreland
a20ec03d0b Disable proxies in filter benchmark
This is going to increase the compile time for the filter benchmark, but
the overall goal is to move this code into libraries. When that happens,
the benchmark will not have to compile any of the filter code and should
ultimately go much faster.
2020-05-18 13:03:14 -06:00
Kenneth Moreland
f9d9b536d4 Fix conversion warnings in benchmarks and examples
These are caused when using 32-bit Id's. Although there are some
benchmarks that test for this, some code in benchmarking and examples is
not covered by them.
2020-05-14 17:16:19 -06:00
Nick
b07797f12b Update benchmarking/Benchmarker.h 2020-05-08 11:17:06 -04:00
Nick
acc6f3fb08 Apply suggestion to benchmarking/Benchmarker.h 2020-05-08 11:17:06 -04:00
NAThompson
f1f021b51d Default units to milliseconds. 2020-05-08 11:17:06 -04:00
NAThompson
697369fc14 Remove deprecation warnings throughout the project. 2020-04-30 08:12:04 -04:00
Vicente Adolfo Bolea Sanchez
b05bd33d3c benchmarks: pass unparsed args to Google benchmark
- It also adds Google's benchmarch compare.py script
  - It is installed to the build directory.

- It add a wrapper script called compare-benchmarks.py which:
  - Let you run each of the benchmarks with different devices

- It adds a README.md explaining how to run the benchmarks

- BenchmarkDeviceAdapter input size range parametrized at compile time

Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2020-04-21 10:52:31 -04:00
Matt Larsen
d9cfb8687f Merge topic 'scalar_renderer'
33a154337 add deprecation
a7363c283 alter interface of scalar renderer result
5fc77cb58 warnings and store depth separately
aa468f5c0 more warning fixes
0943784c2 fix warning
094758e55 make result public?
70584ac8f fix benchmarks
458be65e9 fix logic error
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1962
2020-03-21 10:28:12 -04:00
Kenneth Moreland
ec34cb56c4 Use new ways to get array portal in control environment
Also fix deadlocks that occur when portals are not destroyed
in time.
2020-02-26 13:10:46 -07:00
Kenneth Moreland
ad0a53af71 Convert execution preparation to use tokens
Marked the old versions of PrepareFor* that do not use tokens as
deprecated and moved all of the code to use the new versions that
require a token. This makes the scope of the execution object more
explicit so that it will be kept while in use and can potentially be
reclaimed afterward.
2020-02-25 09:39:19 -07:00
Matt Larsen
aa468f5c00 more warning fixes 2020-02-17 20:09:51 -08:00
Matt Larsen
70584ac8f6 fix benchmarks 2020-02-17 19:46:59 -08:00
Kenneth Moreland
7e49c11313 Mark the find_package(benchmark) with required
Add the REQUIRED flag to the find_package command to find the Google
benchmark package. Without that flag, the find_package command will
happily pass if the benchmarks are not found.

However, if benchmarks is not found, then the CMake configure will then
fail because the benchmark::benchmark library is not defined. That is a
confusing error to get. Since benchmark is not a typical thing installed
on a system, this can be problematic.
2020-01-09 12:28:48 -07:00
Allison Vacanti
539f6e5ad7 Port benchmarking framework to Google Benchmark. 2020-01-08 10:58:51 -05:00
Kenneth Moreland
d5fe4046c5 Remove instances of ListTag in favor of List 2019-12-06 21:32:36 -07:00
Kenneth Moreland
92db376236 Convert uses of ListTagBase to List 2019-12-06 15:37:46 -07:00
Kenneth Moreland
cd302effb3 Update lists in TypeListTag.h
A new header named TypeList.h and the type lists have been redefined in
this new file. All the types have been renamed from `TypeListTag*` to
`TypeList*`. TypeListTag.h has been gutted to provide deprecated
versions of the old type list names.

There were also some other type lists that were changed from using the
old `ListTagBase` to the new `List`.
2019-12-05 11:05:19 -07:00