Commit Graph

6704 Commits

Author SHA1 Message Date
Nick Thompson
a8e25da0ab Add __func__ to unit test metadata printed on failure. 2021-04-12 12:54:38 -04:00
Kenneth Moreland
49d6200413 Merge topic 'deprecate-variant-array-handle'
14839a032 Fix deprecation warnings with MSVC
5510521a0 Fix VariantArrayHandle::AsVirtual with cast arrays
25e6daf93 Add changelog for depreciating VariantArrayHandle
b4ef9fcac Fix UnknownArrayHandle::CastAndCall for special arrays
68f39b86a Deprecate VariantArrayHandle

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Sujin Philip <sujin.philip@kitware.com>
Merge-request: !2459
2021-04-12 10:15:08 -04:00
Nick Thompson
d4ead2d767 Remove superfluous subbraces. 2021-04-08 16:23:42 -04:00
Nick Thompson
a7ecd30cdd Commute #ifdef with braces to make clang-format happy. 2021-04-08 16:23:42 -04:00
Nick Thompson
dd8863637a Return a vec<T,2> rather than a vtkm::Pair<T,T>. 2021-04-08 16:23:42 -04:00
Nick Thompson
91bec19e97 Additional comments and fix typo in unit test. 2021-04-08 16:23:42 -04:00
Nick Thompson
6f9515aa94 Quadratic roots to 3 ulps. 2021-04-08 16:23:42 -04:00
Kenneth Moreland
14839a0325 Fix deprecation warnings with MSVC 2021-04-08 09:28:03 -06:00
Kenneth Moreland
5510521a06 Fix VariantArrayHandle::AsVirtual with cast arrays
The both the underlying `UnknownArrayHandle` and `ArrayHandleVirtual`
handle `ArrayHandleCast` specially. This caused problems when passing an
`ArrayHandleCast` to `VariantArrayHandle::AsVirtual`. Solve the problem
by stripping out the cast storage tags and letting these classes handle
it internally.

It's annoying to have to fix a problem in a method of a deprecated class
that returns another class that is deprecated for a different reason. No
one should really be running this.
2021-04-08 09:21:39 -06:00
Kenneth Moreland
b4ef9fcac3 Fix UnknownArrayHandle::CastAndCall for special arrays
`UnknownArrayHandle` treats a `ArrayHandleCast` and
`ArrayHandleMultiplexer` special. When you put one of these arrays in an
`UnknownArrayHandle`, it takes the original array out and stores it. If
you try to take an array of that type out, it will again do the proper
conversion.

