Commit Graph

3503 Commits

Author SHA1 Message Date
Robert Maynard
4e7837e9f9 Merge topic 'reduce_unneeded_copies_in_colortable_code'
1ec478ce ColorTable now converts to and from double less often.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1169
2018-04-25 16:27:35 -04:00
Robert Maynard
1ec478ce62 ColorTable now converts to and from double less often.
Previously we would convert to double to perform some operations instead
of always staying in float space.
2018-04-25 15:35:27 -04:00
Robert Maynard
dc6e7d1ac8 Make all Vec types consistently mark methods as inline 2018-04-25 10:48:28 -04:00
Robert Maynard
4b9a8143c8 Correct 'may be used uninitialized in this function' warnings in wavelets 2018-04-24 13:27:51 -04:00
Robert Maynard
ebf96077fd Correct casting warnings found inside vtkm_rendering 2018-04-24 13:00:33 -04:00
Robert Maynard
b7e6371842 Correct issues found be enabling more CUDA warnings. 2018-04-23 14:27:53 -04:00
Utkarsh Ayachit
6d0e3036e4 Merge topic '220-filter-copy-fields'
cb7cbdbc fixes #220: pass only requested fields.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1162
2018-04-23 09:16:28 -04:00
Utkarsh Ayachit
cb7cbdbcf9 fixes #220: pass only requested fields.
Adding API to DataSet to `CopyStructure` from another dataset. This
copies the cellsets and coordinate systems while leaving the fields
unchanged.

CreateResult no longer copies all input fields to the output dataset
created.

Furthermore, if a Filter subclass doesn't provide `MapFieldOntoOutput`,
then the default implementation simply copies only the selected fields
to the output dataset.
2018-04-20 14:22:47 -04:00
Utkarsh Ayachit
5d3d49713a Avoid using ArrayHandle for message exchange.
Minimizing the need to have complex serialization code in vtkm/cont.
This is first step in moving DIY serialization code out of vtkm/cont. We
need to move that to filter so we can leverage policy correctly
serialize fields.
2018-04-19 21:06:38 -04:00
Utkarsh Ayachit
8a5f0a521d Merge topic 'redistribute-points-examples'
07ba6c25 example: redistribute points using DIY
e62ff809 Fix BoundsCompute for missing coordinate system.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Matt Larsen <mlarsen@cs.uoregon.edu>
Merge-request: !1151
2018-04-18 11:51:25 -04:00
Robert Maynard
84386f28eb Merge topic 'correct_maybe_uninitialized_warnings'
da45e81d Make sure that WaveletTransform doesn't emit maybe-uninitialized warnings
c33bf063 RK4Integrator now properly initializes all variables.
d2001fb5 Suppress strict overflow optimization warnings.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1152
2018-04-17 14:51:34 -04:00
Robert Maynard
da45e81d9b Make sure that WaveletTransform doesn't emit maybe-uninitialized warnings 2018-04-17 14:24:19 -04:00
Robert Maynard
c33bf063f4 RK4Integrator now properly initializes all variables.
Previously the RK4Integrator could compute velocity with uninitialized inputs.
2018-04-17 14:24:19 -04:00
Robert Maynard
d2001fb52e Suppress strict overflow optimization warnings.
This warning is emitted when the compiler performs an optimization, and wants
you to verify that the presumptions it is making are valid. For this case
we can correctly promise the compiler that the values will not overflow and
the optimizations are correct.
2018-04-17 11:48:39 -04:00
Utkarsh Ayachit
e62ff8096a Fix BoundsCompute for missing coordinate system.
DataSet::GetCoordinateSystem(Id) doesn't throw `ErrorBadValue`. Fixed
BoundsCompute to check for number of coordinate systems instead.
2018-04-16 16:57:36 -04:00
Utkarsh Ayachit
89041e4f8e Compute correct histogram for distributed multiblock cases.
Histogram filter now correctly computes the histogram for multiblock
input or when operating in a distributed environment. It employs
reduction to reduce local/per block results to generate the final
output.
2018-04-12 16:40:19 -04:00
Utkarsh Ayachit
0af0271f59 Filter API enhancements.
This revamps Filter API to improve support for multiblock dataset and
distributed use-cases. Filters now operate on MultiBlock alone thus
`Filter::Execute(MultiBlock&)` is the primary method.
`Filter::Execute(DataSet*)` is only provided as an convenience that
internally puts the dataset into a MultiBlock and calls the primary
method.

Subclasses can provides PreExecute and PostExecute overrides to handle
init/reduction operations for filters with operating on multiple blocks.
Since blocks can be distributed, filters are expected to handle that as
well.

