Commit Graph

2920 Commits

Author SHA1 Message Date
Kenneth Moreland
c16236ce69 Use ArrayRangeCompute without specifying a device
Most uses of ArrayRangeCompute just want to get the range of the data
and probably don't have a particular device in mind. Thus, it is better
to use a TryExecute internally use whatever devices are available.

Note that when using TryExecute, the calling code is expected to be able
to support all devices. That might not always be the case. Thus, I am
experimenting a bit with how we incorporate this in a library. The
advantage of having the code compiled in a library is that you only have
to compile it once and the calling code does not need to worry about
CUDA, etc.

However, because ArrayRangeCompute is templated, we can only pre-compile
some subset of array handle types. The most common are compiled into the
code (matching all the predefined ArrayHandles as well as some special
cases). If the code wants to use some other type, it has to include
ArrayRangeCompute.hxx. The only place where this is necessary is a test
that intentially trys to find the range on an uncommon type.

If array portals were to support virtual methods, then we should be able
to modify this code so that we could precompile for all array handle
types.
2017-03-09 13:18:36 -05:00
Kenneth Moreland
c1dc5b67f2 Merge topic 'algorithms-on-small-arrays'
8b33f2bc Fix device adapter algorithms for small arrays
72654641 ArrayHandle reallocations of 0

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !724
2017-03-09 13:17:03 -05:00
Kenneth Moreland
8b33f2bc79 Fix device adapter algorithms for small arrays
There were some issues for device adapter algorithms (like scan and
reduce) for empty arrays or arrays of size 1. This adds tests for these
short arrays to the device adapter algorithm tests and fixes these
problems.
2017-03-08 19:05:28 -05:00
Kenneth Moreland
726546419d ArrayHandle reallocations of 0
The basic storage has an implicit invariant that if the size of the
storage is 0 then the array is a null pointer. That invariant was broken
if the array was allocated and then Shrink or Allocate was called with
0. In that case, the array remained allocated by the size was set to 0.

