Commit Graph

4970 Commits

Author SHA1 Message Date
Li-Ta Lo
f655e8f1f1 add overload of Run() for ArrayHandle 2018-05-01 15:48:26 -06:00
Kenneth Moreland
bb54d9d411 Merge topic 'scatter-on-dispatcher'
edc4c85f Move Scatter from Worklet to Dispatcher

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1172
2018-05-01 12:17:32 -04:00
Robert Maynard
06e15e601d Merge topic 'vtkm_vec_constructor_bug'
adcabb03 VTK-m Vec<> constructors are now more conservative.
6267deb6 CellDerivativeFor3DCell has a better version for Vec of Vec fields.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1170
2018-05-01 08:29:45 -04:00
Robert Maynard
e32eebeae9 Merge topic 'cuda_task_strided'
b56894dd Move VTK-m Cuda backend over to a grid-stride iteration pattern.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1171
2018-05-01 08:15:45 -04:00
Robert Maynard
b56894dd09 Move VTK-m Cuda backend over to a grid-stride iteration pattern.
This allows for easier host side logic when determining grid and block
sizes, and allows for a smaller library side by moving some logic
into compiled in functions.
2018-04-30 17:29:26 -04:00
Robert Maynard
adcabb034b VTK-m Vec<> constructors are now more conservative.
When you have a Vec<Vec<float,3>> it was possible to incorrectly correct
it with the contents of a Vec<double,3>. An example of this is:

using Vec3d = vtkm::Vec<double, 3>;
using Vec3f = vtkm::Vec<float, 3>;
using Vec3x3f = vtkm::Vec<Vec3f, 3>;

Vec3d x(0.0, 1.0, 2.0);
Vec3x3f b(x); // becomes [[0,0,0],[1,1,1],[2,2,2]]
Vec3x3f c(x, x, x); // becomes [[0,1,2],[0,1,2],[0,1,2]]
Vec3x3f d(Vec3f(0.0f,1.0f,2.0f)) //becomes [[0,0,0],[1,1,1],[2,2,2]]

So the solution we have chosen is to disallow the construction of objects such
as b. This still allows the free implicit cast to go from double to float.

