Commit Graph

5185 Commits

Author SHA1 Message Date
Kenneth Moreland
6feb0c3763 Remove invalid arrays when applying policies to fields
Previously when ApplyPolicyFieldOfType was used in cases where not all
of the types matched not all of the storages, those invalid arrays were
replaced with an ArrayHandleDiscard. This unnecessarily increased the
length of the type names used for the resulting ArrayHandleMultiplexer.

Now, ListTagRemoveIf is used to remove any invalid arrays so that the
resulting ArrayHandleMultiplexer only includes the valid arrays.
2019-11-02 11:08:09 -06:00
Kenneth Moreland
4c103e421a Add ListTagRemoveIf
Provides the ability to remove items from a list.
2019-10-31 14:32:17 -06:00
Kenneth Moreland
3b7b21c86d Do not use std::is_trivially_copyable on GCC 4.X
Although GCC 4.8 and 4.9 claim to be C++11 compliant, there are a few
C++11 features they do not support. One of these features is
std::is_trivially_copyable. So on these platforms, do not attempt to use
it. Instead, treat nothing as trivially copyable.
2019-10-30 16:15:44 -06:00
Kenneth Moreland
7518d0675c Try to fix uninitialized anonymous variable warning
The code from the previous commit was causing one of the dashboards,
which is using gcc-7, to produce the following warning:

In file included from ../testing/UnitTestVariant.cxx:11:0:
../Variant.h: In function 'void {anonymous}::TestCopyDestroy()':
../Variant.h:269:5: warning: '<anonymous>' may be used uninitialized in this function [-Wmaybe-uninitialized]
     this->Storage = std::move(rhs.Storage);
     ^~~~

At best, this warning is not helpful as it does not seem to point to
anything that could be used uninitialized. At worst, it might be a
compiler bug. A Google search finds a few similar bugs although none I
can assert with any confidence of this issue. However, many reported
bugs and issues point to the use of anonymous namespaces. So, I'm going
to attempt to fix the problem by removing anonymous namespaces.
Hopefully it will fix the warning or at least point me to something
concrete that I can fix.
2019-10-27 07:34:06 -06:00
Kenneth Moreland
5b18ffd770 Register Variant as trivially copyable if possible
The Variant template can hold any type. If it is holding a type that is
non-copyable, then it has to make sure that appropriate constructors,
copiers, movers, and destructors are called.

Previously, these were called even the Variant was holding a trivially
copyable class because no harm no foul. If you were holding a trivially
copyable class and did a memcpy, that work work, which should make it
possible to copy between host and device, right?

In theory yes, but in practice no. The problem is that Cuda is
outsmarting the code. It is checking that Variant is not trivially-
copyable by C++ semantics and refusing to push it.

