Commit Graph

1037 Commits

Author SHA1 Message Date
hschroot
20c1a04894 CopyInto function for ArrayHandles
ArrayHandles in DAX have a CopyInto function which allows the user to copy an array handle's data into a compatible STL type iterator. Originally this was fairly straight forward to implement since array handles in DAX are templated on the DeviceAdapterTag. In contrast, VTKm array handles use a polymorphic ArrayHandleExecutionManager under the hood allowing a single array handle to interface with multiple devices at runtime. To achieve this virtual functions are used. This makes implementing the CopyInto function difficult since it is templated on the IteratorType and virtual functions cannot be templated.

To work around this, I've implemented a concrete templated CopyInto function in the class derived from ArrayHandleExecutionManagerBase. In the ArrayHandle class, CopyInto dynamically casts the base class into the derived class, then calls the CopyInto function defined in the derived class.

The drawback to this approach is that, should the user define their own class that inherits from ArrayHandleExectionManagerBase, they are not forced to implement the CopyInto function, unlike the other virtual functions.
2015-09-17 14:26:19 -04:00
Robert Maynard
b1c96381de Merge branch 'multiple_backend_example' into 'master'
Correct the tbb install rules when tbb is disabled.

See merge request !201
2015-09-17 14:04:37 -04:00
Robert Maynard
0b97d4c458 Correct the tbb install rules when tbb is disabled. 2015-09-17 13:59:26 -04:00
Sujin Philip
2519dd7ef2 Merge topic 'update-clip'
54c30cbc Select step 4 implementation method
6617596f Add a clipping example
7f017c11 Release ArrayHandle resources sooner to avoid OOM
bab41d21 Workaround thrust scan bug
b5e74682 Add support for more cell types
002e5b6c Fix lowerbounds implementation and collect timing information

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !197
2015-09-17 10:28:43 -04:00
Robert Maynard
c87e1f5e16 Merge topic 'add-gaussian-splatter'
5e72d3a8 Rename kernels directory to splatkernels to avoid confusion
7a2225cf Add Copyright text
d04e4dfa Remove c++11 constexpr keyword
ed5faf5b Fix for M_PI on windows, use vtkm::Pi()
fe284ffb Add unit test for splat kernel integral.
29001e37 Change GaussianSplatter to KernelSplatter to support other kernels
378cb17e Code cleanup, style, debug, unused vars
65d2980f Fix clang compile error, cleanup debug messages
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !193
2015-09-17 10:03:26 -04:00
Robert Maynard
9b877ef49b Merge topic 'multiple_backend_example'
fd685210 Always install all device headers even when device isn't enabled.
b1663b24 Add an example of using multiple backends from a single translation unit.
fc0ff69d Methods with try/catch need to be host only.
4d635d64 DeviceAdapter Tags now always exist, and contain if the device is valid.
cf32b430 Teach Configure.h to store if TBB and CUDA are enabled.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !198
2015-09-17 09:49:49 -04:00
Robert Maynard
fd68521066 Always install all device headers even when device isn't enabled.
vtkm_declare_headers now is able to not test headers, by using the
TESTABLE keyword.
2015-09-17 09:28:21 -04:00
Robert Maynard
b1663b24b7 Add an example of using multiple backends from a single translation unit. 2015-09-17 09:28:21 -04:00
Robert Maynard
fc0ff69d04 Methods with try/catch need to be host only.
When compiling with cuda and tbb enabled in a single translation unit you
need to make sure all try/catch blocks are marked as host only otherwise
the cuda compiler will error out.
2015-09-17 09:28:21 -04:00
Robert Maynard
4d635d642b DeviceAdapter Tags now always exist, and contain if the device is valid.
Previously it was really hard to verify if a device adapter was valid. Since
you would have to check for the existence of the tag. Now the tag always
exists, but instead you query the traits of the DeviceAdapter to see if
it is a valid adapter.

