Commit Graph

8814 Commits

Author SHA1 Message Date
Kenneth Moreland
bd5b84fa90 Have VTKM_IS_TRIVIAL* macros show types better
Changed the definition of `VTKM_IS_TRIVIAL`,
`VTKM_IS_TRIVIALLY_COPYABLE` and the like to use internal structs to do
the static assert rather than have them do the static assert themselves.
This makes the compiler more likely to tell you the actual type being
checked rather. (At least, this was the case on my clang compiler.)
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
Ben Boeckel
2fd7c92820 Merge topic 'range-compute-coordinates'
26d5168b4 Fix types used for coordinates in ArrayRangeCompute

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Vicente Bolea <vicente.bolea@kitware.com>
Merge-request: !2453
2021-03-31 10:35:45 -04: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
d7c6ffbd10 Merge topic 'what-in-error'
eadaf06f0 Set what string in Error::SetMessage

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Nickolas Davis <nadavi@sandia.gov>
Merge-request: !2451
2021-03-29 12:32:20 -04: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
Vicente Bolea
210ca76c29 Merge topic 'set-cpp14-for-tests'
486c5de95 TESTING: Set C++14 as minimum standard for install test

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Li-Ta Lo <ollie@lanl.gov>
Merge-request: !2447
2021-03-26 11:50:22 -04:00
Vicente Adolfo Bolea Sanchez
486c5de95c TESTING: Set C++14 as minimum standard for install test
Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2021-03-25 18:59:13 -04: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
b79b111c3f Merge topic 'invalid-cuda-atomiccas'
d1dba170e Do not use volatile when calling CUDA atomicCAS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2448
2021-03-25 16:59:03 -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
Abhishek Yenpure
5f7287bc1b Removing virtuals from particle advection
-- Removing virtuals from CellInterpolationHelpers
2021-03-23 22:27:28 -07:00
Li-Ta Lo
62f6799f37 Merge topic 'ollielo-master-patch-38553'
197a9b3ff fixed an oversight on the correct way to get CoordinateSystem.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@acm.org>
Merge-request: !2446
2021-03-23 12:31:37 -04: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