Commit Graph

7935 Commits

Author SHA1 Message Date
Robert Maynard
db3b281da3 Merge topic 'correct_clang_cuda_warnings'
b48c19f25 Correct warnings found by using clang as the host compiler for cuda

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !2232
2020-08-24 10:01:47 -04:00
Robert Maynard
b48c19f251 Correct warnings found by using clang as the host compiler for cuda 2020-08-24 08:57:38 -04:00
Kenneth Moreland
0370029f92 Merge topic 'free-atomic-functions'
6cbcb9f5d Fix behavior of Cuda AtomicLoad with SequentiallyConsistent
7573d4ed5 Fix compiler warnings
147dd24d0 Remove ARM intrinsics in MSVC
2229c22f4 Avoid invalid Kokkos atomic calls
3b147878f Always use our implementation of Cuda atomics
9e6fe8fb6 Add memory order semantics to atomic functions
d2ac4b860 Be more careful in casting with Atomic functions
13056b3af Deprecate AtomicInterfaceControl and AtomicInterfaceExecution
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2223
2020-08-22 00:21:01 -04:00
Vicente Bolea
42009394fc Merge topic 'fix-xl-warnings'
e3d734708 IBM XL: disable unused-template pragma for xl

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2230
2020-08-21 17:36:52 -04:00
Vicente Adolfo Bolea Sanchez
e3d7347080 IBM XL: disable unused-template pragma for xl
Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2020-08-21 15:40:05 -04:00
Robert Maynard
111ff949d9 Merge topic 'VTKmConfig_only_modify_non_aliased_targets'
1d6d81292 VTKmConfig: Only modify vtkm::cuda when it is an installed target

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2231
2020-08-21 13:31:15 -04:00
Robert Maynard
6db300ce77 Merge topic 'updates_to_gitlabci'
c73bc0a93 CI: add clang+cuda and correct missing cuda packages on centos

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2229
2020-08-21 12:03:47 -04:00
Robert Maynard
1d6d812922 VTKmConfig: Only modify vtkm::cuda when it is an installed target 2020-08-21 11:59:24 -04:00
Robert Maynard
c73bc0a93f CI: add clang+cuda and correct missing cuda packages on centos 2020-08-21 08:31:27 -04:00
Kenneth Moreland
6cbcb9f5d7 Fix behavior of Cuda AtomicLoad with SequentiallyConsistent
According to Allie Vacanti, a sequentially consistent load requires a
full fence on Cuda hardware to be conforming.

Also improved the documentation of `MemoryOrder` based on Allie's
suggestion.

Also removed the `Consume` memory order based on Allie's suggestion. It
is tricky to use correctly, and most implementations just regress to the
safer `Acquired` behavior anyway.
2020-08-20 17:53:47 -06:00
Kenneth Moreland
7573d4ed57 Fix compiler warnings 2020-08-20 17:08:36 -06:00
Kenneth Moreland
147dd24d01 Remove ARM intrinsics in MSVC 2020-08-20 17:08:36 -06:00
Kenneth Moreland
2229c22f40 Avoid invalid Kokkos atomic calls 2020-08-20 17:08:21 -06:00
Kenneth Moreland
3b147878f5 Always use our implementation of Cuda atomics
Previously, if Kokkos was enabled we always used Kokkos atomics.
However, if a user, for some reason, compiled with a version of Kokkos
that was _not_ compiled for Cuda and we turned on our own Cuda device
adapter, that would cause a problem. The old code assumed Kokkos would
create the Cuda version of the atomics, but it would not. Thus, there
would be no atomics for Cuda.

