Commit Graph

6271 Commits

Author SHA1 Message Date
Kenneth Moreland
866e1d7d5b Update comparison for virtual and multiplexer arrays
Previously the "dynamic" array was taken from a VariantArrayHandle.
However, the VariantArrayHandle will actually cast to a basic array, so
the comparison is not particularly fair. Change that to an
ArrayHandleVirtual so that it is actually calling through a virtual
method.

Also make 2 versions of the multiplexer test. The first version has an
array that is at the 1st index and the second is at the last index. This
tests whether the compiled code has to do lots of actual comparisons to
get to the last index.
2019-07-22 08:36:28 -06:00
Kenneth Moreland
5416cbeb7e Add ArrayHandleMultiplexer testing to BenchmarkFieldAlgorithms 2019-07-22 08:36:28 -06:00
Kenneth Moreland
d451064525 Add changedoc for ArrayHandleMultiplexer 2019-07-22 08:36:28 -06:00
Kenneth Moreland
0aa15c97ce Fix 'Failed to specialize alias template' error from Visual Studio
The code was working fine on all the dashboards except for the Visual
Studio 2015 compiles on delve. It gave an error like:

ArrayHandleMultiplexer.h(398): error C2938: 'ArrayHandleToStorageTag<unknown-type>' : Failed to specialize alias template

A StackOverflow article (https://stackoverflow.com/questions/43411542/
metaprogramming-failed-to-specialize-alias-template) suggests that this
is a bug in older versions of Visual Studio. Although fixed in more
recent versions, we might have to support older versions.
2019-07-22 08:36:28 -06:00
Kenneth Moreland
7b72e31dfb Fixes for CUDA 2019-07-22 08:36:28 -06:00
Kenneth Moreland
5e23853521 Create ArrayHandleMultiplexer 2019-07-22 08:36:28 -06:00
Kenneth Moreland
827613263a Avoid touching ListTag internals
Currently, ListTags are implemented by having a subtype name list set to
a brigand::list. However, there is always a chance this will change. To
make things more explicit, create a vtkm::internal::ListTagToBrigandList
to make it clear what the resulting type should be (and provide some
potential future-proofing).

Also add a convenient vtkm::ListTagApply that allows you to  easily
instantiate a template with the list of types in a ListTag.
2019-07-22 08:36:28 -06:00
Kenneth Moreland
58d3123370 Add Variant
vtkm::internal::Variant is a simplified version of C++17's std::variant
or boost's variant. It is a template that takes a list of types. The
Variant may be set to any one of those types. A CastAndCall allows you
to call a functor with the appropriately cast type.
2019-07-22 08:36:28 -06:00
Kenneth Moreland
468ee61cac Merge topic 'write-to-array-handle-cast'
6592e5288 Fix IsWritableArrayHandle for portals that exist but cannot be written
0e15a1116 Enable writing to ArrayHandleCast
6d37ce945 Remove invalid PortalType

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1731
2019-07-22 10:34:54 -04:00
Kenneth Moreland
6592e52880 Fix IsWritableArrayHandle for portals that exist but cannot be written
Previously, IsWriteableArrayHandle just checked to see if an
ArrayHandle's portal has a ValueType of void* because we had coded the
special read-only array handles to have fake portals for writing.
However, we recently removed that because it was more trouble than it
was worth. Now IsWritableArrayHandle checks for the existance of the Set
method. If it does not exist, then the portal is considered read-only.

Also corrected spelling (writeable -> writable).
2019-07-19 20:33:58 -06:00
Allison Vacanti
4e3e102531 Merge topic '385-fix_examples'
094cf2159 Rename a file to match CMakeLists.txt in an example.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1734
2019-07-19 15:59:36 -04:00
Allison Vacanti
63baa30829 Merge topic 'boundary_checks'
694d1e113 Add methods to BoundaryState to query specific offsets.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1733
2019-07-19 15:51:59 -04:00
Allison Vacanti
694d1e113d Add methods to BoundaryState to query specific offsets.
The existing functionality worked on radii, but it's helpful to
know if a specific sample location will be in bounds, too.
2019-07-19 15:09:57 -04:00
Allison Vacanti
094cf21599 Rename a file to match CMakeLists.txt in an example.
Fixes #385.
2019-07-19 12:02:51 -04:00
Robert Maynard
c18f762697 Merge topic 'add_odr_warning_flag'
736664612 Cleanup VTK-m warning flags and add in Wodr

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1732
2019-07-18 16:16:51 -04:00
Robert Maynard
736664612d Cleanup VTK-m warning flags and add in Wodr
This was done to help us catch ODR violations quicker
2019-07-18 13:33:18 -04:00
Kenneth Moreland
0e15a1116c Enable writing to ArrayHandleCast
Previously, `ArrayHandleCast` was considered a read-only array handle.
However, it is trivial to reverse the cast (now that `ArrayHandleTransform`
supports an inverse transform). So now you can write to a cast array
(assuming the underlying array is writable).