This fixes the problem by making sure a Shrink(0) actually does an
Allocate(0) (to clear out the data) and that the basic storage always
frees its memory when allocating a 0 sized array.
2017-03-08 18:53:06 -05:00
Sujin Philip
149fd79386 Merge topic 'move-BaseComponentOf-to-vtkm_BaseComponent'
b455636b Move BaseComponentOf to vtkm::BaseComponent

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !721
2017-03-08 12:37:13 -05:00
Sujin Philip
b455636bcd Move BaseComponentOf to vtkm::BaseComponent 2017-03-07 14:46:55 -05:00
Sujin Philip
1ceb46f802 Merge topic 'externalfaces-cleangrid'
e2efb839 External Faces filter add CompactPoints option

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !720
2017-03-07 13:59:23 -05:00
Sujin Philip
e2efb839a7 External Faces filter add CompactPoints option 2017-03-07 11:05:52 -05:00
Robert Maynard
fa04226b05 Merge topic 'array_range_compute_use_single_reduce_call'
d5dfb1f6 Restore ArrayRangeCompute to using a single Reduce call.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !719
2017-03-07 08:31:41 -05:00
Robert Maynard
d5dfb1f673 Restore ArrayRangeCompute to using a single Reduce call.
We can easily compute the min and max of an array using a single reduction
2017-03-06 16:14:48 -05:00
Sujin Philip
dbdcfc50a8 Merge topic 'rename-StreamCompact-to-CopyIf'
9eddce6c Rename StreamCompact to CopyIf

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !717
2017-03-06 14:17:19 -05:00
Kenneth Moreland
e51105e84b Merge topic 'input-domain-tag-invocation'
297c1b07 Add InputDomainTag to Invocation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !718
2017-03-06 11:13:38 -05:00
Sujin Philip
9eddce6c99 Rename StreamCompact to CopyIf
Plus, removes the version that uses one array as both input and stencil.
2017-03-06 11:08:27 -05:00
Sujin Philip
e28037876d Merge topic 'ExternalFacesFilter-MappPointFields'
269691e7 Map point fields in ExternalFaces filter

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !716
2017-03-06 08:26:38 -05:00
Kenneth Moreland
297c1b0709 Add InputDomainTag to Invocation 2017-03-03 20:20:35 -07:00
Sujin Philip
269691e7ff Map point fields in ExternalFaces filter 2017-03-03 15:43:52 -05:00
Sujin Philip
f1bc19f4a2 Merge topic 'improve-ExternalFaces-filter'
b1d6e743 Improve ExternalFaces filter

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !714
2017-03-03 08:33:30 -05:00
Sujin Philip
b1d6e74353 Improve ExternalFaces filter
Now it can work with more types of input CellSets.
2017-03-02 16:31:01 -05:00
David Lonie
e634946a2d Merge topic 'marching_cubes_normals_name'
8d5f4eb6 Expose the normal array's name in the MarchingCubes filter.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !713
2017-03-02 13:37:11 -05:00
Robert Maynard
82647e411c Merge topic 'correct_rendering_symbol_vis_osx_issue'
ae9a8fd0 Fix CellSet* typeid to consistent across dynamic libraries.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Matt Larsen <mlarsen@cs.uoregon.edu>
Reviewed-by: Berk Geveci <berk.geveci@kitware.com>
Merge-request: !712
2017-03-02 13:35:23 -05:00
David C. Lonie
8d5f4eb690 Expose the normal array's name in the MarchingCubes filter. 2017-03-02 12:15:20 -05:00
Robert Maynard
ae9a8fd0a4 Fix CellSet* typeid to consistent across dynamic libraries.
Since we don't have explicit template instantiations for CellSetExplicit
and CellSetSingleType we need to mark them as being exported from all
libraries.
2017-03-01 17:12:46 -05:00
Sujin Philip
57f5881538 Merge topic 'use-c++11=delete'
8c4bbc39 Use C++11 =delete keyword

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !708
2017-02-24 13:31:57 -05:00
Kenneth Moreland
3e77f4e18b Merge topic 'refactor-runtime-device-tracker'
18c4190d Update classes using RuntimeDeviceTracker
200928ef Add a global RuntimeDeviceTracker
a3573117 Compile RuntimeDeviceTracker.cxx with CUDA when appropriate
814b2db1 Add the implementation of RuntimeDeviceTracker to cont library
b9d3206e Move RuntimeDeviceTracker to vtkm::cont

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !707
2017-02-24 10:50:19 -05:00
Sujin Philip
8c4bbc39ad Use C++11 =delete keyword 2017-02-24 09:39:22 -05:00
David Lonie
69fe31005b Merge topic 'verbose_castandcall_errors'
7e34f861 Append newline to ArrayHandle summaries.
6f417a38 Add type information to array summaries and cast/call errors.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !705
2017-02-24 09:03:31 -05:00
Sujin Philip
e5bc34e9f5 Merge topic 'catch-by-reference'
a88807fd Catch all exceptions by reference

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !704
2017-02-23 16:36:00 -05:00
David Lonie
12a9a390f7 Merge topic 'clip_filter_output_clipped_coords'
14f216d5 Update the output coordinates for the clip filter.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !706
2017-02-23 15:45:05 -05:00
Sujin Philip
a88807fd7e Catch all exceptions by reference 2017-02-23 13:25:01 -05:00
David C. Lonie
7e34f86115 Append newline to ArrayHandle summaries. 2017-02-23 12:48:32 -05:00
David C. Lonie
14f216d58e Update the output coordinates for the clip filter.
The clip worklet will change the number of points in the result
set by adding points at the clip boundaries. The filter was updating
the clipped scalar array to reflect the new points, but not the actual
coordinate array.

