Commit Graph

5798 Commits

Author SHA1 Message Date
Kenneth Moreland
18b5be92d6 Fix issue with CUDA and ArrayHandleMultiplexer
When you try to call the `Reduce` operation in the CUDA device adapter
with a sufficently complex interator type, you get a compile error
that says `error: cannot pass an argument with a user-provided
copy-constructor to a device-side kernel launch`.

This appears to be a bug in either nvcc or Thrust. I believe it is
related to the following reported issues:

* https://github.com/thrust/thrust/issues/928
* https://github.com/thrust/thrust/issues/1044

Work around this problem by making a special condition for calling
`Reduce` with an `ArrayHandleMultiplexer` that calls the generic
algorithm in `DeviceAdapterAlgorithmGeneral` instead of the algorithm in
Thrust.
2020-07-06 13:51:36 -06:00
Robert Maynard
749a110cd0 Merge branch 'upstream-diy' into update_diy_to_always_build_with_pic
* upstream-diy:
  diy 2020-07-01 (b0623438)
2020-07-01 10:48:43 -04:00
Robert Maynard
5a2a26d3fc Update DIY to make sure we always build diy libs with pic enabled 2020-07-01 10:48:18 -04:00
Robert Maynard
a1680ef8bf Merge branch 'upstream-diy' into update_diy_to_namespace_DEBUG_define
* upstream-diy:
  diy 2020-06-24 (ab765e66)
2020-07-01 08:28:17 -04:00
Robert Maynard
f7b3d1bca7 Update DIY to not leak the DEBUG define
Fixes #539
2020-07-01 08:28:10 -04:00
Kenneth Moreland
42219f8d61 Fix buffer leak in BufferInfo 2020-06-29 16:36:21 -06:00
Kenneth Moreland
8e1c87b5c2 Work around known bug in LagrangianFilter
The implementation of LagrangianFilter uses some `ArrayHandle`s
declared as `static` in the .hxx header file. One of the bad
consequences of this is that there is no control over when the
arrays are freed. We have seen where these arrays get freed
after the CUDA system is closed, which causes nasty things to
happen as the program closes.

This works around the problem until a fix is implemnted.
2020-06-25 14:02:46 -06:00
Kenneth Moreland
a47fd42bc1 Pin user provided memory in ArrayHandle
Often when a user gives memory to an `ArrayHandle`, she wants data to be
written into the memory given to be used elsewhere. Previously, the
`Buffer` objects would delete the given buffer as soon as a write buffer
was created elsewhere. That was a problem if a user wants VTK-m to write
results right into a given buffer.

Instead, when a user provides memory, "pin" that memory so that the
`ArrayHandle` never deletes it.
2020-06-25 14:02:46 -06:00
Kenneth Moreland
56bec1dd7b Replace basic ArrayHandle implementation to use Buffers
This encapsulates a lot of the required memory management into the
Buffer object and related code.

Many now unneeded classes were deleted.
2020-06-25 14:02:26 -06:00
Kenneth Moreland
8f7b0d18be Add Buffer class
The buffer class encapsulates the movement of raw C arrays between
host and devices.

The `Buffer` class itself is not associated with any device. Instead,
`Buffer` is used in conjunction with a new templated class named
`DeviceAdapterMemoryManager` that can allocate data on a given
device and transfer data as necessary. `DeviceAdapterMemoryManager`
will eventually replace the more complicated device adapter classes
that manage data on a device.