The only problem is that if you use `IsType`, the result can be
unexpected. This is what happened with `CastAndCall`, which was using
`IsType` internally. Changed that to `CanConvert` to properly get the
array handle out.
2021-04-07 16:12:42 -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
Nickolas Davis
21b36a6429 Merge topic 'rename-algorithms'
1c9ae402b Deprecate vtkm/BinarySearch.h, it is unused and similar to LowerBound
26d9ecb39 split vtkm/Algorithms.h into UpperBound.h, LowerBound.h, and BinarySearch.h

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@acm.org>
Merge-request: !2455
2021-04-07 17:08:34 -04:00
Li-Ta Lo
f2a4361c03 Merge topic 'alpine_sampling_2d'
ed8d2fb35 Merge branch 'master' into alpine_sampling_2d
93b8ee97d Pasing range explicitly to NDHistogram worklet for ALPINE 2D sampling milestone

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Li-Ta Lo <ollie@lanl.gov>
Merge-request: !2257
2021-04-07 16:10:09 -04:00
nadavi
1c9ae402b0 Deprecate vtkm/BinarySearch.h, it is unused and similar to LowerBound 2021-04-07 19:10:28 +00:00
nadavi
26d9ecb398 split vtkm/Algorithms.h into UpperBound.h, LowerBound.h, and BinarySearch.h 2021-04-07 18:53:09 +00:00
nadavi
7f86a16b37 add missing include 2021-04-07 17:54:34 +00:00
Nick Thompson
b00f5b4430 Merge topic 'diff_of_products'
068399b81 Fix build errors on Windows and compiler warnings on Ubuntu.
8d54138d3 Kahan's difference of products algorithm

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@acm.org>
Merge-request: !2460
2021-04-07 09:11:44 -04:00
Nick Thompson
068399b817 Fix build errors on Windows and compiler warnings on Ubuntu. 2021-04-07 08:09:39 -04:00
Nick Thompson
8d54138d3e Kahan's difference of products algorithm 2021-04-05 15:20:56 -04:00
Kenneth Moreland
294a30fd7e Check that all execution objects are trivially copyable
When the dispatcher does it's "transport" phase, it returns an
"execution object", but this object is held in the control environment
(on the host) although it may point to resources in the execution
environment (on the device). For this object to get from host to device,
it must be trivially copyable. If it is not, compile and/or runtime
errors could occur. So force this condition with a static assert.
2021-04-02 07:37:26 -06:00
Kenneth Moreland
3813fb515c Make ArrayPortalRecombineVec trivially copyable
Using this internal class is a bit tricky because it requires a pointer
to a C array that is expected to contain portals. Both the C array and
the portals must be defined for the expected device. This is already
handled by the associated Storage. Assuming all of this holds, make sure
the `ArrayPortalRecombineVec` is trivially copyable. This is a
requirement for passing objects to the execution environment.
2021-04-02 07:37:26 -06:00
Kenneth Moreland
2bd4805fe0 Merge topic 'variant-safe-punning2'
6921b5cc3 Minor style changes in UnitTestVariant
6ccb32d27 Slight comment changes
647bc94fe Reduce the number of lines required to implement Variant::CastAndCall
991eeba9f Reduce the number of lines required to implement VariantUnion
7607736ef Reduce the number of lines required to implement AllTrivially*
9816c422b Add padding to Grid struct in CellLocatorTwoLevel
e480fd7a2 Support copying a Variant to itself
d2d9ba332 Make connectivity structures trivially copyable
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2444
2021-04-01 18:04:30 -04:00
Kenneth Moreland
6921b5cc3d Minor style changes in UnitTestVariant 2021-04-01 14:47:51 -06:00
Kenneth Moreland
6ccb32d27b Slight comment changes 2021-03-31 14:35:06 -06:00
Nickolas Davis
46c2af2997 Merge topic 'remove-render-annotations'
a683a8802 add support for removing annotations and remove from regression tests

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Matt Larsen <larsen30@llnl.gov>
Merge-request: !2433
2021-03-31 15:38:56 -04:00
nadavi
a683a8802a add support for removing annotations and remove from regression tests 2021-03-31 17:08:46 +00:00
Kenneth Moreland
647bc94fed Reduce the number of lines required to implement Variant::CastAndCall 2021-03-31 09:49:40 -06:00
Kenneth Moreland
991eeba9f3 Reduce the number of lines required to implement VariantUnion 2021-03-30 14:35:44 -06:00
Kenneth Moreland
7607736ef4 Reduce the number of lines required to implement AllTrivially* 2021-03-30 14:05:53 -06:00
Kenneth Moreland
9816c422b1 Add padding to Grid struct in CellLocatorTwoLevel
There appears to be a bug in CUDA 9.2 where if you have a class that
contains a struct that itself has to have padding in the middle for
alignment purposes and you then put that class in a union with other
classes, it seems like that padding can cause problems with other
objects in the union.
2021-03-30 12:59:07 -06:00
Kenneth Moreland
e480fd7a24 Support copying a Variant to itself 2021-03-30 12:59:07 -06:00
Kenneth Moreland
d2d9ba3321 Make connectivity structures trivially copyable
It always worked to trivially copy these classes, but the compiler did
not think so because copy constructors were defined. Change these
constructors to be default so that the compler can properly check
triviality.
2021-03-30 12:59:07 -06:00
Kenneth Moreland
cad5dc7b71 Avoid is_trivially_copyable on VariantUnion
For some reason some versions of the CUDA compiler would return true for
`is_trivially_copyable` on a `VariantUnion` even when the types of the
union caused the copy constructor to get deleted.

Solve the problem by using `AllTriviallyCopyable` instead of directly
caling `is_trivially_copyable` on the union.
2021-03-30 12:58:57 -06:00
Kenneth Moreland
cb60401a63 Use specialized class instead of function overload for Variant::Get
Nvcc was having troubles resolving the return type of the overloaded
function to get a value out of a `VariantUnion`. Replace the
implementation with a class with specializations. This is more verbose,
but easier on the compiler.
2021-03-30 10:16:16 -06:00
Kenneth Moreland
c9bcdd0195 Use a union in Variant for safe type punning
Create a `VaraintUnion` that is an actual C++ `union` to store the data
in a `Variant`.

