Commit Graph

947 Commits

Author SHA1 Message Date
Robert Maynard
9fdc0f09fc Improve the error message for Invoke type mismatch at compile time.
Now that we can skip generating the DynamicTransform code when all the
arguments are statically known, we need a way to produce nicer error messages.
2015-10-26 16:35:02 -04:00
Robert Maynard
54d25fae55 Only perform DynamicTransformCont if at least one parameter is dynamic.
Previously we always ran DynamicTransformCont even if we knew all the types.
By checking for Dynamic types first, we save roughly 3% on the binary size.

This also is a good starting point for a redesign of DynamicTransformCont
2015-10-26 13:48:25 -04:00
Robert Maynard
93dba7782a Merge topic 'reduce_dispatcher_template_complexity'
39142d83 Add convenience tags like FieldInPoint, FieldInCell, to WorkletMapPointToCell
f34119b6 Clarify the name of  worklet for point to cell operations.
2c767e10 Add WorkletMapTopologyBase to make Dispatcher templates easier to read.
05d397cb Remove unnecessary template parameters from DispatcherMapField

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !246
2015-10-26 09:29:05 -04:00
Robert Maynard
39142d8347 Add convenience tags like FieldInPoint, FieldInCell, to WorkletMapPointToCell 2015-10-23 09:50:48 -04:00
Robert Maynard
f34119b62e Clarify the name of worklet for point to cell operations. 2015-10-22 18:46:00 -04:00
Kenneth Moreland
dc11d9a917 Merge branch 'cuda-default-constructors' into 'master'
CUDA default constructors, destructors, and assignment operators

Several classes exclusively work in the control environment. However, CUDA likes to add __device__ to constructors, destructors, and assignment operators it automatically creates. This in turn causes warnings about the __device__ function using host-only classes (like boost::shared_ptr). Solve this problem by adding explicit methods for all of these.


See merge request !245
2015-10-22 15:22:43 -04:00
Robert Maynard
2c767e10f7 Add WorkletMapTopologyBase to make Dispatcher templates easier to read. 2015-10-22 12:22:59 -04:00
Robert Maynard
05d397cbf7 Remove unnecessary template parameters from DispatcherMapField
DispatcherMapField was templated on the device adapter but it
actually doesn't need to be, only BasicInvoke and subsequent
methods need to be templated on the device.
2015-10-22 12:22:59 -04:00
Kenneth Moreland
fec9262099 Add default constructors/destructors/assignment to Dynamic* classes
The DynamicArrayHandle and DynamicCellSet classes exclusively work in
the control environment. However, CUDA likes to add __device__ to
constructors, destructors, and assignment operators it automatically
adds. This in turn causes warnings about the __device__ function using
host-only classes (like boost::shared_ptr). Solve this problem by adding
explicit methods for all of these.
2015-10-22 09:44:51 -06:00
Kenneth Moreland
c7e9c1b67c Add default constructors/destructors/assignment to CellSet classes
The CellSet classes all exclusively work in the control environment.
However, CUDA likes to add __device__ to constructors, destructors, and
assignment operators it automatically adds. This in turn causes warnings
about the __device__ function using host-only classes (like
boost::shared_ptr). Solve this problem by adding explicit methods for
all of these.
2015-10-21 16:28:18 -06:00
Kenneth Moreland
65c2261892 Add default constructors/destructors/assignment to ArrayHandle classes
The ArrayHandle classes all exclusively work in the control environment.
However, CUDA likes to add __device__ to constructors, destructors, and
assignment operators it automatically adds. This in turn causes warnings
about the __device__ function using host-only classes (like
boost::shared_ptr). Solve this problem by adding explicit methods for
all of these.

Implemented this by wrapping up all these default objects in a macro.
This also solved the problem of other constructors that are necessary
for array handles such as a constructor that takes the base array
handle.
2015-10-21 13:36:27 -06:00
Kenneth Moreland
b861209a22 Fix nvcc warnings on MSVC
There is a strange nvcc warning in CUDA 7.5 that sometimes happens on MSVC
that causes it to emit a warning for an undefined method that is clearly
defined. The CUDA development team is aware of the problem and is going
to fix it, but these changes will work around the problem for now.

Thanks to Tom Fogal from NVIDIA for these fixes.
2015-10-21 08:33:15 -06:00
Kenneth Moreland
e028f2af99 Supress some warnings about copies in FunctionInterface. 2015-10-21 07:55:59 -06:00
Kenneth Moreland
7ff62d8d6b Explicitly add destructors and copy constructors to ArrayHandle classes
Under CUDA, the default constructors and destructors created are exported
as __host__ and __device__, which causes problems because they used a boost
pointer that only works on the host. The explicit copy constructors and
destructors do the same thing as the default ones except declared to only
work on the host.
2015-10-21 07:50:52 -06:00
Robert Maynard
8de216c088 Propagate vtkm::Id3 scheduling down to the ThreadIndex classes.
This now allows for even more efficient construction of uniform point
coordinates when running under the 3d scheduler, since we don't need to go
from 3d index to flat index to 3d index, instead we stay in 3d index
2015-10-20 09:29:41 -04:00
Kenneth Moreland
1773210635 Merge branch 'shared-indices-in-fetch' into 'master'
Change Fetches to use ThreadIndices instead of Invocation.