Resolved this problem by switching the order in which we try to define
atomics. Use our version of atomics whenever compiling for a Cuda
device. Otherwise, try to compile the Kokkos version (and if that is not
available, use ours as before.
2020-08-20 14:20:32 -06:00
Kenneth Moreland
9e6fe8fb66 Add memory order semantics to atomic functions
To ensure correctness of an atomic function, it is often necessary to
force a compiler to order operations correctly. However, doing so may
slow things down, so it is helpful to relax these constraints if they
are not necessary. Add the ability to select the correct memory order
constraints in the atomic functions.
2020-08-20 13:40:44 -06:00
Kenneth Moreland
d2ac4b860c Be more careful in casting with Atomic functions
Previously, the atomic functions accepted any type as its operand and
then cast that to the storage type. That could cause some rather
unexpected behavior. For example, casting a floating point number to an
integer might not give you the behavior as expected. So that behavior as
been removed and now the operand has to match the pointer.

However, all the currently supported atomics are unsigned, and there are
many reasons that it might be easier to use signed as operands. (For
example, C literals are signed.) Thus, a second condition that allows
the sign to be swapped has been added so that you don't get annoying
signed/unsigned conversion warnings.
2020-08-20 13:40:44 -06:00
Kenneth Moreland
13056b3af5 Deprecate AtomicInterfaceControl and AtomicInterfaceExecution
Now that we have the functions in `vtkm/Atomic.h`, we can deprecate (and
eventually remove) the more cumbersome classes `AtomicInterfaceControl`
and `AtomicInterfaceExecution`.

Also reversed the order of the `expected` and `desired` parameters of
`vtkm::AtomicCompareAndSwap`. I think the former order makes more sense
and matches more other implementations (such as `std::atomic` and the
GCC `__atomic` built ins). However, there are still some non-deprecated
classes with similar methods that cannot easily be switched. Thus, it's
better to be inconsistent with most other libraries and consistent with
ourself than to be inconsitent with ourself.
2020-08-20 13:40:44 -06:00
Kenneth Moreland
82d6ca9854 Allow Kokkos atomic functions to work without cuda device compiler
If the Kokkos device is enabled, we use the Kokkos atomic functions for
implementation since Kokkos has already ported all of these to each
device.

If Kokkos is compiled with CUDA, then the functions are marked with
`__device__` and `__host__`. Makes sense right?

Unless we are trying to use the atomic functions on host code compiled
only for the host. In that case, modifiers like `__device__` will cause
compiler errors.

So we want to disable Kokkos from using `__device__`, but only if CUDA
is enabled and we are not using the CUDA compiler. Had to hack things up
to get that to work.
2020-08-20 13:40:44 -06:00
Kenneth Moreland
d3503bfaba Implement AtomicInterfaceControl/Execution with free functions
Now that we have atomic free functions (e.g. `vtkm::AtomicAdd()`), we no
longer need special implementations for control and each execution
device. (Well, technically we do have special implementations for each,
but they are handled with compiler directives in the free functions.)

Convert the old atomic interface classes (`AtomicInterfaceControl` and
`AtomicInterfaceExecution`) to use the new atomic free functions. This
will allow us to test the new atomic functions everywhere that atomics
are used in VTK-m.

Once verified, we can deprecate the old atomic interface classes.
2020-08-20 13:40:44 -06:00
Kenneth Moreland
ebbebd7369 Add atomic free functions
Previously, all atomic functions were stored in classes named
`AtomicInterfaceControl` and `AtomicInterfaceExecution`, which required
you to know at compile time which device was using the methods. That in
turn means that anything using an atomic needed to be templated on the
device it is running on.

That can be a big hassle (and is problematic for some code structure).
Instead, these methods are moved to free functions in the `vtkm`
namespace. These functions operate like those in `Math.h`. Using
compiler directives, an appropriate version of the function is compiled
for the current device the compiler is using.
2020-08-20 13:40:43 -06:00
Robert Maynard
14333ded1b Merge topic 'update_to_support_CMAKE_CUDA_ARCHITECTURES'
96fc02ebc VTK-m when using CMake 3.18 can propagate cuda flags cleanly

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2149
2020-08-20 14:02:09 -04:00
Robert Maynard
96fc02ebca VTK-m when using CMake 3.18 can propagate cuda flags cleanly 2020-08-20 13:12:05 -04:00
Robert Maynard
074c8b1100 Merge topic 'properly_suppress_warning_when_using_clang_as_cuda_compiler'
78a663102 Correct cuda compiler flag ordering for clang as CUDA host compiler

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2226
2020-08-20 10:04:13 -04:00
Robert Maynard
78a6631026 Correct cuda compiler flag ordering for clang as CUDA host compiler 2020-08-20 08:34:23 -04:00
Vicente Bolea
1b0de59ffd Merge topic 'fix-501-windows-library-limit'
afd394377 cmake: split vtkm_filter into common|extra|contour|gradient

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2186
2020-08-19 20:45:52 -04:00
Vicente Adolfo Bolea Sanchez
afd394377e cmake: split vtkm_filter into common|extra|contour|gradient
There is a limitation in Windows builds using VS2019 where libraries cannot be
bigger than 4GiB. This is normally not an issue but in `VTKm` due to its strong
template usage libraries can reach that size.

The `VTKm` filter library is can easily reach that size and it will halt the
build

This MR tries to avoid reaching those sizes for now by splitting the filter
library into four smaller libraries.

The proposal scheme is:

It splits vtkm-filter into:

  - vtkm-common, Classes that are dependencies of other filter libs.
  - vtkm-contour, Contour class and its instantiations.
  - vtkm-contour, Gradient class and its instantiations.
  - vtkm-extra, Classes other than Contour or Gradient that are
    not dependencies.

Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2020-08-19 19:20:43 -04:00
Robert Maynard
62c2938b0e Merge topic 'make_sure_cuda_kokkos_builds_use_sccache'
da1fec67b Kokkos CUDA builds now use sccache for CUDA compilation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2222
2020-08-19 11:56:14 -04:00
Robert Maynard
da1fec67b9 Kokkos CUDA builds now use sccache for CUDA compilation 2020-08-19 09:44:58 -04:00
Nick Thompson
89ccd828df Merge topic 'benchmark_ode_2'
7b17e3889 Benchmark ODE integrators.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Dave Pugmire <dpugmire@gmail.com>
Merge-request: !2220
2020-08-19 09:43:50 -04:00
Kenneth Moreland
a709f63e72 Merge topic 'base-device-tests'
ed41874cc Consolidate tests for base vtkm code that is device-specific

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2219
2020-08-18 18:53:04 -04:00
Dave Pugmire
6c44bbb9cb Merge topic 'mpiStreamlines2'
d13a08b6a Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into mpiStreamlines2
530c4504d Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into mpiStreamlines2
6bfb91aac try to fix/debug the windows builds.
8b1520fdb address link errors in windows and gcc4.8 dashboard compile errors
5fa93a64f fix build errors
ec796445c Remove some print statements.
9bf49101c Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into mpiStreamlines2
4722dc67b Code review cleanup.
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !2210
2020-08-18 17:07:27 -04:00
Kenneth Moreland
ed41874cc8 Consolidate tests for base vtkm code that is device-specific
Some of the code in the base `vtkm` namespace is device specific. For
example, the functions in `Math.h` are customized for specific devices.
Thus, we want this code to be specially compiled and run on these
devices.

Previously, we made a header file and then added separate tests to each
device package. That was created before we had ways of running on any
device. Now, it is much easier to compile the test a single time for all
devices and use the `ALL_BACKENDS` feature of `vtkm_unit_tests` CMake
function to automatically create the test for all devices.
2020-08-18 14:30:25 -06:00
dpugmire
d13a08b6ae Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into mpiStreamlines2 2020-08-18 16:06:41 -04:00
NAThompson
7b17e38892 Benchmark ODE integrators. 2020-08-18 15:47:13 -04:00
Nick Thompson
88a0cff7cb Merge topic 'refactor_integrators'
8124fe81f Add missing #include.
6ea07cc1e Missing #include.
024ab1cff Put each ODE integrator in it's own file.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Dave Pugmire <dpugmire@gmail.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !2213
2020-08-18 15:36:54 -04:00
Nick
8124fe81fd Add missing #include. 2020-08-18 15:32:39 -04:00
NAThompson
6ea07cc1e8 Missing #include. 2020-08-18 15:32:39 -04:00
Nick
024ab1cff8 Put each ODE integrator in it's own file. 2020-08-18 15:32:39 -04:00
dpugmire
530c4504d7 Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into mpiStreamlines2 2020-08-18 13:58:49 -04:00
Nick Thompson
aefc18151e Merge topic 'pyexpander_fix'
4e72eb043 Don't apply pyexpander fix on Windows.
959db40aa Find expander.py on the syspath, do not call it from a Python interpreter.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !2214
2020-08-18 10:48:54 -04:00
dpugmire
6bfb91aac5 try to fix/debug the windows builds. 2020-08-18 09:38:32 -04:00
dpugmire
8b1520fdb7 address link errors in windows and gcc4.8 dashboard compile errors 2020-08-18 08:55:49 -04:00
dpugmire
5fa93a64ff fix build errors 2020-08-17 22:32:56 -04:00
dpugmire
ec796445cc Remove some print statements. 2020-08-17 16:57:09 -04:00
Nick
4e72eb0437 Don't apply pyexpander fix on Windows. 2020-08-17 16:39:47 -04:00
dpugmire
9bf49101ca Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into mpiStreamlines2 2020-08-17 16:35:40 -04:00
dpugmire
4722dc67b7 Code review cleanup. 2020-08-17 16:32:27 -04:00
dpugmire
240483ce96 make namespaces consistent. 2020-08-17 16:21:59 -04:00
dpugmire
58d8119f2a Addressing code review comments. 2020-08-17 15:33:29 -04:00
Nick
959db40aae Find expander.py on the syspath, do not call it from a Python interpreter. 2020-08-15 11:24:30 -04:00