This makes compiling with multiple backends alot easier.
2015-09-17 09:28:21 -04:00
Robert Maynard
cf32b430dc Teach Configure.h to store if TBB and CUDA are enabled. 2015-09-17 09:28:21 -04:00
Robert Maynard
1b9486149d Merge branch 'update_examples_to_use_proper_backends' into 'master'
Update examples to use proper backends

See merge request !195
2015-09-16 15:44:21 -04:00
Robert Maynard
9c3ff00b6e Switch over to a simpler way to specify the vtkm backend. 2015-09-16 13:16:25 -04:00
Sujin Philip
54c30cbc66 Select step 4 implementation method
Performance testing has shown that the combined lower-bounds + update-connectivity
worklet is marginally, but consistently faster than DeviceAdapterAlgorithm::LowerBounds
followed by an update-connectivity worklet. It also requires less memory.
2015-09-16 10:29:31 -04:00
Sujin Philip
6617596f3b Add a clipping example 2015-09-16 10:07:25 -04:00
Sujin Philip
7f017c1106 Release ArrayHandle resources sooner to avoid OOM 2015-09-16 10:07:25 -04:00
Sujin Philip
bab41d2191 Workaround thrust scan bug 2015-09-16 10:07:25 -04:00
Sujin Philip
b5e74682b7 Add support for more cell types 2015-09-16 10:07:25 -04:00
Robert Maynard
cce93638e2 Merge branch 'enable_more_clang_warnings_osx' into 'master'
Enable more warnings when building with AppleClang.

See merge request !196
2015-09-16 08:56:15 -04:00
Kenneth Moreland
fd401f0feb Merge branch 'index-array-handle' into 'master'
Add ArrayHandleIndex

Add an ```ArrayHandleIndex``` class that echoes the index. This is really a special version of ```ArrayHandleCounting``` that is of type ```vtkm::Id``` and starts at 0, but it is the most common case and does not need the extra addition.

Also modified ```ArrayHandleCounting``` to support a step, which makes the use a bit more powerful.

See merge request !192
2015-09-15 21:58:29 -04:00
Sujin Philip
002e5b6cda Fix lowerbounds implementation and collect timing information 2015-09-15 17:29:21 -04:00
Robert Maynard
121471c5d0 Enable more warnings when building with AppleClang. 2015-09-15 16:20:24 -04:00
Kenneth Moreland
e23649d290 Fix use of ArrayHandleCounting in TBB device adapter 2015-09-15 14:19:10 -06:00
Robert Maynard
c295a7c174 Merge branch 'remove_thrust_old_pragma' into 'master'
Remove the thrust pragma statements that are not needed.

See merge request !194
2015-09-15 15:35:17 -04:00
Robert Maynard
1d97f886e0 Remove the thrust pragma statements that are not needed. 2015-09-15 14:20:56 -04:00
Robert Maynard
86ef09acd9 Update Isosurface Example to properly use the correct device adapter. 2015-09-15 14:18:36 -04:00
Robert Maynard
5ce3e1f3d0 Update HelloWorld Example to properly use the correct device adapter. 2015-09-15 14:15:56 -04:00
John Biddiscombe
5e72d3a87a Rename kernels directory to splatkernels to avoid confusion 2015-09-15 19:46:53 +02:00
John Biddiscombe
7a2225cfd1 Add Copyright text 2015-09-15 12:03:09 +02:00
John Biddiscombe
d04e4dfaf4 Remove c++11 constexpr keyword 2015-09-15 11:08:36 +02:00
Kenneth Moreland
44fc339a2e ArrayHandleCounting now supports step
Modify ArrayHandleCounting so that it supports both a starting value and
a step (increment). This adds a multiplication, but the common case that
does not use it is already in a separate class (ArrayHandleIndex).
2015-09-14 22:55:44 -06:00
Kenneth Moreland
891182ee19 Add ArrayHandleIndex class.
This is the most common use case for ArrayHandleCounting, and this class
is a bit easier to use and a bit faster.
2015-09-14 22:11:09 -06:00
John Biddiscombe
ed5faf5bac Fix for M_PI on windows, use vtkm::Pi() 2015-09-14 22:52:06 +02:00
John Biddiscombe
fe284ffbfb Add unit test for splat kernel integral.
The test computes the integral using simpsons rule and checks
that the value is unity (+/- epsilon)
2015-09-14 21:39:43 +02:00
John Biddiscombe
29001e377f Change GaussianSplatter to KernelSplatter to support other kernels
Template the splatter algorithm over Kernel type and use abstract kernel
interface to fetch the kernel value.

