Commit Graph

517 Commits

Author SHA1 Message Date
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
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
Robert Maynard
95f0ed5016 CellSetSingleType::Fill now works with custom storage types. 2015-10-14 11:03:24 -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
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
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
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
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
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
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
Sujin Philip
757891cfcc Merge topic 'fix-ArrayHandleTransform'
f3560116 Fix ArrayHandleTransform to use supplied functor object instead of a default

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !224
2015-09-30 11:58:55 -04:00
Robert Maynard
8bc4088068 Add a test for CellSetExplicit::GetIndices 2015-09-30 11:29:07 -04:00
Robert Maynard
fa81d1de7f CellSetExplicit always calls methods using "this->" 2015-09-30 11:20:33 -04:00
Robert Maynard
9e4963069b Allow incremental construction of CellSetSingleType. 2015-09-30 11:18:49 -04:00
Robert Maynard
3e3078798c Mark CellSetExplicit::Fill as host side only. 2015-09-30 11:18:49 -04:00
Kenneth Moreland
1432b160d5 Remove const from ArrayPortalGroupVec.
Remove the const from the ValueType of the delegate portal in
ArrayPortalGroupVec. This was creating a Vec with a const type, which
was immutable, which was problematic when trying to create the Vec in
the first place.
2015-09-29 16:06:39 -04:00
Sujin Philip
f35601162e Fix ArrayHandleTransform to use supplied functor object instead of a default 2015-09-29 15:44:10 -04:00
Kenneth Moreland
d47417fd20 Use test_equal for comparison.
The testing of ArrayHandleGroupVec was just using the == operator to
check values. Even though we are not doing any math, optimizers can
sometimes make float values slightly different anyway, so test_equal
should give the correct comparison.
2015-09-29 11:28:57 -04:00
Kenneth Moreland
c89647746a Add ArrayHandleGroupVec
This is a fancy array handle that groups consecutive entries in a
delegate array handle and presents them as a single vec.
2015-09-29 11:28:57 -04:00
Robert Maynard
c0f3b6ff97 Make3DExplicitDataSetCowNose now generates a CellSetSingleType. 2015-09-25 13:41:41 -04:00
Robert Maynard
011849a251 Add CellSetSingleType 2015-09-25 13:41:41 -04:00
Robert Maynard
c58f8ef193 CellSetExplicit Getters now properly deduce the correct handle type.
Previously the CellSetExplicit presumed that the CellToPoint and PointToCell
Storage tags matched, which they don't when using custom storage tags.
2015-09-25 13:41:41 -04:00
Robert Maynard
5a3e7c779e CellSetExplicit CreateConnectivity works even when NumberOfPoints is zero.
Previously if you created a cell set explicit and didn't set the number of
points you would get a runtime error when you over-ran an array's bounds.
Now we account for this use case and properly generate the Cell To Point
Connectivity.
2015-09-25 13:41:41 -04:00
Robert Maynard
dbed882709 Correct issues found in code review. 2015-09-25 12:32:06 -04:00
Robert Maynard
82b977da0e CellSetExplicit::CreateConnectivity now works with implicit NumIndices. 2015-09-24 12:38:34 -04:00
Robert Maynard
30f5d628cc ConnectivityExplicit will not generate IndexOffsets when they are implicit.
Even when using implicit index's the ConnectivityExplicit would generate
the code to compute the IndexOffsets, which would than fail to compile as
the ArrayHandle would only support read operations. This fixes that issue.
2015-09-24 11:57:34 -04:00
Robert Maynard
f04ea6d72e CellSetExplicit has userdefined offset storage. 2015-09-24 11:24:50 -04:00
Robert Maynard
45ad63c770 Merge topic 'update_cell_connectivity_types'
19cebccf Correct issues that buildbot brought up in the code.
c6dbc0f2 GetNumberOfPointsInCell consistently returns a vtkm::IdComponent
25ff1e94 CellSetExplicit storage tags are now easier to override.
935b3fd6 CellSetExplicit uses UInt8 for shape, and IdComponent for numIndices.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !210
2015-09-24 11:23:54 -04:00
Robert Maynard
19cebccf11 Correct issues that buildbot brought up in the code. 2015-09-24 10:15:44 -04:00
Robert Maynard
c6dbc0f20e GetNumberOfPointsInCell consistently returns a vtkm::IdComponent 2015-09-23 15:47:41 -04:00
Robert Maynard
25ff1e9403 CellSetExplicit storage tags are now easier to override. 2015-09-23 15:47:41 -04:00
Robert Maynard
935b3fd6b9 CellSetExplicit uses UInt8 for shape, and IdComponent for numIndices. 2015-09-23 11:17:04 -04:00
Kenneth Moreland
5cb44a7a00 Merge branch 'easier-cast-and-call' into 'master'
Add new version of DynamicArrayHandle::CastToArrayHandle

This takes a reference to an array handle and fills it. This removes a lot of the pain of determining template arguments.

See merge request !205
2015-09-23 11:01:18 -04:00
T.J. Corona
a88f43db94 Add Bad Allocation error. 2015-09-22 10:54:22 -04:00
Robert Maynard
056f69bf96 Remove unused variable and conversion warnings from cuda code. 2015-09-21 14:17:25 -04:00
Kenneth Moreland
fd8cce93dd Switch VTKM_IS_ARRAY_HANDLE to use VTKM_STATIC_ASSERT
This is an attempt to get around a warning with the PGI compiler.
2015-09-20 15:19:46 -06:00
Kenneth Moreland
c97a90fc13 Add simpler type check for DynamicArrayHandle. 2015-09-20 00:55:54 -06:00
Kenneth Moreland
882c20a2cb Support DynamicArrayHandle::CastToArrayHandle for fancy ArrayHandles
Basically, this entails adding a constructor to each fancy ArrayHandle
that accepts the base ArrayHandle with the appropriate type and storage.
2015-09-20 00:28:11 -06:00
Kenneth Moreland
0ea9ceb1f8 Add an operator== to ArrayHandle.
This allows you to query whether two ArrayHandles have the same pointer.
2015-09-20 00:22:29 -06: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
e761afc18e Add new version of DynamicArrayHandle::CastToArrayHandle
This takes a reference to an array handle and fills it. This removes a
lot of the pain of determining template arguments.
2015-09-17 22:31:58 -06: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