Commit Graph

824 Commits

Author SHA1 Message Date
Robert Maynard
778d670ed3 FunctionInterface suppresses warnings on calling host function from host/device 2015-09-21 15:26:28 -04:00
Robert Maynard
00b732056d Make a define to suppress false positive host/device warnings 2015-09-21 14:25:15 -04:00
Sujin Philip
1d2657f360 Make cuda DeviceAdapter valid only when using nvcc
Before it was valid even on a regular compiler, if cuda was available.
2015-09-18 12:21:11 -04:00
Sujin Philip
a1546942fb Merge topic 'fix-CopyInto'
98885186 Fix CopyInto tests that use different DeviceAdapterTag
69b2ad2a Add unit tests for CopyInto function
2c55b15c Add additional control logic for CopyInto function
20c1a048 CopyInto function for ArrayHandles

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !202
2015-09-18 12:18:52 -04:00
Sujin Philip
98885186c8 Fix CopyInto tests that use different DeviceAdapterTag 2015-09-18 10:05:20 -04:00
Kenneth Moreland
fd21a12f4a Merge branch 'xcode-7-warnings' into 'master'
Xcode 7 warnings

The XCode 7 compiler has a new warning for unused typedefs. The Boost code we use has some instances where this warning gets issued. Suppress these warnings.

See merge request !199
2015-09-17 18:12:31 -04:00
Kenneth Moreland
b15940c1e3 Declare new VTKM_STATIC_ASSERT
This is to be used in place of BOOST_STATIC_ASSERT so that we can
control its implementation.

The implementation is designed to fix the issue where the latest XCode
clang compiler gives a warning about a unused typedefs when the boost
static assert is used within a function. (This warning also happens when
using the C++11 static_assert keyword.) You can suppress this warning
with _Pragma commands, but _Pragma commands inside a block is not
supported in GCC. The implementation of VTKM_STATIC_ASSERT handles all
current cases.
2015-09-17 14:40:39 -06:00
hschroot
69b2ad2a32 Add unit tests for CopyInto function 2015-09-17 14:26:19 -04:00
hschroot
2c55b15c3f Add additional control logic for CopyInto function
Clean up comments and align code to 80 character width
2015-09-17 14:26:19 -04:00
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
Kenneth Moreland
9b22a72d6c Only suppress unused-local-typedef warning when it exists
The recently added pragma to suppress warnings about unused local
typedefs caused lots of dashboard failures because many GCC and clang
compiler do not have this warning so did not recognized the pragma to
suppress it. Now only use the pragma on clang compilers with a large
enough version.

I also discovered that the check for VTKM_CLANG was wrong (at least for
the most modern versions of XCode). Fixed that as well as some uses of
VTKM_CLANG that were wrong.
2015-09-17 07:44:56 -06: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
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
Kenneth Moreland
2ff6576c65 Add third party wrappers around boost macros.
The boost assert macros seem to have an issue where they define an
unused typedef. This is causing the XCode 7 compiler to issue a warning.
Since the offending code is in a macro, the warning is identified with
the VTK-m header even though the code is in boost. To get around this,
wrap all uses of the boost assert that is causing the warning in the
third party pre/post macros to disable the warning.
2015-09-16 23:34:49 -06:00
Kenneth Moreland
27c4f47411 Boost generates warnings for XCode 7
XCode 7 added a warning for unused typedefs. VTK-m proper does not have
any instances of this, but there are several cases in the Boost code
that we are using. Add an exception to the third party pragmas to
supporess this warning.
2015-09-16 23:32:39 -06: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
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
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
Kenneth Moreland
e23649d290 Fix use of ArrayHandleCounting in TBB device adapter 2015-09-15 14:19:10 -06:00
Robert Maynard
1d97f886e0 Remove the thrust pragma statements that are not needed. 2015-09-15 14:20: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
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
6272fdcc54 Correct multiple signature compile issue. 2015-09-08 09:39:57 -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
Robert Maynard
5b8cc44ed4 Merge branch 'improve_sort_perf_on_thrust' into 'master'
Tell thrust to use fast code paths when using our predicates and operators.

See merge request !176
2015-09-07 10:38:17 -04:00