One trivial consequence of this change is that you can no longer make a
cast that cannot be reversed. For example, it was possible to cast a simple
scalar to a `Vec` even though it is not possible to convert a `Vec` to a
scalar value. This was of dubious correctness (it is more of a construction
than a cast) and is easy to recreate with `ArrayHandleTransform`.
2019-07-17 18:40:45 -06:00
Kenneth Moreland
6d37ce9453 Remove invalid PortalType
Several ArrayHandles (actuall Storage implementations) had a fake portal
type that only defined invalid value types and no Get/Set methods. The
idea was to quickly identify when using a read-only array for writing.
However, this was more trouble than it was worth as the compiler just
gives  an incomprehensible error and it is hard to track down the actual
value.

Now actually define some type even if it is never used.
2019-07-17 18:39:00 -06:00
Robert Maynard
8d3310fe55 Merge topic 'namespace_lodepng'
46a1df6c1 DecodePNG uses the namespaced lodepng from thirdparty/
26e50065a Merge branch 'upstream-lodepng' into namespace_lodepng
43e0185b2 lodepng 2019-07-17 (82328a33)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Matt Larsen <larsen30@llnl.gov>
Merge-request: !1728
2019-07-17 16:07:15 -04:00
Kenneth Moreland
79909ecf12 Merge topic 'add_mesh_quality'
b622c7962 Fixed index out of bounds error for the cell counts array
4d61066e9 Removed all modifications in the internal device adapter algorithm header files.
06ac9f721 Revised version of the original mesh quality merge request
e54001367 Added few lines of code missing from cuda device adapter header
3dd34d251 Added custom CopyIf function
417dbcea7 Removed all modifications in the internal device adapter algorithm header files.
50cb805ce Fixed cuda device adapter alg
8c070caa0 Added few lines of code missing from cuda device adapter header
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1714
2019-07-17 15:42:22 -04:00
Robert Maynard
46a1df6c18 DecodePNG uses the namespaced lodepng from thirdparty/ 2019-07-17 14:21:33 -04:00
Robert Maynard
26e50065ab Merge branch 'upstream-lodepng' into namespace_lodepng
* upstream-lodepng:
  lodepng 2019-07-17 (82328a33)
2019-07-17 14:21:13 -04:00
LodePNG Upstream
43e0185b2d lodepng 2019-07-17 (82328a33)
Code extracted from:

    https://gitlab.kitware.com/third-party/lodepng.git

at commit 82328a339c20149365089c6b969be00a9166780b (for/vtk-m).
2019-07-17 14:21:13 -04:00
Robert Maynard
b4662c5718 Merge topic 'find_mpi_is_required'
772e36ba0 When VTKm_ENABLE_MPI is enabled finding MPI is always required

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Allison Vacanti <allison.vacanti@kitware.com>
Merge-request: !1727
2019-07-17 14:02:56 -04:00
Robert Maynard
0777025f2c Merge topic 'require_cmake_313_for_cuda'
6de7d07d2 VTK-m requires CMake 3.13 to compile CUDA

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1725
2019-07-17 11:23:27 -04:00
Allison Vacanti
c2772ad857 Merge topic 'unroll_omp_reduce'
41894a97b Unroll reduction loops for non-integral types on OpenMP.
e30cb0872 Fix OpenMP for gcc-9 backwards incompatibility.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1724
2019-07-17 09:50:41 -04:00
Hank
6b65f1e2dd Merge topic 'open_nonexistent_file'
2fc7cb02a remove unused variable
5064854a0 Add error message with bad file open

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Sujin Philip <sujin.philip@kitware.com>
Merge-request: !1722
2019-07-16 17:42:34 -04:00
Robert Maynard
6de7d07d28 VTK-m requires CMake 3.13 to compile CUDA
This is to resolve issues related to FindThreads and CUDA
compilation.
2019-07-16 16:39:50 -04:00
Allison Vacanti
41894a97b3 Unroll reduction loops for non-integral types on OpenMP. 2019-07-16 14:47:41 -04:00
Allison Vacanti
e30cb08725 Fix OpenMP for gcc-9 backwards incompatibility.
For details, see