So, change Variant to check to see if all its supported classes are
trivially copyable. If they are, then it use the default constructors,
destructors, movers, and copiers so that C++ recognizes it as trivially
copyable.
2019-10-26 22:53:43 -06:00
Kenneth Moreland
16305bd837 Add tests of ArrayHandleMultiplexer on multiple devices 2019-10-26 13:40:42 -06:00
Sujin Philip
5ca9a4bd5e Fix UnitTestError
The previous changes were incorrect and did not fix the problem.
2019-10-21 10:08:23 -04:00
Sujin Philip
5c13198407 Merge topic 'fix-dashboard-issues'
79f7f8275 Fix UnitTestError failure
901711bff Fix test failure due to floating point issues

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1896
2019-10-17 17:32:32 -04:00
Sujin Philip
79f7f82751 Fix UnitTestError failure
Compiler optimization may remove recursion and other function calls so we
cannot rely on the number of stack frames to be consistent.
2019-10-17 17:30:40 -04:00
Sujin Philip
901711bff4 Fix test failure due to floating point issues
Floating point precision issues are causing the Reduce algorithm of the OpenMP
backend to produce result that is off by more than 0.001.
2019-10-17 17:30:32 -04:00
Robert Maynard
0fccc5f2c4 improve moments algorithm performance 2019-10-17 11:51:05 -04:00
Kenneth Moreland
d3d3e441d7 Merge topic 'cell-metrix-missing-include'
677962f93 Add Matrix.h to cellmetrics include

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Hank <hank@uoregon.edu>
Merge-request: !1892
2019-10-14 17:01:32 -04:00
Robert Maynard
698df3353b Merge topic 'image_median_filters'
d47f7aaa2 Add an ImageMedian filter

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1890
2019-10-14 16:21:16 -04:00
Robert Maynard
d47f7aaa29 Add an ImageMedian filter 2019-10-14 16:09:44 -04:00
Robert Maynard
23f55ad0ef Merge topic 'algorithm-fill-fixes'
64dede748 Fix Compilation bug with Fill method

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Allison Vacanti <allison.vacanti@kitware.com>
Merge-request: !1889
2019-10-14 11:49:23 -04:00
Kenneth Moreland
677962f939 Add Matrix.h to cellmetrics include
This file was using the Matrix class but not including Matrix.h. When I
tried to use the MeshQuality filter in an example that did not include
Matrix.h on its own, I got a compile error.
2019-10-11 00:08:04 -04:00
Dave Pugmire
665f323db0 optimization for mask select for all masks active. 2019-10-10 16:56:26 -04:00
Sujin Philip
48927c6da3 Merge topic 'fix-lcl-dashboard'
0bb8cbf42 Fix CellLocatorUniformBins test
169049143 Merge branch 'upstream-lcl' into fix-lcl-dashboard
e7cf79a93 lcl 2019-10-09 (d7604cbf)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1888
2019-10-10 08:32:29 -04:00
nadavi
64dede7486 Fix Compilation bug with Fill method 2019-10-09 16:07:43 -06:00
Robert Maynard
1de5774d57 Merge topic 'just_infer_execution_signature'
cf2d62fb9 Remove unneeded ExecutionSignatures
c3f0060cc ExecutionSignatures are now optional for simple worklets
1b08521fa Merge branch 'upstream-taotuple'
c6d309566 taotuple 2019-10-08 (0d1e4dfd)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1882
2019-10-09 15:44:36 -04:00
Robert Maynard
cf2d62fb90 Remove unneeded ExecutionSignatures 2019-10-09 14:56:07 -04:00
Sujin Philip
0bb8cbf420 Fix CellLocatorUniformBins test 2019-10-09 13:55:55 -04:00
Allison Vacanti
c68919fcc9 Merge topic 'msvc2019_intseq_fix'
56b4fa9a3 MSVC 2019 needs a different integer sequence impl, too.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1887
2019-10-09 11:12:08 -04:00
Sujin Philip
169049143c Merge branch 'upstream-lcl' into fix-lcl-dashboard
* upstream-lcl:
  lcl 2019-10-09 (d7604cbf)
2019-10-09 11:05:19 -04:00
Allison Vacanti
56b4fa9a31 MSVC 2019 needs a different integer sequence impl, too. 2019-10-09 10:49:50 -04:00
Dave Pugmire
eb97223ebe Merge topic 'fix_smallStep_integrator'
c41bf99b8 Adjust tolerance
2554de785 Fix tolerance for unittest.
9e486e075 Fix for smallStep in integrator.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1879
2019-10-09 10:26:15 -04:00
Dave Pugmire
c41bf99b8a Adjust tolerance 2019-10-08 13:01:31 -04:00
Dave Pugmire
2554de7858 Fix tolerance for unittest. 2019-10-08 12:48:05 -04:00
Brad King
16184e360f Merge topic 'update-vtkc-to-lcl'
b0592ce4 Switch from VTK-c to LCL
f7dced89 Merge branch 'upstream-lcl' into update-vtkc-to-lcl
0582b710 lcl 2019-10-07 (49094fec)
d0c6d161 Add update script for LCL

Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1884
2019-10-08 11:46:30 -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
Robert Maynard
1b08521fab Merge branch 'upstream-taotuple'
* upstream-taotuple:
  taotuple 2019-10-08 (0d1e4dfd)
2019-10-08 11:13:51 -04:00
Robert Maynard
c6442a1db3 Merge topic 'all_filters_include_hxx_file'
0e9253289 VTK-m filters now have a consistent set of header guards

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1886
2019-10-08 11:08:47 -04:00
Robert Maynard
0e9253289f VTK-m filters now have a consistent set of header guards 2019-10-08 10:39:59 -04:00
Sujin Philip
b0592ce4c8 Switch from VTK-c to LCL 2019-10-07 15:38:36 -04:00
Sujin Philip
f7dced892f Merge branch 'upstream-lcl' into update-vtkc-to-lcl
* upstream-lcl:
  lcl 2019-10-07 (49094fec)
2019-10-07 15:37:55 -04:00
Sujin Philip
d0c6d16123 Add update script for LCL 2019-10-07 15:37:34 -04:00
Allison Vacanti
1081be53bc Fix unused argument warning.
typeid doesn't use the object, just the type.
2019-10-07 13:48:45 -04:00
Kenneth Moreland
be03d1c2b5 Merge topic 'xcode-9-issues'
c0744dbb4 Fix compile error for Xcode 9

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1880
2019-10-04 18:19:17 -04:00
Allison Vacanti
62ffa73cdd Workaround issue with older C++.
Error: https://open.cdash.org/viewBuildError.php?buildid=6143613
Defect: http://open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#253
2019-10-04 15:16:30 -04:00
Kenneth Moreland
c0744dbb49 Fix compile error for Xcode 9
The older Xcode 9 compiler has troubles with ArrayHandleDecorator that
are similar to those of earlier Microsoft and Cuda compilers.