So while `Vec3x3 b = x is supported by vtk-m, it produces very incorrect results.
2018-04-27 16:47:54 -04:00
Li-Ta Lo
6f85397192 Add vtkm::worklet::connectivity namespace
Created vtkm::worklet::connectivity namespace and worklets in the namespace.
2018-04-27 11:32:27 -06:00
Li-Ta Lo
ce27f5fcaa Change signature of ImageConnectivity::Run()
It takes CellSetStructured<2> and DynamicArrayHandle and uses CastAndCall
to resolve data type for pixels. Moved implementation to the RunImpl
function object.
2018-04-27 11:32:27 -06:00
Li-Ta Lo
648b0decfc add installation of header files in CMakeLists.txt 2018-04-27 11:32:27 -06:00
Li-Ta Lo
d94f2cae37 Add ImageConnectivity worklet
ImageConnectivity worklet implements a parallel connected component
labeling algorithm for 2D structured grids/images. For each pixel,
it search for the pixel's 6 neighbors and classify them as the
same connected component if their corresponding "color" field have
the same value.
2018-04-27 11:32:27 -06:00
Robert Maynard
6267deb67e CellDerivativeFor3DCell has a better version for Vec of Vec fields.
Previously we would compute a 3x3 matrix where each element was a Vec. Using
the jacobain of a single component is sufficient so by using that we safe 2 to
3 times the memory space.

Additionally by moving to doing the derivative as a per component algorithm
we work around the issues found in bug
https://gitlab.kitware.com/vtk/vtk-m/issues/221. In effect when trying to
construct a Vec of Vec from a component of a different floating type e.g.:

  Vec3d x(0.0, 1.0, 2.0);

  Vec3f a = x;
  Vec3x3f b = x;
  Vec3x3f c(x, x, x);

Generates bad values vectors such as b which look like:

b: [[0,0,0],[1,1,1],[2,2,2]]
c: [[0,1,2],[0,1,2],[0,1,2]]
2018-04-27 08:14:34 -04:00
Kenneth Moreland
edc4c85fd9 Move Scatter from Worklet to Dispatcher
Previously, when a Worklet needed a scatter, the scatter object was
stored in the Worklet object. That was problematic because that means
the Scatter, which is a control object, was shoved into the execution
environment.

To prevent that, move the Scatter into the Dispatcher object. The
worklet still declares a ScatterType alias, but no longer has a
GetScatter method. Instead, the Dispatcher now takes a Scatter object in
its constructor. If using the default scatter (ScatterIdentity), the
default constructor is used. If using another type of Scatter that
requires data to set up its state, then the caller of the worklet needs
to provide that to the dispatcher. For convenience, worklets are
encouraged to have a MakeScatter method to help construct a proper
scatter object.
2018-04-27 00:43:51 -04:00
Kenneth Moreland
5c5fb020a8 Merge topic 'fix-test-header-builds'
d393468e Add any OpenGL link targets to test builds
8b9c0f50 Re-add non testable files to test build sources
ffd98463 Load correct file extension in header test build
7c5f44a6 Fix warnings about no symbols
289a4bc1 Differentiate between header files with different extensions
9571c9b5 Fix vtkm_add_header_build_test

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1160
2018-04-25 23:01:10 -04:00
Li-Ta Lo
ca0e9d202d Change signature of ImageConnectivity::Run()
It takes CellSetStructured<2> and DynamicArrayHandle and uses CastAndCall
to resolve data type for pixels. Moved implementation to the RunImpl
function object.
2018-04-25 14:29:48 -06:00
Robert Maynard
fe3b1eeab3 Correct 'may be used uninitialized in this function' warnings in wavelets 2018-04-25 14:29:48 -06:00
Robert Maynard
fb23916dda Correct casting warnings found inside vtkm_rendering 2018-04-25 14:29:48 -06:00
Robert Maynard
38654e7ae9 Make sure when compiling CUDA code we suppress unknown pragma 2018-04-25 14:29:48 -06:00
Robert Maynard
9a667c10ba Correct issues found be enabling more CUDA warnings. 2018-04-25 14:29:48 -06:00
Robert Maynard
389133d3bf VTK-m when building CUDA code in debug now checks for more warnings 2018-04-25 14:29:48 -06:00
Utkarsh Ayachit
c5a9c3e6f7 Fix issues with VTKmDetermineVersion.
The code had 2 issues:
1. used obsolete 'output' if Git executable was missing. There was a
   possibility that output variable was never set and used some garbage
   value from parent scope.

2. version pattern matching was too liberal and would match
   absolute any long txt so long as it has some numbers in it that matched
   a typical version number.
2018-04-25 14:29:48 -06:00
Utkarsh Ayachit
2f94374174 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-25 14:29:48 -06:00
Utkarsh Ayachit
74c07af9d7 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-25 14:29:48 -06:00
Robert Maynard
d3120dc72c VTK-m now correctly specifies hidden symbol visibility be default.
This correct very weird runtime crashes that showed up under CUDA 7.5
2018-04-25 14:29:48 -06:00
Robert Maynard
3cb28d29c2 Update VTKmConfig documentation to list variables and targets VTK-m constructs
Fixes #219
2018-04-25 14:29:48 -06:00
Kenneth Moreland
f9eb61d2a1 Find OpenGL libraries in external projects
Previously when an external project loaded VTK-m with find_package(VTKm)
and then tried to use anything with OpenGL, you would get compiler (and
probably linker) errors. The problem was that
VTKmRenderingContexts.cmake skipped over the loading of OpenGL libraries
because the vtkm_rendering_gl_context target was imported before this
code was ever called. Correct the problem by going through the motions
of checking OpenGL every time.
2018-04-25 14:29:48 -06:00
Robert Maynard
699d010bbb On MSVC+CUDA pass -expt-relaxed-constexpr 2018-04-25 14:29:48 -06:00
Robert Maynard
487e3a0095 Remove usage of CMake commands that don't exist in CMake 3.3 2018-04-25 14:29:48 -06:00
Utkarsh Ayachit
41b91ca21a example: redistribute points using DIY
Adding an example that demonstrates how to write a distributed filter
that customizes the execution for all blocks in a MultiBlock. This is a
reinterpretation of the `reduce/all_to_all` example provided by DIY.
2018-04-25 14:29:48 -06:00
Utkarsh Ayachit
11590dd8ad 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-25 14:29:48 -06:00
Robert Maynard
782493ca59 Make sure that WaveletTransform doesn't emit maybe-uninitialized warnings 2018-04-25 14:29:48 -06:00
Robert Maynard
7d6fe56882 RK4Integrator now properly initializes all variables.
Previously the RK4Integrator could compute velocity with uninitialized inputs.
2018-04-25 14:29:48 -06:00
Robert Maynard
16b65f0d42 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-25 14:29:48 -06:00
Robert Maynard
1019ace8e2 Specify an RPATH for CUDA runtime on OSX so tests will run 2018-04-25 14:29:48 -06:00
Li-Ta Lo
cb3e821a60 add installation of header files in CMakeLists.txt 2018-04-25 14:29:34 -06:00
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
370eddae7b Merge topic 'vtkm_type_calls_consistently_inline'
dc6e7d1a Make all Vec types consistently mark methods as inline

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1168
2018-04-25 14:35:54 -04:00
Robert Maynard
dc6e7d1ac8 Make all Vec types consistently mark methods as inline 2018-04-25 10:48:28 -04:00
Robert Maynard
e10ee281c7 Merge topic 'correct_more_build_warnings'
4b9a8143 Correct 'may be used uninitialized in this function' warnings in wavelets
ebf96077 Correct casting warnings found inside vtkm_rendering

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1167
2018-04-24 15:27:56 -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
Kenneth Moreland
d393468e9c Add any OpenGL link targets to test builds 2018-04-24 11:47:26 -04:00
Robert Maynard
666a9c4f71 Merge topic 'improve_cuda_debug_build_warnings'
7c7b1ed5 Make sure when compiling CUDA code we suppress unknown pragma
b7e63718 Correct issues found be enabling more CUDA warnings.
4ca2522c VTK-m when building CUDA code in debug now checks for more warnings

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1164
2018-04-24 08:14:15 -04:00
ayenpure
5a843600dd Adding missing copyright information.
Adding copyright information to TemporalGridEvaluator which was missing earlier.
2018-04-23 17:05:11 -07:00
ayenpure
2d6d261b61 Fixing template errors for portability
Fixing template errors in integrators.
The code used to build locally, but fail on Kitware test machines.
Fixing templates as they were before any temporal advection changes.
2018-04-23 16:36:51 -07:00
Robert Maynard
7c7b1ed54a Make sure when compiling CUDA code we suppress unknown pragma 2018-04-23 15:27:08 -04:00
Robert Maynard
b7e6371842 Correct issues found be enabling more CUDA warnings. 2018-04-23 14:27:53 -04:00
Robert Maynard
4ca2522c6e VTK-m when building CUDA code in debug now checks for more warnings 2018-04-23 14:27:53 -04:00
Utkarsh Ayachit
1fe36af41f Merge topic 'fix-determine-version'
cf91ca52 Fix issues with VTKmDetermineVersion.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1166
2018-04-23 10:58:46 -04:00
Utkarsh Ayachit
cf91ca520e Fix issues with VTKmDetermineVersion.
The code had 2 issues:
1. used obsolete 'output' if Git executable was missing. There was a
   possibility that output variable was never set and used some garbage
   value from parent scope.

2. version pattern matching was too liberal and would match
   absolute any long txt so long as it has some numbers in it that matched
   a typical version number.
2018-04-23 10:30:27 -04:00