Previously, all Fetch objects received an Invocation object in their
Load and Store methods. The point of this was that it allowed the Fetch
to get data from any of the execution objects. However, every Fetch
either just got data directly from its associated execution object or
else used a secondary execution object (the input domain) to get indices
into their own execution object.

This left two potential areas for improvement. First, pulling data out
of the Invocation object was unnecessarily complicated. It would be much
nicer to get data directly from the associated execution object. Second,
when getting index information from the input domain, it was often the
case that extra computations were necessary (particularly on structured
cell sets). There was no way to share the index information among
Fetches, and therefore the computations were replicated.

This change removes the Invocation from the Fetch Load and Store.
Instead, it passes the associated execution object and a new object type
called the ThreadIndices. The ThreadIndices are customized for the input
domain and therefore have all the information needed for a redirected
lookup. It is also a thread-local object so it can cache computed
indices and save on computation time.

See merge request !233
2015-10-19 17:41:43 -04:00
Patricia
58178a3e00 Merge topic 'stat_histogram'
d3d63a0a Merge branch 'master' of gitlab.kitware.com:Fasel/vtk-m into stat_histogram
4aa57d5c Merge branch 'master' of gitlab.kitware.com:Fasel/vtk-m into stat_histogram
49940a4c Attempt to fix compiler errors and warnings.
0e0f5d2e Fix compiler warnings.
a6487b3c Merge branch 'master' of gitlab.kitware.com:Fasel/vtk-m into stat_histogram
c2a9f184 Fix syntax of ArrayHandleCounting usage
6dd8bde6 Merge branch 'master' into stat_histogram

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !190
2015-10-14 15:56:24 -04:00
Sujin Philip
4642889f93 Merge topic 'add-Threshold'
e4a8ae82 Add Threshold worklet and unit tests.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !236
2015-10-14 14:34:17 -04:00
Patricia Kroll Fasel - 090207
d3d63a0a20 Merge branch 'master' of gitlab.kitware.com:Fasel/vtk-m into stat_histogram 2015-10-14 11:51:31 -06:00
Robert Maynard
95f0ed5016 CellSetSingleType::Fill now works with custom storage types. 2015-10-14 11:03:24 -04:00
Robert Maynard
c78aac4650 UnitTestClipping now properly handles 64bit vtkm::FloatDefault. 2015-10-13 10:29:46 -04:00
Robert Maynard
9006b97432 Manually do copy_backwards since ICC was replacing it with copy
When ICC replaced copy_backwards with copy it causes a failure when the
input and output arrays are the same.
2015-10-12 15:19:54 -04:00
Sujin Philip
e4a8ae82ed Add Threshold worklet and unit tests. 2015-10-12 14:37:59 -04:00
T.J. Corona
b1665dcb32 Add an array handle for bare cuda device pointers.
Array handles for cuda device pointers have been implemented. The data for
these handles exists solely on the exec side (info such as length can be
queried from the cont side).
2015-10-09 12:41:33 -04:00
Patricia Kroll Fasel - 090207
65c9de08bd Merge branch 'master' of gitlab.kitware.com:Fasel/vtk-m into tetra_explicit 2015-10-08 16:07:18 -06:00
Patricia
610672a3a1 Merge topic 'tetra_uniform'
5f6a552a Compiler warnings
b7473712 Compiler warnings GL deprecated
2f532bf3 Compiler warnings
5569d8c1 Merge branch 'master' of gitlab.kitware.com:Fasel/vtk-m into tetra_uniform
0e8b9b15 Compiler warnings.
810e6b00 Fix CastTo with template to avoid compiler errors.
deceb79e Fix to work with gcc and pgi compilers.  Change to use CellSetSingleType.
f624683e Merge branch 'master' of gitlab.kitware.com:Fasel/vtk-m into tetra_uniform
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !204
2015-10-08 17:36:47 -04:00
Patricia Kroll Fasel - 090207
2b43e52516 Compiler warnings 2015-10-08 11:38:56 -06:00
Patricia Kroll Fasel - 090207
2f532bf379 Compiler warnings 2015-10-08 11:11:08 -06:00
Patricia Kroll Fasel - 090207
cba29a1e67 Fix compiler warnings 2015-10-08 10:52:34 -06:00
Patricia Kroll Fasel - 090207
cbbd7e6edd Initialize variable used in if test. 2015-10-08 10:18:05 -06:00
Sujin Philip
15ad595888 Add support for clipping with implicit functions 2015-10-08 12:12:51 -04:00
Patricia Kroll Fasel - 090207
0b9cffe4f4 Merge branch 'master' of gitlab.kitware.com:Fasel/vtk-m into tetra_explicit 2015-10-08 09:56:44 -06:00
Sujin Philip
715ddedd25 Merge topic 'add-implicit-functions'
5ea70b6d Add implicit functions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !232
2015-10-08 11:41:17 -04:00
Patricia Kroll Fasel - 090207
5569d8c1b1 Merge branch 'master' of gitlab.kitware.com:Fasel/vtk-m into tetra_uniform 2015-10-08 09:35:10 -06:00
Patricia Kroll Fasel - 090207
4aa57d5c64 Merge branch 'master' of gitlab.kitware.com:Fasel/vtk-m into stat_histogram 2015-10-08 09:13:28 -06:00
Sujin Philip
5ea70b6ddd Add implicit functions 2015-10-08 09:32:14 -04:00
Kenneth Moreland
99ce66c6fe Change Fetches to use ThreadIndices instead of Invocation.
Previously, all Fetch objects received an Invocation object in their
Load and Store methods. The point of this was that it allowed the Fetch
to get data from any of the execution objects. However, every Fetch
either just got data directly from its associated execution object or
else used a secondary execution object (the input domain) to get indices
into their own execution object.