https://www.gnu.org/software/gcc/gcc-9/porting_to.html
2019-07-16 14:47:31 -04:00
Robert Maynard
772e36ba0c When VTKm_ENABLE_MPI is enabled finding MPI is always required
Previously we had logic where find_package(MPI) wasn't required
2019-07-16 14:33:26 -04:00
Hank Childs
2fc7cb02a3 remove unused variable 2019-07-16 10:58:40 -07:00
Robert Maynard
c80c1d09c0 Merge topic 'refactor_vtkm_buildsystem_to_provide_better_consumer_experience'
28484fc6a Update examples and benchmarks to use new VTK-m CMake helper function
ea50e82aa Move VTK-m CMake testing wrappers to the testing folder
0b7dd7c38 Add CMake vtkm_add_target_information() to make using vtk-m easier
e934e2273 vtkm_library WRAP_FOR_CUDA renamed to clarify the intent of the property
a2e6660fd Remove unused vtkm_compile_as_cuda CMake function

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Matt Larsen <larsen30@llnl.gov>
Merge-request: !1718
2019-07-16 08:46:22 -04:00
Hank Childs
5064854a0d Add error message with bad file open 2019-07-12 18:19:48 -07:00
Li-Ta Lo
2c6061d37f Merge topic 'locate-points-on-boundary'
461f87dbc Fix issues with PointLocatorUniformGrid not finding all points
e473cb4bb Fix PointLocatorUniformGrid for points on boundary

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Li-Ta Lo <ollie@lanl.gov>
Merge-request: !1720
2019-07-11 10:48:49 -04:00
Robert Maynard
7fa94e53e2 Merge topic 'proper_vectorization_flags'
4a5ef8c6a VTKmCPUVectorization GCC native supports ppc64le
68a9167ab VTKmCPUVectorization now uses -march=<cpu_arch>
d0d678049 Correctly enable vectorization of avx512 when using gcc.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1719
2019-07-11 08:08:12 -04:00
Kenneth Moreland
461f87dbc8 Fix issues with PointLocatorUniformGrid not finding all points
There was a known issue where PointLocatorUniformGrid would quickly quit
once it found a point. Instead, look at one more level of bins just in
case there is a closer one near the boundary. (Still not guaranteed, but
likely.)

Also, fix a typo that caused some bins in the y and z direction to not
be searched.
2019-07-10 09:52:49 -06:00
Kenneth Moreland
e473cb4bbc Fix PointLocatorUniformGrid for points on boundary
When creating the search structures in PointLocatorUniformGrid, a point
outside the boundary would be given an invalid bin id. These points
could never be found. Generally, this is not a big deal for points
outside of the boundary, but it could be a problem for points on the
boundary. A point on the boundary could be taken as outside the
boundary. Since the boundary is chosen from limits of the points, some
will almost always be on the boundary.

Fix this problem by clamping all points to the nearest valid bin. This
could cause a problem if the user has selected a boundary excluding a
lot of points. All those points could be grouped to the same edge bins,
but that is probably not a great idea anyway.
2019-07-10 08:35:45 -06:00
Robert Maynard
28484fc6aa Update examples and benchmarks to use new VTK-m CMake helper function 2019-07-09 13:32:23 -04:00
Robert Maynard
ea50e82aac Move VTK-m CMake testing wrappers to the testing folder
The VTK-m testing infrastructure isn't public facing so it doesn't
need to be installed or clutter the main VTKmWrappers file.

At the same time I have refactored the code to make it clearer
to understand, and remove unused options.
2019-07-09 13:32:23 -04:00
Robert Maynard
0b7dd7c38e Add CMake vtkm_add_target_information() to make using vtk-m easier
The function allows consumers to modify an existing target to allow
for correct compilation with VTK-m.
2019-07-09 13:32:23 -04:00
Robert Maynard
e934e2273c vtkm_library WRAP_FOR_CUDA renamed to clarify the intent of the property
We want the option name to be clear that it might be applicable for
more than just CUDA. If VTK-m ever supported something like SYCL
it would not be clear that those sources should go in `WRAP_FOR_CUDA`.
2019-07-09 13:04:07 -04:00
Robert Maynard
a2e6660fdd Remove unused vtkm_compile_as_cuda CMake function 2019-07-09 13:04:07 -04:00
Robert Maynard
b25599cb2e Merge topic 'error_on_cuda_with_shared_libs'
65f169b31 VTK-m now will now error when mixing CUDA and shared builds

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1717
2019-07-09 13:03:28 -04:00
Robert Maynard
65f169b311 VTK-m now will now error when mixing CUDA and shared builds 2019-07-09 11:48:22 -04:00
Robert Maynard
4a5ef8c6ad VTKmCPUVectorization GCC native supports ppc64le
The PowerPC front end uses mcpu instead of march.
2019-07-09 11:45:54 -04:00
Robert Maynard
68a9167ab2 VTKmCPUVectorization now uses -march=<cpu_arch>
The cpu architectures mode to -march is a better approach as it
maps to a more complete side of optimization flags. This makes
it easier going forward for VTK-m to support new CPU ISA's.
2019-07-09 11:36:46 -04:00
Robert Maynard
d0d6780490 Correctly enable vectorization of avx512 when using gcc.
The previous logic would incorrectly capture all GCC versions
as only have avx and avx2.
2019-07-09 09:35:00 -04:00
Brent Lessley
b622c79625 Fixed index out of bounds error for the cell counts array 2019-07-04 15:34:26 -07:00
Brent Lessley
4d61066e9c Removed all modifications in the internal device adapter algorithm header files. 2019-07-03 11:12:19 -07:00