Commit Graph

6901 Commits

Author SHA1 Message Date
Kenneth Moreland
92db376236 Convert uses of ListTagBase to List 2019-12-06 15:37:46 -07:00
Kenneth Moreland
34b0bba842 Use C++11 attributes for VTKM_ALWAYS/NEVER_EXPORT
Previously, the `VTKM_ALWAYS_EXPORT` and `VTKM_NEVER_EXPORT` macros
used the gnu-specific `__attribute__` keyword. This change instead
uses the C++11 standard method of using `[[ ]]` as attributes.
Specifically, `__attribute(visibility("---"))` is changed to
`[[gnu::visibility("--")]]`.

The main impetus for this change is that `__attribute__` does not
seem to work with `[[deprecated]]` on GCC compilers. (For sure on
GCC 6. I didn't check all compiler versions.) This change was
recommended from
https://stackoverflow.com/questions/40886628/deprecated-attribute-visibility-default-in-gcc-6-2

This creates a minor backward incompatibility. We have always meant
for these macros to be used before the return type when used with
a function. However, GCC accepted placing `__attribute__` after
the return type. The C++11 `[[ ]]` cannot be placed there, so
some macros might have to be moved. Still, this was a broken
use that happened to work.
2019-12-05 13:55:54 -05:00
Kenneth Moreland
cd302effb3 Update lists in TypeListTag.h
A new header named TypeList.h and the type lists have been redefined in
this new file. All the types have been renamed from `TypeListTag*` to
`TypeList*`. TypeListTag.h has been gutted to provide deprecated
versions of the old type list names.

There were also some other type lists that were changed from using the
old `ListTagBase` to the new `List`.
2019-12-05 11:05:19 -07:00
Kenneth Moreland
6fc883213c Deprecate ListTag operations
The newer List operations should still work on the old ListTags, so make
those changes first to ensure that everything still works as expected if
given an old ListTag.

Next step is to deprecate ListTagBase itself and move all the lists to
the new types.
2019-12-05 11:27:31 -05:00
Kenneth Moreland
80d2948300 Add List changelog 2019-12-04 17:21:32 -07:00
Kenneth Moreland
70f6220fa3 Add vtkm::List
`vtkm::List` is meant to replace `vtkm::ListTag`. Rather than
subclassing a base class with a variadic template, all lists expose the
list of types.

`vtkm::ListTag` was originally created before we required C++11 so
supporting variadic templates was problematic. To hide the issue we had,
we made list tags subclass other lists rather than be the list
themselves. It makes for nicer types in the compiler, but hides
important details about what is actually in the type. It also creates
lots of unnecessary new types.

The new `vtkm::List` is in some ways simpler. All lists have to be a
`vtkm::List`. Subclasses are not supported (or rather, they will not
work as expected). All manipulations (such as `vtkm::ListAppend`)
resolve directly back to a `vtkm::List`. Although the types reported by
the compiler will be longer, they will be more specific to the types
being used. Also, the new implimentation should ultimately use fewer
types.
2019-12-04 17:13:56 -07:00
Kenneth Moreland
a6bc1dc764 Merge topic 'array-handle-thread-safety'
5ab0b5bb1 Access ArrayHandle internals in a critical section
b13a08855 Access ArrayHandle internals in a critical section

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1905
2019-12-04 14:42:07 -05:00
Kenneth Moreland
9ff1f5d8a9 Merge topic 'deprecation'
f62b50259 Refactor deprecated macros
fec1c4995 Re-enable Visual Studio warning 4996
ed4d0d50c Add VTKM_DEPRECATED macro

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1902
2019-12-04 09:01:17 -05:00
Kenneth Moreland
4211c4c19b Merge topic 'remove-invalid-arrays-from-multiplexer'
5676cd175 Add changelog for ListTagRemoveIf
6feb0c376 Remove invalid arrays when applying policies to fields
4c103e421 Add ListTagRemoveIf

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1901
2019-12-04 08:57:59 -05:00
Robert Maynard
44317bf616 Merge topic 'add_ninja_job_pools'
f457cf30f correct setting up job pool for tests

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1914
2019-12-03 14:49:52 -05:00
Robert Maynard
f457cf30f8 correct setting up job pool for tests 2019-12-03 14:08:52 -05:00
Robert Maynard
b9d3736862 Merge topic 'vtkm_setup_job_pool_no_status_message'
f578c9068 Make sure vtkm_setup_job_pool() doesn't output any status

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1912
2019-12-03 11:33:15 -05:00
Robert Maynard
f578c90685 Make sure vtkm_setup_job_pool() doesn't output any status 2019-12-03 11:32:14 -05:00
Robert Maynard
a9f5279b28 Merge topic 'add_ninja_job_pools'
7fc7c61a9 VTK-m use a jobs pool for compiling large compilation units.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1911
2019-12-03 09:00:22 -05:00
Robert Maynard
acbecb6fc9 Merge topic 'remove_unused_function_interface_components'
65347bf94 Correct warnings found by GCC 9.2
d6d40c90d Simplify FunctionInterface

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1910
2019-12-02 16:18:13 -05:00
Robert Maynard
65347bf948 Correct warnings found by GCC 9.2 2019-12-02 09:33:35 -05:00
Robert Maynard
d6d40c90d7 Simplify FunctionInterface
This includes removing Exec, and Cont methods that VTK-m is no longer
using. Also we simplify the used methods as much as possible.
2019-12-02 09:33:35 -05:00
Robert Maynard
7fc7c61a9b VTK-m use a jobs pool for compiling large compilation units.
When building with the ninja generator VTK-m now uses a job pool
to help limit the chances of a machine going out of memory
when compiling VTK-m.
2019-11-29 15:49:54 -05:00
Robert Maynard
462aacebb3 Merge topic 'simplify_threshold_implementation'
a92ad22c7 Improve Threshold runtime and compile performance

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Allison Vacanti <allison.vacanti@kitware.com>
Merge-request: !1909
2019-11-26 19:48:24 -05:00
Robert Maynard
a92ad22c73 Improve Threshold runtime and compile performance
Using GCC 9.2 the pre change vtkm::filter::Threshold would
take 31.84sec to compile and use 1.1GB of memory. After
these changes the filter takes 24.16sec to compile and
uses 885MB of memory.
2019-11-26 16:53:56 -05:00
Robert Maynard
5ea5e1b37b Merge topic 'vtkm_mark_files_as_not_good_for_unity'
a1af800cc VTK-m now excludes large files from CMake Unity builds

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1907
2019-11-26 12:04:33 -05:00
Robert Maynard
a1af800cc0 VTK-m now excludes large files from CMake Unity builds
CMake 3.16 includes support for unity builds which merge multiple
translation units together automatically for faster builds.
A couple of translation units in VTK-m already require lots of
system memory, and merging them actually decreases compile performance
2019-11-26 11:22:03 -05:00
Matt Larsen
68cb8f317f Merge topic 'fix/rendering_timers'
c021ef188 remove serial only timers to avoid warnings

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1906
2019-11-25 13:36:54 -05:00
mclarsen
c021ef1887 remove serial only timers to avoid warnings 2019-11-25 08:38:36 -08:00
Kenneth Moreland
5ab0b5bb1d Access ArrayHandle internals in a critical section
Repeat the changes of the previous commit with the specialized
ArrayHandle for basic storage.
2019-11-20 14:42:58 -07:00
Kenneth Moreland
b13a088558 Access ArrayHandle internals in a critical section
When it was originally created, it was assumed that the ArrayHandle
class would be used by a single thread. As the use of VTK-m expands,
that is no longer a safe assumption. To ensure that operations on
ArrayHandle happen correctly, add a mutex to the Internals of
ArrayHandle and require all operations on the Internals lock that mutex.
2019-11-13 10:47:10 -07:00
Kenneth Moreland
01a51e16a9 Merge topic 'gcc-openmp-workaround-fix'
033dfe555 Only workaround incorrect GCC behavior for OpenMP on GCC

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1904
2019-11-12 16:27:34 -05:00
Kenneth Moreland
033dfe5556 Only workaround incorrect GCC behavior for OpenMP on GCC
There is some behavior of GCC compilers before GCC 9.0 that is
incompatible with the specification of OpenMP 4.0. The workaround was
using the workaround any time a GCC compiler >= 9.0 was used. The proper
behavior is to only use the workaround when the GCC compiler is being
used and the version of the compiler is less than 9.0.

Also, switch to using VTKM_GCC to check for the GCC compiler instead of
__GNUC__. The problem with using __GNUC__ is that many other compilers
pretend to be GCC by defining this macro, but in cases like compiler
workarounds it is not accurate.
2019-11-12 13:50:50 -07:00
Kenneth Moreland
e9e613b9cd Merge topic 'tube-compile-warning'
cd30bc587 Fix compiler warning in Tube worklet

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Dave Pugmire <dpugmire@gmail.com>
Merge-request: !1903
2019-11-07 09:24:31 -05:00
Kenneth Moreland
cd30bc5875 Fix compiler warning in Tube worklet
Older GCC compilers were giving warnings in the operator of the
GeneratePoints worklets for tubes because they could not completely
determine that variables were being properly initialized in the first
loop iteration (and therefore initialized for every subsequent
iteration). Fixed that by moving the initialization for the first
iteration outside of the loop.
2019-11-06 17:06:11 -07:00
Kenneth Moreland
f62b50259e Refactor deprecated macros
Previously we relied on CMake's compiler detection module to build the
macros for using the deprecated attribute. However, CMake created macros
for pre-C++14 versions of the feature, which do not work in all cases.
Also, we have the need to be able to suppress deprecation warnings when
we are implementing a deprecated thing. Since we have to query compilers
ourself, we might as well figure out if the deprecated attribute we want
is supported.

Worst case is that we won't support deprecation warnings everywhere we
could. That will not create incorrect code and we can always add that
later.
2019-11-06 14:47:59 -07:00
Kenneth Moreland
fec1c4995d Re-enable Visual Studio warning 4996
Previously, Configure.h.in used a pragma to disable warning 4996 is all
VTK-m code and anything that used it. The reason for this was that the
warning was given for any use of std algorithms such as fill_n that the
Visual Studio team deemed unsafe. Although we could fix it in our code,
it was impossible to work around warnings in other headers as the actual
warning comes from a system header file (xutility) that we have very
little control over. At the time we disabled this warning, we were
getting the warning from a bost header file, and the warning was never
to be fixed (https://svn.boost.org/trac/boost/ticket/11426).

Unfortunately, disabling warning 4996 also disables all warnings about
deprecated items. We want to support warnings for things deprecated in
VTK-m itself, so turning off this warning means we cannot correctly
support VTK-m deprecation.

Fortunately, a lot has changed since then. We no longer boost at all, so
the issue there is no longer our problem. We can thus re-enable the
warning (by removing the pragma). We've managed to avoid using these
"unsafe" functions anyway, so we should be able to cleanly build with
this warning on.
2019-11-06 09:59:00 -07:00
Kenneth Moreland
ed4d0d50c3 Add VTKM_DEPRECATED macro
The `VTKM_DEPRECATED` macro allows us to remove (and usually replace)
features from VTK-m in minor releases while still following the conventions
of semantic versioning. The idea is that when we want to remove or replace
a feature, we first mark the old feature as deprecated. The old feature
will continue to work, but compilers that support it will start to issue a
warning that the use is deprecated and should stop being used. The
deprecated features should remain viable until at least the next major
version. At the next major version, deprecated features from the previous
version may be removed.
2019-11-06 09:58:53 -07:00
Kenneth Moreland
5676cd1758 Add changelog for ListTagRemoveIf 2019-11-02 11:08:34 -06:00
Kenneth Moreland
6feb0c3763 Remove invalid arrays when applying policies to fields
Previously when ApplyPolicyFieldOfType was used in cases where not all
of the types matched not all of the storages, those invalid arrays were
replaced with an ArrayHandleDiscard. This unnecessarily increased the
length of the type names used for the resulting ArrayHandleMultiplexer.

Now, ListTagRemoveIf is used to remove any invalid arrays so that the
resulting ArrayHandleMultiplexer only includes the valid arrays.
2019-11-02 11:08:09 -06:00
Kenneth Moreland
4c103e421a Add ListTagRemoveIf
Provides the ability to remove items from a list.
2019-10-31 14:32:17 -06:00
Kenneth Moreland
05917e11a1 Merge topic 'gcc-4-trivially-copyable'
3b7b21c86 Do not use std::is_trivially_copyable on GCC 4.X

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1900
2019-10-31 16:13:58 -04:00
Kenneth Moreland
3b7b21c86d Do not use std::is_trivially_copyable on GCC 4.X
Although GCC 4.8 and 4.9 claim to be C++11 compliant, there are a few
C++11 features they do not support. One of these features is
std::is_trivially_copyable. So on these platforms, do not attempt to use
it. Instead, treat nothing as trivially copyable.
2019-10-30 16:15:44 -06:00
Kenneth Moreland
291f3527b1 Merge topic 'variant-trivial-copy'
7518d0675 Try to fix uninitialized anonymous variable warning
5b18ffd77 Register Variant as trivially copyable if possible
16305bd83 Add tests of ArrayHandleMultiplexer on multiple devices

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1898
2019-10-29 11:04:48 -04:00
Kenneth Moreland
7518d0675c Try to fix uninitialized anonymous variable warning
The code from the previous commit was causing one of the dashboards,
which is using gcc-7, to produce the following warning:

In file included from ../testing/UnitTestVariant.cxx:11:0:
../Variant.h: In function 'void {anonymous}::TestCopyDestroy()':
../Variant.h:269:5: warning: '<anonymous>' may be used uninitialized in this function [-Wmaybe-uninitialized]
     this->Storage = std::move(rhs.Storage);
     ^~~~

At best, this warning is not helpful as it does not seem to point to
anything that could be used uninitialized. At worst, it might be a
compiler bug. A Google search finds a few similar bugs although none I
can assert with any confidence of this issue. However, many reported
bugs and issues point to the use of anonymous namespaces. So, I'm going
to attempt to fix the problem by removing anonymous namespaces.
Hopefully it will fix the warning or at least point me to something
concrete that I can fix.
2019-10-27 07:34:06 -06:00
Kenneth Moreland
5b18ffd770 Register Variant as trivially copyable if possible
The Variant template can hold any type. If it is holding a type that is
non-copyable, then it has to make sure that appropriate constructors,
copiers, movers, and destructors are called.

Previously, these were called even the Variant was holding a trivially
copyable class because no harm no foul. If you were holding a trivially
copyable class and did a memcpy, that work work, which should make it
possible to copy between host and device, right?

In theory yes, but in practice no. The problem is that Cuda is
outsmarting the code. It is checking that Variant is not trivially-
copyable by C++ semantics and refusing to push it.

So, change Variant to check to see if all its supported classes are
trivially copyable. If they are, then it use the default constructors,
destructors, movers, and copiers so that C++ recognizes it as trivially
copyable.
2019-10-26 22:53:43 -06:00
Kenneth Moreland
16305bd837 Add tests of ArrayHandleMultiplexer on multiple devices 2019-10-26 13:40:42 -06:00
Sujin Philip
4bc67045f6 Merge topic 'fix-UnitTestError'
5ca9a4bd5 Fix UnitTestError

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1897
2019-10-21 11:32:40 -04:00
Sujin Philip
5ca9a4bd5e Fix UnitTestError
The previous changes were incorrect and did not fix the problem.
2019-10-21 10:08:23 -04:00
Sujin Philip
5c13198407 Merge topic 'fix-dashboard-issues'
79f7f8275 Fix UnitTestError failure
901711bff Fix test failure due to floating point issues

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1896
2019-10-17 17:32:32 -04:00
Sujin Philip
79f7f82751 Fix UnitTestError failure
Compiler optimization may remove recursion and other function calls so we
cannot rely on the number of stack frames to be consistent.
2019-10-17 17:30:40 -04:00
Sujin Philip
901711bff4 Fix test failure due to floating point issues
Floating point precision issues are causing the Reduce algorithm of the OpenMP
backend to produce result that is off by more than 0.001.
2019-10-17 17:30:32 -04:00
Robert Maynard
64ad158124 Merge topic 'improve_moments_perf'
0fccc5f2c improve moments algorithm performance

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Allison Vacanti <allison.vacanti@kitware.com>
Merge-request: !1895
2019-10-17 16:20:55 -04:00
Robert Maynard
0fccc5f2c4 improve moments algorithm performance 2019-10-17 11:51:05 -04:00
Robert Maynard
550dbdf3e8 Merge topic 'document_how_to_do_a_release'
552d47349 Initial documentation on how to cut a VTK-m release

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1894
2019-10-17 11:12:29 -04:00