You may be asking yourself, why not just use an `std::aligned_union`
rather than a real union type? That was our first implementation, but
the problem is that the `std::aligned_union` reference needs to be
recast to the actual type. Typically you would do that with
`reinterpret_cast`. However, doing that leads to undefined behavior. The
C++ compiler assumes that 2 pointers of different types point to
different memory (even if it is clear that they are set to the same
address). That means optimizers can remove code because it "knows" that
data in one type cannot affect data in another type. To safely change
the type of an `std::aligned_union`, you really have to do an
`std::memcpy`. This is problematic for types that cannot be trivially
copied. Another problem is that we found that device compilers do not
optimize the memcpy as well as most CPU compilers. Likely, memcpy is
used much less frequently on GPU devices.
2021-03-30 10:16:16 -06:00
Kenneth Moreland
26d5168b4d Fix types used for coordinates in ArrayRangeCompute
Was using scalar types for `ArrayRangeCompute` for storage of types like
Cartesian product. It should be `Vec3` types.
2021-03-30 09:37:34 -06:00
Kenneth Moreland
eadaf06f0c Set what string in Error::SetMessage
`vtkm::cont::Error` inherits from `std::exception`. As such, it has a
special `what` string that reports an error message in a standard way.
This is particularly useful when a `vtkm::cont::Error` exception remains
uncaught because the system will print the `what` string before
crashing.

Unfortunately, the `what` string was only being set in the `Error`
constructor that took a message. That is a problem for subclasses like
`ErrorCuda` that used the default constructor and then used
`SetMessage`. The `what` string did not get set in this case.