This patch will cause the clip filter's result dataset to contain the
correct number of points and no longer automatically map the scalar
array onto the output, since this is easily done via the filter API.
2017-02-23 12:41:40 -05:00
Kenneth Moreland
04be000d23 Merge topic 'vec-variable-output-fix'
81f7ff23 Make offsets for ArrayHandleGroupVecVariable always input

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !703
2017-02-23 12:12:09 -05:00
Kenneth Moreland
18c4190d85 Update classes using RuntimeDeviceTracker
They now grab the global runtime device tracker. In some cases, I've
added the ability to set/get the tracker to change it from the global.
In others I just removed the local copy, since it was just hooked into
the global tracker.
2017-02-23 09:54:41 -07:00
David C. Lonie
6f417a386b Add type information to array summaries and cast/call errors.
This isn't always the most human readable type info on some platforms,
but it does greatly assist in tracking down why a cast failed.
2017-02-23 11:20:45 -05:00
Kenneth Moreland
200928ef35 Add a global RuntimeDeviceTracker
Next up is using this by default pretty much everywhere you want to run
an algorithm but don't care on what device.
2017-02-23 09:19:13 -07:00
David Lonie
ccf73f3e6e Merge topic 'map_fields_ignore_filter_traits'
ab9e1f6e Ignore filter traits when mapping fields to output.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !701
2017-02-23 11:18:13 -05:00
Matt Larsen
57ad3c8cb5 Merge topic 'remove_unused_code_ray_tracer'
a6bd88d2 Removing unused timing code and headers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !702
2017-02-22 19:27:18 -05:00
Kenneth Moreland
a3573117de Compile RuntimeDeviceTracker.cxx with CUDA when appropriate
The RuntimeDeviceTracker.cxx contains a library method that queries the
CUDA device, which only works if compiled as a CUDA source file.

This set up will allow code that is not compiled with CUDA use a
RuntimeDeviceTracker with other code that does use CUDA.
2017-02-22 16:18:23 -07:00
Matt Larsen
a6bd88d2fe Removing unused timing code and headers 2017-02-22 14:45:33 -08:00
Kenneth Moreland
81f7ff2391 Make offsets for ArrayHandleGroupVecVariable always input
The offsets for an ArrayHandleGroupVecVariable are always inputs
and cannot be changed, even when the array handle is used as an output.
There was a mistake where the PrepareFor* methods tried to make
the offsets mutable. In the case of an output, the offsets were not
pushed to the execution environment, and the arrays could not be looked
up.
2017-02-22 15:44:06 -07:00
Kenneth Moreland
814b2db18c Add the implementation of RuntimeDeviceTracker to cont library
This allows code to include the RuntimeDeviceTracker without depending
on the device-specific adapters (I think).

Also changed the implementation to use a shared_ptr for the state so you
can pass it around and share the state easier.
2017-02-22 15:25:04 -07:00
Matt Larsen
6d9766943e Merge topic 'volume_rendering_fix'
7d4334b5 Had conditional backwards
50ccedf8 Fixing the default behavior of the volume renderer

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !700
2017-02-22 17:17:54 -05:00
Kenneth Moreland
b9d3206ea6 Move RuntimeDeviceTracker to vtkm::cont
Before it was in the vtkm::cont::internal namespace. However, we expect
to be using this feature quite a bit more as we want VTK-m to handle
multiple devices effectively (as in, just figure it out and go).
2017-02-22 13:33:52 -07:00
David C. Lonie
ab9e1f6e9d Ignore filter traits when mapping fields to output.
The input type restrictions in FilterTraits should not be used to
restrict the arrays that can be mapped to the output dataset.
2017-02-22 14:30:56 -05:00
Matt Larsen
7d4334b5e3 Had conditional backwards 2017-02-22 11:21:48 -08:00
Matt Larsen
50ccedf828 Fixing the default behavior of the volume renderer 2017-02-22 11:17:22 -08:00
Kenneth Moreland
d3eafe4b26 Merge topic 'range-comp-specialization'
6089e739 Match the two overload of ArrayRangeCompute

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !699
2017-02-22 12:02:35 -05:00
Kenneth Moreland
6089e7396e Match the two overload of ArrayRangeCompute
There are two versions of ArrayRangeCompute. The first version is a
general version that computes the min and max by running a reduction on
a device. The second version was a specialization for uniform grid
coordinate arrays, which is easily computed without looking at the
values.

The problem was that the generic version of ArrayRangeCompute took two
arguments and the specialization only took one argument (because it does
not need a device). This means that templated code uses the general
version will never use the specialized version. This fix adds a device
argument to the specialized version. The extra argument is not used, but
will properly overload the general version.
2017-02-21 16:22:53 -07:00
David Lonie
d86cbbac43 Merge topic 'generalize_clip_cellset'
d1181160 Allow any DynamicCellSetBase to be used with the Clip worklet.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !698
2017-02-20 09:34:30 -05:00
David C. Lonie
d118116055 Allow any DynamicCellSetBase to be used with the Clip worklet. 2017-02-17 16:31:50 -05:00