Note that the logic behind the changed compiler check has a lot of
guesswork involved. I noticed this problem on a laptop with Xcode 9
installed. However, even though Xcode uses the clang compiler, it
notoriously does not return the actual clang version. Instead, it
returns some toolchain version that has nothing to do with it. I'm
pretty sure Xcode 9 is using clang version 4 under the covers, but
__clang_major__ reports 9. Oddly, Xcode 10 reports __clang_major__ as 8,
so that's not too much help. So instead, we check for
__apple_build_version__, which returns the Xcode version (sort of) and
that seems a reasonable comparison.

Although I have not tried it, I'm willing to bet that the older clang
outside of Xcode will also have issues. Here is where the real guesswork
takes place since I don't have handy compilers to try. Like I said, I
think the internet claims that Xcode 9 is using clang 4, so also add to
the check any compiler that reports itself clang 4 or below.
2019-10-04 11:32:07 -06:00
Dave Pugmire
9e486e075b Fix for smallStep in integrator. 2019-10-04 08:59:28 -04:00
Robert Maynard
308552bd62 Merge topic 'improve_connectivity_worklet_perf'
973878b8b Improve the performance of the Image and Graph Connectivity algorithms

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Li-Ta Lo <ollie@lanl.gov>
Merge-request: !1873
2019-10-02 11:41:57 -04:00
Kenneth Moreland
e9c5bcb7d1 Merge topic 'device-log-level'
8c5b76f76 Remove invalid device argument for unit tests
2ca37707e Update logging for enabled devices

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1877
2019-10-02 11:30:04 -04:00
Robert Maynard
973878b8ba Improve the performance of the Image and Graph Connectivity algorithms
The collection of connectivity algorithms had a couple of inefficiencies.
By moving to using WorkId we can remove a couple of arrays of the same size
as the input domain. In addition by moving to using atomics we can remove
an bool output array with a size equivalent to the input domain and
a call to reduce.
2019-10-02 08:25:10 -04:00
Robert Maynard
46212490b1 Merge topic 'CellSetConnectivity_filter_correct_inheritance'
25fb666df CellSetConnectivity now inherits from FilterDataSet

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Acked-by: Li-Ta Lo <ollie@lanl.gov>
Merge-request: !1870
2019-10-01 15:44:05 -04:00
Allison Vacanti
43e2b5498d Merge topic '408_CSExplicit_Refactor'
3886b7dfb Refactor CellSetExplicit to remove NumIndices.
b2daec0e3 Stick with brigand sequences for CUDA device passes.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1874
2019-10-01 09:43:33 -04:00
Kenneth Moreland
2ca37707e0 Update logging for enabled devices
The previous implementation of `RuntimeDeviceTracker` occasionally
outputted a log at level `Info` about devices being enabled or disabled.
The problem was that the information given was inconsistent (so it would
sometimes announce one change but not announce a different corrective
change). This could cause weird confusions. For example, when you used a
`ColorTable`, it would use a `ScopedRuntimeDeviceTracker` to temporarily
force the device to `Serial`. The log will just tell you that the device
was forced to `Serial` but never tell you that the devices where
restored to include actual parallel devices.

This change helps correct these with the following changes:

* Added a new log level, `DevicesEnabled`, that is a higher level than
  `Info`. All logging from `RuntimeDeviceTracker` goes to this log
  level.
* Change the logging output of `RuntimeDeviceTracker` to output a list
  of currently enabled devices whenever a change happens. That way you
  don't have to guess what happend for each change.
* Change `ScopedRuntimeDeviceTracker` to log whenever the scope is
  entered or left.
2019-09-30 14:07:24 -06:00
Allison Vacanti
3886b7dfb8 Refactor CellSetExplicit to remove NumIndices.
See #408 for details.
2019-09-30 12:27:13 -04:00
Robert Maynard
0ca6023650 Merge topic 'mask_supported_by_invoker'
445e4d818 vtkm::cont::Invoker supports both Masks and Scatter

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1876
2019-09-30 12:03:31 -04:00
Robert Maynard
25fb666df9 CellSetConnectivity now inherits from FilterDataSet
Fixes #409
2019-09-30 08:50:40 -04:00