Change the behavior to capture the stack trace in the default
constructor and update the `what` string if a subclass uses
`SetMessage`.
2021-03-29 06:04:22 -06:00
Abhishek Yenpure
43400995dd Merge topic 'particle_adv_virtuals_removal'
b316cf58f Fix compiler warnings
5f7287bc1 Removing virtuals from particle advection
2897b7a11 Fix missing include
4c781374c Removing virtuals v1

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@acm.org>
Merge-request: !2445
2021-03-25 17:26:19 -04:00
Kenneth Moreland
d1dba170e8 Do not use volatile when calling CUDA atomicCAS
Although it makes sense to assume a pointer is `volatile` when doing an
atomic operation, the arguments to the `atomicCAS` overloads take
regular pointers. The overload resolution can fail if you use the
`volatile` keyword.
2021-03-25 10:11:44 -06:00
Nickolas Davis
6f612107d0 Merge topic 'support-subdir-data-folders'
268e882c9 raise allowed num of error pixels a bit
78e3cbb50 Move regression test images into subdirs, implement io library support
d25453165 Implement additional wireframer rendering regression tests

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@acm.org>
Merge-request: !2442
2021-03-24 20:15:18 -04:00
nadavi
268e882c97 raise allowed num of error pixels a bit 2021-03-24 22:57:32 +00:00
nadavi
78e3cbb501 Move regression test images into subdirs, implement io library support 2021-03-24 22:57:32 +00:00
Abhishek Yenpure
b316cf58fc Fix compiler warnings 2021-03-24 15:51:26 -07:00
Subhashis Hazarika
ed8d2fb356 Merge branch 'master' into alpine_sampling_2d 2021-03-24 14:08:10 -06:00
Abhishek Yenpure
5f7287bc1b Removing virtuals from particle advection
-- Removing virtuals from CellInterpolationHelpers
2021-03-23 22:27:28 -07:00
Li-Ta Lo
197a9b3ff9 fixed an oversight on the correct way to get CoordinateSystem. 2021-03-23 15:31:55 +00:00
Li-Ta Lo
e95d922408 Merge topic 'particle_density_cic'
508b992cb Merge branch 'particle_density_cic' of gitlab.kitware.com:ollielo/vtk-m into particle_density_cic
056ee7269 fixed another copy paste bug
f71a01b39 Fixed misunderstanding of tolerance.
afe0a3e5f correct uncareful search and replace error
b3c6ea396 install ParticleDensityBase.h
7b8cc401c public CUDA
6796b1a45 consolidate two particle density filters
4a22f54bd Merge branch 'master' into particle_density_cic
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@acm.org>
Merge-request: !2434
2021-03-23 11:14:57 -04:00
Abhishek Yenpure
2897b7a118 Fix missing include 2021-03-22 23:53:05 -07:00
Abhishek Yenpure
4c781374c2 Removing virtuals v1
-- Remove virtuals from Integrators, Fields, Particles
-- Remaining virtuals are in the CellInterpolationHelpers
2021-03-22 23:00:36 -07:00
Matt Larsen
b64502e22d Merge topic 'identify_xl'
292ac2e4c clang is not is_trivially safe
8e588504f Merge branch 'identify_xl' of gitlab.kitware.com:mclarsen/vtk-m into identify_xl
9c5396394 Merge remote-tracking branch 'upstream/master' into identify_xl
8d8228f36 correct type in comment
4d7a08c18 add xl compiler identification

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@acm.org>
Merge-request: !2440
2021-03-20 13:00:53 -04:00
Li-Ta Lo
508b992cb4 Merge branch 'particle_density_cic' of gitlab.kitware.com:ollielo/vtk-m into particle_density_cic 2021-03-19 14:39:08 -06:00
Li-Ta Lo
056ee7269c fixed another copy paste bug 2021-03-19 12:48:51 -06:00
Li-Ta Lo
f71a01b39c Fixed misunderstanding of tolerance. 2021-03-19 14:31:01 +00:00
Li-Ta Lo
afe0a3e5fe correct uncareful search and replace error 2021-03-19 08:21:21 -06:00
Li-Ta Lo
b3c6ea396d install ParticleDensityBase.h 2021-03-18 17:07:52 -06:00
Li-Ta Lo
7b8cc401c2 public CUDA 2021-03-18 17:05:22 -06:00
Li-Ta Lo
6796b1a453 consolidate two particle density filters 2021-03-18 16:44:23 -06:00
nadavi
d254531657 Implement additional wireframer rendering regression tests 2021-03-18 16:26:07 +00:00
Li-Ta Lo
4a22f54bdf Merge branch 'master' into particle_density_cic 2021-03-17 17:54:21 -06:00
Li-Ta Lo
8875645da1 Merge topic 'particle_density'
7572699b2 fix compiler warning
f57677081 did I miss more float?
e8d3325d8 use FloatDefault for density
1222ce5f9 override PrepareForExecution
59897dc31 add a missing word
45dd24ad7 reinstitute the counting of particles
d25eb7de7 more doc on the selection of scalar field and DivideByVolume
ff73723f5 fine tune the doc on the filter
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Li-Ta Lo <ollie@lanl.gov>
Acked-by: Kenneth Moreland <kmorel@acm.org>
Merge-request: !2441
2021-03-17 19:52:13 -04:00
Li-Ta Lo
7572699b22 fix compiler warning 2021-03-17 16:31:57 -06:00
Li-Ta Lo
f57677081b did I miss more float? 2021-03-17 15:06:44 -06:00
Li-Ta Lo
e8d3325d8f use FloatDefault for density 2021-03-17 14:35:24 -06:00
Li-Ta Lo
1222ce5f93 override PrepareForExecution 2021-03-17 10:02:47 -06:00
Li-Ta Lo
59897dc31d add a missing word 2021-03-17 09:08:39 -06:00
Li-Ta Lo
45dd24ad71 reinstitute the counting of particles 2021-03-17 08:51:37 -06:00
Li-Ta Lo
d25eb7de7e more doc on the selection of scalar field and DivideByVolume 2021-03-17 08:00:35 -06:00
Li-Ta Lo
ff73723f51 fine tune the doc on the filter 2021-03-17 07:29:45 -06:00
Li-Ta Lo
ac3ff08238 more documentation, use GetDataAsMultiplexer() 2021-03-16 18:18:20 -06:00
Li-Ta Lo
f2421b4a76 add void 2021-03-16 16:01:59 -06:00
Li-Ta Lo
461f2b03d2 add comments and DivideByVolume as suggested by Ken 2021-03-16 15:54:09 -06:00
Li-Ta Lo
9fbb916a00 Merge topic 'fp_atomics2'
b590a8ebb Add floating point atomics

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@acm.org>
Merge-request: !2438
2021-03-16 14:06:24 -04:00
Nick Thompson
d815493986 Merge topic 'write_cellset_extrude'
b1c0f46ac Response to code review.
4e7d85094 Remove default template argument that breaks build.
4cb661006 Implement GetIndices.
2d35ab05a Write CellSetExtrude as CellSetExplicit.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Dave Pugmire <dpugmire@gmail.com>
Merge-request: !2436
2021-03-12 19:32:55 -05:00
Nick Thompson
b1c0f46ac0 Response to code review. 2021-03-12 21:14:50 +00:00
Nick Thompson
4e7d85094e Remove default template argument that breaks build. 2021-03-12 15:37:32 -05:00
Nick Thompson
4cb661006e Implement GetIndices. 2021-03-12 14:40:27 -05:00
larsen30@llnl.gov
8e588504ff Merge branch 'identify_xl' of gitlab.kitware.com:mclarsen/vtk-m into identify_xl 2021-03-11 13:30:40 -08:00
larsen30@llnl.gov
9c53963946 Merge remote-tracking branch 'upstream/master' into identify_xl 2021-03-11 13:30:28 -08:00
Matt Larsen
8d8228f365 correct type in comment 2021-03-11 21:12:06 +00:00
Matt Larsen
d2d1c854ad Merge topic 'extend_clipping_plane'
786995984 extend the default clipping plane

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2439
2021-03-11 15:43:37 -05:00
Li-Ta Lo
b7f2d8c638 Merge branch 'particle_density' into particle_density_cic 2021-03-11 11:22:22 -07:00
Li-Ta Lo
e68319e0a3 Merge branch 'fp_atomics2' into particle_density_cic 2021-03-11 11:13:55 -07:00
Li-Ta Lo
ce8ab5912b Merge branch 'particle_density_cic' of gitlab.kitware.com:ollielo/vtk-m into particle_density_cic 2021-03-11 10:31:42 -07:00
Li-Ta Lo
6f507bb4b5 update ParticleDensityNearestGridPoint to use FP atomics 2021-03-11 10:18:50 -07:00
larsen30@llnl.gov
4d7a08c183 add xl compiler identification 2021-03-11 09:15:55 -08:00
Matt Larsen
7869959841 extend the default clipping plane 2021-03-11 08:43:42 -08:00
Li-Ta Lo
b590a8ebb2 Add floating point atomics 2021-03-11 08:19:51 -07:00
Kenneth Moreland
91d13bdfb2 Merge topic 'reduce-initial-type'
563e23aac Fix unintended cast in TBB Reduce's return value
a7100c845 Do not assume CUDA reduce operator is unary
f3a6931f6 Fix casting issues in TBB functors
cc5b9a016 Add casts to FunctorsGeneral.h
d9c988b20 Allow for different types in basic type operators

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2431
2021-03-08 18:06:51 -05:00
Kenneth Moreland
563e23aaca Fix unintended cast in TBB Reduce's return value
It was setting the return value type the same as the initial value.
However, the value type can change based on the array type and the
operator.
2021-03-08 14:12:20 -07:00
Li-Ta Lo
f38523d557 Merge branch 'fp_atomics' into particle_density_cic 2021-03-08 12:19:35 -07:00
Li-Ta Lo
3d1e58e651 use AsArrayHandle 2021-03-08 10:32:01 -07:00
Li-Ta Lo
2336d144e3 distingush load/store v.s. arithmetic types 2021-03-08 09:52:41 -07:00
Li-Ta Lo
2510f08237 single precision float constant 2021-03-08 08:26:22 -07:00
Nick Thompson
2d35ab05ac Write CellSetExtrude as CellSetExplicit. 2021-03-08 10:18:42 -05:00
Matt Larsen
ffdb33f727 follow coding conventions 2021-03-05 08:47:58 -08:00
Li-Ta Lo
350b42224a include ArrayCopy.h 2021-03-05 09:43:38 -07:00
Matt Larsen
a778af8bc9 make scalar normilization consistent across rendering 2021-03-05 08:32:10 -08:00
Matt Larsen
168952a0ce correct a potential divide by zero 2021-03-05 08:15:56 -08:00
Li-Ta Lo
9de7442297 implemented CIC deposition 2021-03-05 08:29:00 -07:00
Li-Ta Lo
aed6a8f2f4 Merge branch 'fp_atomics' into particle_density_cic 2021-03-04 11:15:38 -07:00