The code in `DeviceAdapterMemoryManager` is actually enclosed in
virtual methods. This allows us to limit the number of classes that
need to be compiled for a device. Rather, the implementation of
`DeviceAdapterMemoryManager` is compiled once with whatever compiler
is necessary, and then the `RuntimeDeviceInformation` is used to
get the correct object instance.
2020-06-25 14:01:39 -06:00
Li-Ta Lo
365b1bb25c use make_ArrayHandleZip 2020-06-25 09:51:06 -06:00
Li-Ta Lo
980c4864ac Merge branch 'master' into standard_normal 2020-06-24 14:38:50 -06:00
Li-Ta Lo
beba90b6f7 Merge topic 'uniform_real'
143e3d39a remove unused type alias
01a448663 Merge branch 'master' into uniform_real
c67e5bb12 fixe warnings about implicit type conversion
1e4294392 Add deterministic seed to avoid potential spurious failure
5b0e309b9 the random source is still 64 bits
cc3061bab Avoid calling ReadPortal() all the time
9bf6dea22 remove inline initialization of seed
e69308047 Add statistics base testing, add Flot32 RNG

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2148
2020-06-24 16:36:36 -04:00
Nick
470058c328 Unfoobar the float_distance MR. 2020-06-24 10:52:59 -04:00
Kenneth Moreland
f6a8993469 Make tests that throw an STL exception fail
If a test throws any unexpected exception, the test is supposed to
detect that and fail. For the STL exceptions, the test failed to return
an error code. Fix that.
2020-06-23 16:25:09 -06:00
Kenneth Moreland
7f60b0025d Merge topic 'cuda-no-assert'
c84588caf Re-add assert to fix deadlock
270ba214d Disable asserts for CUDA architecture builds

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2157
2020-06-22 21:18:17 -04:00
Kenneth Moreland
c84588caf7 Re-add assert to fix deadlock
For some reason, `UnitTestContourTreeUniformAugmentedFilterCUDA` was
deadlocking on some of the dashboards when `VTKM_ASSERT` was changed to
be empty when compiling CUDA kernels (for compiler performance reasons).
Fix this by calling `assert` directly in this case.

For the life of me, I cannot figure out why this would be an issue.
Clearly the `assert` is never actually called or else the test would
error out (unless a special condition in CUDA is causing it to be
hidden). But if you take out the code, something changes to lock up the
kernel.
2020-06-22 17:10:33 -06:00
Kenneth Moreland
270ba214d5 Disable asserts for CUDA architecture builds
`assert` is supported on recent CUDA cards, but compiling it appears to be
very slow. By default, the `VTKM_ASSERT` macro has been disabled whenever
compiling for a CUDA device (i.e. when `__CUDA_ARCH__` is defined).

Asserts for CUDA devices can be turned back on by turning the
`VTKm_NO_ASSERT_CUDA` CMake variable off. Turning this CMake variable off
will enable assertions in CUDA kernels unless there is another reason
turning off all asserts (such as a release build).
2020-06-22 13:54:22 -06:00
Matt Larsen
280d3e6909 Merge topic 'fix/rendering_export'
1c63c7032 export symbols need by vtkh

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2154
2020-06-22 15:35:42 -04:00
Robert Maynard
3029994a97 Remove some unneeded include statements from vtkm/exec 2020-06-22 09:28:51 -04:00
dpugmire
0654d1853d fix cuda compile, export function. 2020-06-19 10:57:30 -04:00
Matt Larsen
1c63c7032a export symbols need by vtkh 2020-06-19 07:41:54 -07:00
dpugmire
00b1f85ebd link error 2020-06-18 21:42:51 -04:00
dpugmire
6d1930bc20 forgot the storage tags 2020-06-18 19:41:37 -04:00
dpugmire
03e3198977 move funcs to cxx, remove storage template 2020-06-18 19:37:09 -04:00
dpugmire
bac9664104 Move array copy to cxx 2020-06-18 17:53:19 -04:00
dpugmire
35ed68911e fix compile error. 2020-06-18 15:59:09 -04:00
dpugmire
1a7823c604 code cleanup. 2020-06-18 15:50:25 -04:00
dpugmire
02d8c3782d Add unittest for particlearraycopy 2020-06-18 15:45:36 -04:00
Li-Ta Lo
143e3d39a6 remove unused type alias 2020-06-18 13:33:20 -06:00
dpugmire
24451a3de2 Create a function for copying fields from particle arrays. 2020-06-18 14:54:18 -04:00
Li-Ta Lo
01a4486638 Merge branch 'master' into uniform_real 2020-06-18 11:46:18 -06:00
Li-Ta Lo
c67e5bb121 fixe warnings about implicit type conversion 2020-06-18 11:35:33 -06:00
dpugmire
1ef1180692 Add hxx into cmake file. 2020-06-18 11:59:10 -04:00
dpugmire
4952a628ff Add particle advection filter. 2020-06-18 11:52:16 -04:00
Kenneth Moreland
45c29a0c62 Merge topic 'override-deprecated-warnings'
3d991d1d8 Fix warnings about overriding deprecated methods

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2151
2020-06-18 08:26:05 -04:00
Kenneth Moreland
3d991d1d84 Fix warnings about overriding deprecated methods
The VS compiler gives a warning when you override a deprecated method.
Changed the StartScene and EndScene methods in Mapper to be non-virtual
with empty implementations. Deleted the corresponding methods from all
subclasses.
2020-06-17 17:58:07 -06:00
Li-Ta Lo
2aea7534bd Add ArrayHandleRandomStandardNormal 2020-06-17 15:48:09 -06:00
Kenneth Moreland
8a1df977a7 Add common superclass to VariantArrayHandleBase
Many of the operations of `VariantArrayHandleBase` are not dependent on
the TypeList parameter of the class. Still others can operate just as
well by providing a type list to a method. Thus, it is convenient to
create a superclass that is not templated. That allows us to pass around
a `VariantArrayHandle` when the type list does not matter.