Add Gaussian, Spline3rdOrder kernel classes templated over dimension.
Other kernels can/will be added in future.

Kernel classes are defined such that the integral of the volume is unity
as is the convention in (for example) SPH simulations.
2015-09-14 21:39:35 +02:00
John Biddiscombe
378cb17e8a Code cleanup, style, debug, unused vars
Pass code through formatter to correct indentation.

Put debug routines in debug:: namespace and #ifdef them.

Remove old unused variables and worklets.
2015-09-12 21:08:45 +02:00
John Biddiscombe
65d2980fb7 Fix clang compile error, cleanup debug messages 2015-09-12 16:01:54 +02:00
John Biddiscombe
c03aef932e Rewrite main routine for gaussian splatter
Clean up the implementation to take a uniform grid dataset as input
and splat using the correct world coordinates of the points into
the volume. Kernels are centred around the splat points in world coordinates
(floating point) and not quantized to the nearest voxel.

Skip the generation of all volume points which is unnecessary (memory usage).

Add ability to specify a radius array with one entry per splat point so
that the size of each splat may be controlled arbitrarily.
2015-09-12 16:01:48 +02:00
John Biddiscombe
ed99cbfed4 Some fixes to get a first working splatter test 2015-09-12 16:00:22 +02:00
John Biddiscombe
d14eb28285 Fix compilation of Gaussian splatter worklet 2015-09-12 15:53:37 +02:00
John Biddiscombe
cc3014fbcb Merge remote-tracking branch 'kitware/master' into add-gaussian-splatter 2015-09-12 10:39:15 +02:00
Sujin Philip
4b70770d48 Merge topic 'fix-typos-CellSetExplicit'
f004d344 Fix some typos in CellSetExplicit.h

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !191
2015-09-11 16:26:34 -04:00
Sujin Philip
f004d344e1 Fix some typos in CellSetExplicit.h 2015-09-11 15:03:18 -04:00
Kenneth Moreland
02287d1ef5 Merge branch 'execution-whole-array-as-portal' into 'master'
Change ExecutionWholeArray interface to match expected for ArrayPortal

When ExecutionWholeArray is passed to a worklet, it is expected to
behave like an array portal. However, it was missing the
GetNumberOfValues method and the ValueType typedef. These are now added.

See merge request !189
2015-09-09 15:50:33 -04:00
Kenneth Moreland
13d4087657 Change ExecutionWholeArray interface to match expected for ArrayPortal
When ExecutionWholeArray is passed to a worklet, it is expected to
behave like an array portal. However, it was missing the
GetNumberOfValues method and the ValueType typedef. These are now added.
2015-09-09 13:30:12 -06:00
Robert Maynard
b767fc405d Merge branch 'wrap_thrust_call_in_try_catches' into 'master'
Correct multiple signature compile issue.

See merge request !188
2015-09-08 10:57:12 -04:00
Robert Maynard
6272fdcc54 Correct multiple signature compile issue. 2015-09-08 09:39:57 -04:00
Robert Maynard
39ff2c2b9d Merge branch 'wrap_thrust_call_in_try_catches' into 'master'
Resolves Issue #42. Now all thrust API calls are in try/catch blocks.

See merge request !187
2015-09-07 13:07:51 -04:00
Robert Maynard
d9dfe01a01 Merge branch 'hello_world_example' into 'master'
Hello world example

See merge request !186
2015-09-07 12:32:13 -04:00
Robert Maynard
aa7f5c34b9 Resolves Issue #42. Now all thrust API calls are in try/catch blocks. 2015-09-07 12:20:31 -04:00