Commit Graph

6661 Commits

Author SHA1 Message Date
Nick Thompson
e64a3ce4d4 Merge topic 'add_func_2'
ff4ad96ef Do not print extra information on Kokkos and CUDA.
321571fab Make sure operator precedence is correct over macro invocation.
94a32bf64 Improve code in response to review.
568c0b5d2 Small formatting changes.
a8e25da0a Add __func__ to unit test metadata printed on failure.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@acm.org>
Merge-request: !2469
2021-04-12 17:53:04 -04:00
Nick Thompson
ff4ad96efc Do not print extra information on Kokkos and CUDA. 2021-04-12 15:01:07 -04:00
Nick Thompson
321571fabe Make sure operator precedence is correct over macro invocation. 2021-04-12 13:50:27 -04:00
Vicente Adolfo Bolea Sanchez
ff84915bc3 Merge branch 'upstream-diy' into fix-use-c++14-in-every-target
# By Diy Upstream
* upstream-diy:
  diy 2021-04-12 (bc7dcda5)
2021-04-12 13:45:01 -04:00
Nick Thompson
94a32bf64c Improve code in response to review. 2021-04-12 13:42:19 -04:00
Vicente Adolfo Bolea Sanchez
f60a45bc63 Enforce C++14 in the whole project
Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2021-04-12 13:29:46 -04:00
Nick Thompson
568c0b5d29 Small formatting changes. 2021-04-12 13:05:36 -04:00
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