This left two potential areas for improvement. First, pulling data out
of the Invocation object was unnecessarily complicated. It would be much
nicer to get data directly from the associated execution object. Second,
when getting index information from the input domain, it was often the
case that extra computations were necessary (particularly on structured
cell sets). There was no way to share the index information among
Fetches, and therefore the computations were replicated.

This change removes the Invocation from the Fetch Load and Store.
Instead, it passes the associated execution object and a new object type
called the ThreadIndices. The ThreadIndices are customized for the input
domain and therefore have all the information needed for a redirected
lookup. It is also a thread-local object so it can cache computed
indices and save on computation time.
2015-10-07 17:01:42 -06:00
Kenneth Moreland
bfb26cf71b Do not use _Pragma in code blocks with CUDA
The current CUDA compiler is crashing when using _Pragma in code blocks,
which were being used with clang on apple. Turn these off when compiling
with CUDA.
2015-10-07 15:40:44 -06:00
Robert Maynard
fbddba74a1 Merge topic 'cellset_permutation'
9a8809f9 Add CellSetPermutation which allows custom iteration over a cell set.
66f6db5a IsWriteableArrayHandle now can tell if an array handle can be written too
20f3fb50 Update VertexClustering to use vtkm::cont::CellSetSingleType.
154896b7 Extend the test for DataSetSingleType.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !228
2015-10-07 16:21:40 -04:00
T.J. Corona
a9425ac1bb In DataSet, add the ability to retrieve a cell set by name. 2015-10-02 08:31:57 -04:00
Patricia Kroll Fasel - 090207
49940a4cbf Attempt to fix compiler errors and warnings. 2015-10-01 15:08:36 -06:00
Patricia Kroll Fasel - 090207
0e0f5d2e75 Fix compiler warnings. 2015-10-01 12:26:44 -06:00
Robert Maynard
f38673f618 Replace ErrorControlOutOfMemory with ErrorControlBadAllocation. 2015-10-01 14:25:28 -04:00
Robert Maynard
085711e2d2 Merge topic 'bad-allocation-error'
a88f43db Add Bad Allocation error.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !213
2015-10-01 14:19:57 -04:00
Patricia Kroll Fasel - 090207
a6487b3c79 Merge branch 'master' of gitlab.kitware.com:Fasel/vtk-m into stat_histogram 2015-10-01 10:15:02 -06:00
Robert Maynard
9a8809f933 Add CellSetPermutation which allows custom iteration over a cell set.
When you create a CellSetPermutation you provide an array of the cell ids that
you want to iterate. This allows the user to do custom blanking of a data set,
or to do multi iteration over a set of cells.
2015-10-01 09:23:10 -04:00
Robert Maynard
66f6db5a97 IsWriteableArrayHandle now can tell if an array handle can be written too 2015-10-01 09:23:10 -04:00
Robert Maynard
20f3fb5000 Update VertexClustering to use vtkm::cont::CellSetSingleType. 2015-10-01 09:23:10 -04:00
Robert Maynard
154896b7bc Extend the test for DataSetSingleType. 2015-10-01 08:50:54 -04:00
Robert Maynard
ac48e13c3a Merge topic 'cleanup_cellset_explicit'
8bc40880 Add a test for CellSetExplicit::GetIndices
fa81d1de CellSetExplicit always calls methods using "this->"
9e496306 Allow incremental construction of CellSetSingleType.
3e307879 Mark CellSetExplicit::Fill as host side only.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !227
2015-09-30 13:48:08 -04:00