This superclass is called `VariantArrayHandleCommon` because "base" was
already taken.
2020-06-17 15:38:20 -06:00
Kenneth Moreland
c35abc732f Rename IsInValidArrayHandle to IsInvalidArrayHandle
This makes it clear that it returns true for an invalid array handle.
The previous name implied that it was looking for an ArrayHandle in some
"valid" set, which is the opposite.
2020-06-17 15:38:19 -06:00
Kenneth Moreland
31feaed0f8 Merge topic 'fix-warnings'
0a4317709 Fix issues of calling __host__ from __device__
dd4d88cd5 Fix warnings about comparing floating point values
cd4b59059 Fix warnings about data type conversion

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2146
2020-06-17 17:23:07 -04:00
Kenneth Moreland
0a4317709e Fix issues of calling __host__ from __device__
Some methods were marked as `VTKM_CONT` when they should have been
marked `VTKM_EXEC_CONT`.
2020-06-17 14:55:43 -06:00
Li-Ta Lo
1e42943928 Add deterministic seed to avoid potential spurious failure 2020-06-17 13:36:15 -06:00
Li-Ta Lo
5b0e309b95 the random source is still 64 bits 2020-06-17 12:58:03 -06:00
Li-Ta Lo
cc3061bab1 Avoid calling ReadPortal() all the time 2020-06-17 12:53:11 -06:00
Li-Ta Lo
9bf6dea226 remove inline initialization of seed 2020-06-17 12:47:54 -06:00
Li-Ta Lo
e69308047b Add statistics base testing, add Flot32 RNG 2020-06-17 12:01:10 -06:00
Kenneth Moreland
dd4d88cd5e Fix warnings about comparing floating point values 2020-06-17 11:58:45 -06:00
Dave Pugmire
d30293ee2f Merge topic 'betterParticleAdvectionDiffs2'
474473063 Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into betterParticleAdvectionDiffs2
447e8aff0 Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into betterParticleAdvectionDiffs2
27c39217d remove debug statements
1a2910165 debug for dashboard.
cff830fb4 Remove some debugging code.
b5270f5fa change float/double to vtkm typedefs.
ee4146667 Accidently added some garbage numbers to line 35. Removed it.
bece39ec4 Fix compiler warnings.
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2138
2020-06-17 13:30:41 -04:00
Nick Thompson
83cf25f1f3 Merge topic 'deprecate_startscene'
8065e76e7 Deprecate StartScene() and EndScene()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2140
2020-06-17 12:48:40 -04:00