Commit Graph

6808 Commits

Author SHA1 Message Date
Abhishek Yenpure
da19ea2ee1 Removing unnecessesary header ImplicitFunctionHandle 2021-08-10 16:31:40 -07:00
Abhishek Yenpure
b185944d3f Adding fixes from Ken's review 2021-08-10 16:17:11 -07:00
Abhishek Yenpure
1a3a139f4a Updating portal types to newer 1.6 requirements 2021-08-10 13:36:37 -07:00
Abhishek Yenpure
7f4b66d057 Adding MIR filter
-- Adding MIR filter and tables for material reconstruction
2021-08-05 15:15:28 -07:00
Dave Pugmire
82f5b5ebcf Merge topic 'threaded_filters'
0ea4470f1 Simplify the code a little.
179643107 Cleanup. remove prints.
50a42a144 Forgot to add header to CMakeLists.txt
f8021dbc0 Add threaded filters for multiblock dataset.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2548
2021-08-05 14:59:38 -04:00
Dave Pugmire
0ea4470f19 Simplify the code a little. 2021-08-05 12:16:33 -04:00
Dave Pugmire
179643107b Cleanup. remove prints. 2021-08-05 11:50:34 -04:00
Dave Pugmire
50a42a1447 Forgot to add header to CMakeLists.txt 2021-08-05 10:44:54 -04:00
Dave Pugmire
f8021dbc0d Add threaded filters for multiblock dataset. 2021-08-04 14:27:41 -04: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
Dave Pugmire
6f8d1466bc Fixes for compiler warnings. 2021-08-04 12:25:55 -04:00
Dave Pugmire
bde0672a4c Merge topic 'fix_smallstep_advection'
39054e644 Add corner case unit test.
0a3fd2629 Add test file for corner case.
4b0896bd8 Fix for corner case in particle advection.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Abhishek Yenpure <abhishek@uoregon.edu>
Merge-request: !2545
2021-08-04 07:10:35 -04:00
Dave Pugmire
39054e644f Add corner case unit test. 2021-08-03 21:40:28 -04:00
Dave Pugmire
4b0896bd8c Fix for corner case in particle advection. 2021-08-02 13:39:32 -04:00
Kenneth Moreland
869535b23f Remove uses of ScopedCudaStackSize
Since we have (hopefully) gotten rid of all unbounded recursion and
calls to function pointers or virtual methods, the CUDA compiler should
be able to statically determine the size of the stack needed. Thus, we
shouldn't need `ScopedCudaStackSize` at all.

However, there is one odd case where using it seems to be necessary. It
is unclear why, but that is an issue for another day.
2021-08-02 09:53:02 -06:00
Kenneth Moreland
4bf8bfb1fa Deprecate KdTree3D worklets
The implementation of the search in the k-d tree is problematic because
it uses unbounded recursion. This is a problem for GPU devices, which
have very short stacks set by how many calls the compiler determines.
This is fixable, but the fix is not trivial.

This class is not used anywhere in VTK-m other than a trivial test.
Thus, I am just deprecating the class. I am also deleting the test, so
the code is not run anymore.
2021-08-02 09:50:41 -06:00
Kenneth Moreland
5fa402ac28 Remove recursion from FloatDistance
The maximum recursion that could happen was 1 call in, but compilers had
trouble determining that. Split this into 2 non-recursive functions so
the compiler can easily determine the stack depth.
2021-08-02 09:50:41 -06:00
Kenneth Moreland
822eb8f165 Merge topic 'copy-runtime-state'
624117963 Add RuntimeDeviceTracker::CopyState

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Li-Ta Lo <ollie@lanl.gov>
Merge-request: !2540
2021-07-29 10:37:52 -04:00
Kenneth Moreland
3b9e028a5e Merge topic 'deprecate-arrayhandle-getdeviceadapterid'
34615a985 Deprecate ArrayHandle::GetDeviceAdapterId

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Li-Ta Lo <ollie@lanl.gov>
Merge-request: !2534
2021-07-29 10:37:05 -04:00
Kenneth Moreland
6241179631 Add RuntimeDeviceTracker::CopyState
It is sometimes the case that you want to copy the state of one
`RuntimeDeviceTracker` to another. This is particularly the case when
creating threads in the control environment. Each thread has its own
copy of `RuntimeDeviceTracker`, so when you spawn a thread you probably
want to copy the state of the tracker from the calling thread.
2021-07-28 13:16:12 -06:00
Kenneth Moreland
34615a9858 Deprecate ArrayHandle::GetDeviceAdapterId
This method is a remenant of when `ArrayHandle` could only store data on
one device at a time. It is now capable of storing data on any number of
devices (as well as the host), so asking for "the" device no longer
makes sense. Thus, this method is deprecated in favor of
`ArrayHandle::IsOnDevice`.

This deprecation leads to fixing some older functionality that still
assumed data could only be on one device at a time.