Subclasses can provide `PrepareForExecution(MultiBlock*..)` to customize
behavior for handling multiblock inputs. Default is to simply loop
over blocks.
2018-04-12 16:40:19 -04:00
Utkarsh Ayachit
b31af29a8d New constructor for AssignerMultiBlock.
AssignerMultiBlock can now be created by simply passing in the number of
blocks on the local process.
2018-04-12 16:40:18 -04:00
Utkarsh Ayachit
dd3709c3ec make MultiBlock constructors explicit.
This avoids silent conversion from vtkm::Id or std::vector<DataSet> to
MultiBlock.
2018-04-12 16:40:18 -04:00
Utkarsh Ayachit
7fbd020478 FieldHistogram: support using precomputed range
Updated FieldHistogram worklet to support executing the worklet using a
precomputed range. This will be needed for distributed and multiblock
use-cases.
2018-04-12 16:40:18 -04:00
Utkarsh Ayachit
ddd14f25e3 mpi: avoid MPI calls when not using MPI.
AssignerMultiBlock did a mpi::scan which could get called when there was
only 1 rank (e.g. built with MPI, but without initializing it). Fixed
that.
2018-04-12 16:40:18 -04:00
Utkarsh Ayachit
8ecc21c0f1 init MPI when needed.
EnvironmentTracker now initializes MPI if not already initialized in MPI
builds. This is required so that MPI calls the DIY may make don't fail.
2018-04-12 16:40:18 -04:00
Robert Maynard
06c3389aa7 Merge topic 'correct_cuda_calling_host_function_warnings'
73c05c10 Suppressions of __host__ warnings shouldn't trigger internal compile errors
5100e559 Suppress warnings about calling __host__ functions from CUDA 9.0
282c515e Suppress warnings about calling __host__ functions from CUDA 8.0
5dfdc830 Cuda will also print error/warning pragma values now.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1150
2018-04-12 14:35:01 -04:00
Utkarsh Ayachit
d5b48645a3 Merge topic '217-add-distribute-testing-support'
3211c150 add support to run test with MPI.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1148
2018-04-12 14:26:47 -04:00
Robert Maynard
73c05c10c7 Suppressions of __host__ warnings shouldn't trigger internal compile errors 2018-04-12 12:04:53 -04:00
Robert Maynard
5100e559c7 Suppress warnings about calling __host__ functions from CUDA 9.0 2018-04-12 10:31:19 -04:00
Robert Maynard
282c515ea8 Suppress warnings about calling __host__ functions from CUDA 8.0 2018-04-12 10:06:57 -04:00
Utkarsh Ayachit
3211c1501c add support to run test with MPI.
`vtkm_unit_tests` now supports an MPI option that can be used to add
test that run with MPI. Adding `UnitTestFieldRangeGlobalCompute` to test
global ranges for fields.
2018-04-10 14:48:37 -04:00
James
a79b4c2ff2 Removing move command to remove warnings. 2018-04-10 10:27:12 -04:00
James
02a67d64bf Merge remote-tracking branch 'upstream/master' into rendering-label-leak 2018-04-09 14:11:43 -04:00
James
3bab4087dc Adding delete and assignment oeprators to annotations. 2018-04-09 14:09:52 -04:00
James
e3ccd7f86c Adding previous cmake fix. 2018-04-09 14:04:52 -04:00
Robert Maynard
2ed1bb7271 Merge topic 'color_table_stop_leaking_memory'
86c487e6 Properly clean up ColorTable's memory.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Acked-by: James Kress <james@jameskress.com>
Merge-request: !1141
2018-04-09 08:18:56 -04:00
Matt Larsen
715141737f Merge topic 'typos'
efdf8543 Misc. Typos

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Matt Larsen <mlarsen@cs.uoregon.edu>
Merge-request: !1113
2018-04-06 18:04:46 -04:00
Utkarsh Ayachit
6938b05c33 Remove GetBounds methods from MultiBlock.
Removing GetBounds and related methods from MultiBlock. These have been
replaced by BoundsCompute and BoundsGlobalCompute.
2018-04-05 17:31:49 -04:00
Utkarsh Ayachit
c4970604fa Add BoundsCompute and BoundsGlobalCompute
Adding compute function to compute local and global bounds for datasets
and multiblocks alike.
2018-04-05 17:16:10 -04:00
Utkarsh Ayachit
f966a36214 Remove MultiBlock::GetGlobalNumberOfBlocks.
Removing another API that need not be on MultiBlock. There's generally
no need for apps to know this. If needed, we can add `...Compute`
function. This removes another API on MultiBlock that could trigger
parallel communication/synchronization.
2018-04-05 17:16:10 -04:00
Utkarsh Ayachit
f37e642563 Remove MultiBlock::GetGlobalRange API.
Removing MultiBlock::GetGlobalRange API to keep things consistent with
DataSet API. Instead, one should use `FieldRangeCompute` or
`FieldRangeGlobalCompute` as appropriate.
2018-04-05 17:16:10 -04:00
Utkarsh Ayachit
20a052f44e add FieldRangeCompute. 2018-04-05 17:16:10 -04:00
Utkarsh Ayachit
50bfb1d206 Add utility to serialize ArrayHandles for DIY. 2018-04-05 17:16:10 -04:00
Robert Maynard
86c487e614 Properly clean up ColorTable's memory. 2018-04-05 14:43:51 -04:00
Robert Maynard
adfff37e2c Merge topic 'cmake_refactor'
8472b64e Suppress more CUDA host function from a host/device function warnings
cd333bf8 Remove unneeded semicolon after closing parentheses on a some methods.
84311a24 Merge branch 'master' into cmake_refactor
83b360f1 vtkm::Lerp now casts integer types to an appropriate scalar type.
0d45c5cf Correct warnings found after disabling all warning when CUDA is enabled.
8808b41f Merge branch 'master' into vtk-m-cmake_refactor
d205f953 Update the documentation on when we need CMake 3.9+
e630ac5a Merge branch 'master' into vtk-m-cmake_refactor
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1135
2018-04-05 12:35:38 -04:00
Kenneth Moreland
59ec3f887f Merge topic 'icc-in-gcc-mode'
3dd66e85 Do not use __assume for icc in gcc compatability mode

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1139
2018-04-05 12:24:14 -04:00
Robert Maynard
8472b64e60 Suppress more CUDA host function from a host/device function warnings 2018-04-05 10:55:43 -04:00
Robert Maynard
cd333bf8dc Remove unneeded semicolon after closing parentheses on a some methods. 2018-04-05 10:55:12 -04:00
Robert Maynard
84311a2453 Merge branch 'master' into cmake_refactor 2018-04-05 10:18:36 -04:00
Robert Maynard
84a772c38d Merge topic 'vtkm_storage_can_use_cuda_uvm_memory'
c1237969 VTK-m ArrayHandle can now take ownership of a user allocated memory location
707970f4 VTK-m StorageBasic is now able to give/take ownership of user allocated memory.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1137
2018-04-05 08:45:34 -04:00
Kenneth Moreland
3dd66e852a Do not use __assume for icc in gcc compatability mode
When using the GNU header files on a system, the icc compiler emulates
the behavior of the gcc compiler on the system. (See https://
software.intel.com/en-us/node/522750) This appears to mean that icc
features that are not available in gcc could get turned off. In
particular, we found that the __assume feature stopped working.