Fixes #592.
2021-07-28 12:51:51 -06:00
Kenneth Moreland
bf6d6ca517 Merge topic 'shallow-array-copy'
1fb114172 Update code to use ArrayCopyShallowIfPossible
5c36eafe5 Add ArrayCopyShallowIfPossible

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Li-Ta Lo <ollie@lanl.gov>
Merge-request: !2529
2021-07-21 11:29:48 -04:00
Gunther H. Weber
f9eab2eeec Replace STL exception in contour tree with VTKM exception 2021-07-15 14:00:23 -07:00
Kenneth Moreland
1fb1141723 Update code to use ArrayCopyShallowIfPossible
There were several places in the code that had to check the type of an
`UnknownArrayHandle` and conditionally get or copy that array. This code
is simplified by using `ArrayCopyShallowIfPossible`.
2021-07-15 08:53:52 -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
Gunther Weber
6c7a062b01 Merge topic 'contour-tree-performance-improvements'
851c32718 Clean-up 0f CopyArrayByIndices and CopyVecArrayByIndices helpers
89fc3be8f Changed comment style to avoid warning
17caf7f3a Fixed incorrect filename in CMakeLists.txt
c3b3c44eb Update CMakeLists.txt
b625ef7db Removed helper function for debugging
dffb7afbc Clean-up. Move functor class outside template.
51f737041 Clean-up. Move functor class outside template.
749232665 Added missing const qualifier
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2443
2021-07-14 13:04:06 -04:00
Gunther Weber
fa0ce37b96 Merge topic 'add/ct_iter_check'
ca86402f9 Provide additional debug info in case contour tree hangs
48d91b99f Throw exception if merge tree gets stuck in a loop
c7ea03ee2 Throw exception if contour tree gets stuck in a loop

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2420
2021-07-13 21:29:04 -04:00
Sujin Philip
c5b72c9d97 Merge topic 'fix-cuda-interop'
8d62bf128 Fix cuda-opengl interop

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2528
2021-07-13 10:48:25 -04:00
Kenneth Moreland
f883b5e036 Avoid divide by zero in rendering TriangleIntersections 2021-07-12 11:23:24 -06:00
Kenneth Moreland
ede7756929 Allow for empty Z bounds in ResetToBounds
If the camera is not a 3D camera, then it might be the case that the
calling code has not set the bounds in the Z direction. Allow this to
happen as long as you are not using a 3D camera.
2021-07-12 10:57:19 -06:00
Kenneth Moreland
4c1514bb3a Fix divide by zero in CanvasRayTracer
The divide by zero happened when mapping a surface to a depth buffer.
Some rays terminated at the origin, which is a singularity in the
project matrix.

This might be indicative of a larger problem. Rays really shouldn't
terminate before the near plane.
2021-07-12 10:29:46 -06:00
Kenneth Moreland
83369ed95a Remove unused fields from Ortho2DRayGen
There were apparently some fields copy/pasted from the 3D version were
not used in the 2D version (probably because they had no meaning). In
one case, one was erroneously normalized, and could cause a floating
point exception.
2021-07-12 10:29:46 -06:00
Kenneth Moreland
c1a790db2d Fix BIH split calculations for empty regions
When computing the cost for splitting, if a regions was empty you would
get a floating point error when multiplying the (invalid) region bound
(inf or -inf) with the number of points (0). It would then check for NaN
costs and reset that. This worked but caused a floating point exception,
which is problematic for some users.

Instead, check for empty regions before computing the cost and reset the
cost that way.
2021-07-12 10:29:46 -06:00
Kenneth Moreland
9ce97352d9 Fix divide-by-zero in UnitTestCellInterpolate 2021-07-12 10:29:46 -06:00
Kenneth Moreland
e4ae3cee1b Avoid floating point exception in Orthonormalize 2021-07-12 10:29:46 -06:00
Kenneth Moreland
f74a2239eb Break LUP factorization when invalid matrix found
Singular matrices cannot be LUP factorized, so this condition is
detected and returned in a `valid` flag. However, when the detection
happened, the rest of the computation continued to happen. This could
lead to floating point exceptions, which some applications do not like.
So, when an invalid array is detected, return immediately.
2021-07-12 10:29:46 -06:00
Kenneth Moreland
6447b17303 Disable floating point exception traps when testing NaNs
Some functions are supposed to behave correctly when given a NaN. This
might only be valid if floation point exceptions are not trapped, so
disable trapping for these tests.
2021-07-12 10:29:45 -06:00
Kenneth Moreland
b01ca530b8 Turn on floating point exception trapping for GCC in tests
Some simulations trap floating point exceptions to ensure that their
code is working correctly, and we want VTK-m to work correctly in their
code. To check this, we want to turn on floating point exception
trapping in our test code. This is very implementation-specific, so for
now we are just turning it on for GCC. This will at least alert a
problem on some of the dashboards.
2021-07-12 10:29:37 -06:00
Sujin Philip
8d62bf1286 Fix cuda-opengl interop
1. Use cudaPerThreadStream instead of the default streams
2. Since there have been changes to ArrayHandle code, the API to create
ArrayHandle from a device pointer has changed.
2021-07-12 10:32:44 -04:00
Kenneth Moreland
80d622cd92 Merge topic 'unknown-array-better-allocate'
8d7cf2c85 Support all Allocate flags in UnknownArrayHandle

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Li-Ta Lo <ollie@lanl.gov>
Merge-request: !2522
2021-06-30 14:06:18 -04:00
Gunther H. Weber
851c327188 Clean-up 0f CopyArrayByIndices and CopyVecArrayByIndices helpers 2021-06-28 15:44:44 -07:00
Gunther H. Weber
89fc3be8fa Changed comment style to avoid warning 2021-06-28 15:44:44 -07:00
Gunther H. Weber
17caf7f3a4 Fixed incorrect filename in CMakeLists.txt 2021-06-28 15:44:44 -07:00
Gunther H. Weber
c3b3c44eb1 Update CMakeLists.txt 2021-06-28 15:44:44 -07:00
Gunther H. Weber
b625ef7dbd Removed helper function for debugging 2021-06-28 15:44:44 -07:00
Gunther H. Weber
dffb7afbcd Clean-up. Move functor class outside template. 2021-06-28 15:44:44 -07:00
Gunther H. Weber
51f737041b Clean-up. Move functor class outside template. 2021-06-28 15:44:44 -07:00
Gunther H. Weber
749232665b Added missing const qualifier 2021-06-28 15:44:44 -07:00
Gunther H. Weber
32dcd3d0c5 Refactor merging to be restricted to only common vertices 2021-06-28 15:44:44 -07:00