To get around this problem, do not use __assume when compiling with icc
and __GNUC__ is defined. Instead, use the available gcc features.
2018-04-04 15:00:03 -06:00
Robert Maynard
c123796949 VTK-m ArrayHandle can now take ownership of a user allocated memory location
Previously memory that was allocated outside of VTK-m was impossible to transfer to
VTK-m as we didn't know how to free it. By extending the ArrayHandle constructors
to support a Storage object that is being moved, we can clearly express that
the ArrayHandle now owns memory it didn't allocate.

Here is an example of how this is done:
```cpp
  T* buffer = new T[100];
  auto user_free_function = [](void* ptr) { delete[] static_cast<T*>(ptr); };

  vtkm::cont::internal::Storage<T, vtkm::cont::StorageTagBasic>
      storage(buffer, 100, user_free_function);
  vtkm::cont::ArrayHandle<T> arrayHandle(std::move(storage));
```
2018-04-04 11:28:25 -04:00
Robert Maynard
707970f492 VTK-m StorageBasic is now able to give/take ownership of user allocated memory.
This fixes the three following issues with StorageBasic.

1. Memory that was allocated by VTK-m and Stolen by the user needed the
proper free function called which is generally StorageBasicAllocator::deallocate.
But that was hard for the user to hold onto. So now we provide a function
pointer to the correct free function.

2. Memory that was allocated outside of VTK-m was impossible to transfer to
VTK-m as we didn't know how to free it. This is now resolved by allowing the
user to specify a free function to be called on release.

3. When the CUDA backend allocates memory for an ArrayHandle that has no
control representation, and the location we are running on supports concurrent
managed access we want to specify that cuda managed memory as also the host memory.
This requires that StorageBasic be able to call an arbitrary new delete function
which is chosen at runtime.
2018-04-04 11:27:57 -04:00