Commit Graph

218 Commits

Author SHA1 Message Date
Kenneth Moreland
58eb8f168d Add WorkletReduceByKey and dispatcher
And the basic type for a reduce by key worklet and its associated
adapter. Right now the worklet only supports passing in keys. Values
come next.
2017-01-17 15:53:06 -07:00
Robert Maynard
1052a71523 ConnectivityPermuted explicitly suppress cuda host/device warnings
The class can emit false positive warnings when being compiled with
cuda but SMP backends.
2017-01-02 11:38:05 -05:00
Kenneth Moreland
55c159d6f0 Check error codes from CUDA functions
Most functions in the CUDA runtime API return an error code that must be
checked to determine whether the operation completed successfully. Most
operations in VTK-m just called the function and assumed it completed
correctly, which could lead to further errors. This change wraps most
CUDA calls in a VTKM_CUDA_CALL macro that checks the error code and
throws an exception if the call fails.
2016-12-14 10:43:44 -07:00
Robert Maynard
d1336c7f84 CellDerivativeFor2DCell now creates Space2D of the correct type.
Previously vtkm::Vec<> fields would construct Space2D types incorrectly
2016-12-12 13:26:16 -05:00
Robert Maynard
134f24496b Add a point gradient worklet. 2016-12-12 13:26:16 -05:00
Robert Maynard
06af2fbcbf Make it easier to construct ThreadIndices by hand.
In some cases it is necessary to construct ThreadIndices to manually
use vtkm::exec::Fetch. This now makes it possible.
2016-12-12 13:26:16 -05:00
Robert Maynard
60843cbab8 Allow people to get the portal from ExecutionWholeArray.
This is required when doing some optimizations to PointGradient.
2016-12-12 13:26:16 -05:00
Robert Maynard
e462d34c60 ExecutionWholeArray now has consistent ValueType defines. 2016-12-12 13:26:16 -05:00
Robert Maynard
9f2b680594 WholeCellSetIn now uses the proper fetch tag. 2016-12-12 13:26:16 -05:00
Kenneth Moreland
50e0d05c3e Merge topic 'cell-face-edge'
eb7ea792 Add VTKM_EXEC_CONT to make_VecC
16970b57 Update ExternalFaces to use common face tables
91f98835 Add CellEdge functions
5ab43f8d Add CellFace functions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !631
2016-12-10 10:12:01 -05:00
Kenneth Moreland
2e05c1dd03 Support derivatives of vectors
The cell derivative/gradient functions were all designed with scalars in
mind. Although the field type is templated and you could pass in a
vector type for the field, many of these classes would perform the
computation incorrectly. These changes specifically support derivatives
of vector types.
2016-12-05 23:04:35 -07:00
Kenneth Moreland
91f9883599 Add CellEdge functions
These provide the general ability to get the edges for each cell type.
2016-12-05 22:48:44 -07:00
Kenneth Moreland
5ab43f8d9e Add CellFace functions
These provide the general ability to get the faces for each cell type.
2016-12-05 22:48:44 -07:00
Kenneth Moreland
3f9a1edb7b Change CellShapeTag*:Id type to vtkm::UInt8
The shape array in CellSetExplicit was changed a while ago to be of type
vtkm::UInt8. However, the shape types remained at vtkm::IdComponent. I
can think of no reason why they should not be the same type.
2016-11-22 17:12:54 -07:00
Kenneth Moreland
b3d0e1f99b Move VecFromPortal classes to vtkm package
These Vec-like objects can be generally usable in both the control and
execution environments.
2016-11-22 17:04:55 -07:00
Kenneth Moreland
fdaccc22db Remove exports for header-only functions/methods
Change the VTKM_CONT_EXPORT to VTKM_CONT. (Likewise for EXEC and
EXEC_CONT.) Remove the inline from these macros so that they can be
applied to everything, including implementations in a library.

Because inline is not declared in these modifies, you have to add the
keyword to functions and methods where the implementation is not inlined
in the class.
2016-11-15 22:22:13 -07:00
Robert Maynard
8861beda4b Merge topic 'add_vector_cell_gradient'
8dadf560 Add in support for vector fields to Gradient worklet.
d53f43fb CellDerivaties now support computing the derivatives of vtkm::Vec fields.
b4378c85 Allow vtkm::Matrix to support T values which are vtkm::Vec.
9caabf97 vtkm::Vec now supports +=, -=, *=, and /=.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !608
2016-11-15 23:39:10 -05:00
Robert Maynard
d53f43fb48 CellDerivaties now support computing the derivatives of vtkm::Vec fields. 2016-11-15 18:54:53 -05:00
Robert Maynard
632d2a5211 Thrust 1.8.3 uses raw_reference_cast instead of a direct assignment operator
This usage of raw_referenc_cast returns a const PortalValue which is than
assigned too. So to work around the problem we need to mark operator= on
the class as const.
2016-11-15 17:03:59 -05:00
Robert Maynard
7c07afffba Reduce the compilation size of the gradient computations. 2016-11-11 14:36:51 -05:00
Christopher Sewell
93d7956daf Attempt 13 to resolve Windows compiler warning with streaming storage 2016-10-21 16:08:13 -06:00
Christopher Sewell
05975a2325 Attempt 3 to resolve Windows compiler warning with streaming storage 2016-10-20 10:32:30 -06:00
Christopher Sewell
72d9783c38 Merge remote-tracking branch 'upstream/master' into StreamingArray 2016-10-17 17:51:23 -06:00
Robert Maynard
3e09b2cebc VecFromPortal::CopyTo can now handle const value Portals. 2016-10-12 13:28:36 -04:00
Christopher Sewell
d92f39df12 Merge branch 'master' into StreamingArray 2016-09-15 17:54:59 -06:00
Robert Maynard
c2769b81e6 Move over from boost/random to c++11 random. 2016-09-08 17:10:39 -04:00
Robert Maynard
310f1bc0a5 Correct missing std::time includes that vtkm::Math was hiding. 2016-09-02 14:44:30 -04:00
Robert Maynard
f81c42b9b4 Replace NULL with nullptr where applicable. 2016-09-01 09:38:25 -04:00
Robert Maynard
12810165bb Switch over to c++11 type_traits. 2016-08-31 16:11:26 -04:00
Kenneth Moreland
f8442903d8 Replace TryAllTypes with trying exemplar tests
There were many tests that created code paths for every base and Vec
type that VTK-m supports (up to 4 components). Although this is
admirable, it is also excessive, and our compile times for the tests are
very long.

To shorten compile times, remove the TryAllTypes method. Replace it with
a version of TryTypes that uses a default list of "exemplar" set of
integers, floats, and Vecs.
2016-08-24 16:02:18 -06:00
Christopher Sewell
330bdb9ff3 Attempting to eliminate warnings 2016-08-18 18:39:21 -06:00
Christopher Sewell
9f01b59b97 Adding global thread index offset to ThreadIndicesTopologyMap, eliminating warnings 2016-08-18 17:22:17 -06:00
Christopher Sewell
7892ebf67c Making work index return global value when streaming 2016-08-17 21:33:04 -06:00
Robert Maynard
76cd2ac4da More corrections needed to suppress false positive host / device warnings. 2016-06-30 16:04:37 -04:00
Kenneth Moreland
51a35cb4fe Fix warnings about type conversions 2016-06-27 07:50:15 -06:00
Kenneth Moreland
7ff20c9230 Fix includes for CUDA builds
The CMake CUDA build targets do not respect the
target_include_directories (yet?). Instead, add the necessary includes
to cuda_include_directories().
2016-06-22 12:53:23 -06:00
Kenneth Moreland
a778d373f1 Loosen threshold on test of parametric coordinates
The UnitTestParametricCoordinates test uses a pseudorandom number
generator to create some random set of parametric coordinates, convert
to world coordinates, and then back to parametric coordinates.

This has been working fine except that the world coordinate to parametric
coordinate conversion is not extremely precise for some cell shapes. (It
would not be cost effective to make it more precise.) Because of this,
the test_equal for this comparison has a pretty high threshold.

While looking at a dashboard I happened across a failure for this test.
It turns out that one of the parametric coordinates created for the
pyramid test for seed 1465529014 was just outside of this threshold, but
otherwise correct. I raised the threshold a little to try to prevent
this error.
2016-06-13 08:56:40 -06:00
Robert Maynard
a3d27a644c Merge topic 'rename_topology_tag'
8dfe8cd3 Rename ControlSignature tag TopologyIn to CellSetIn.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !416
2016-05-25 14:08:09 -04:00
Robert Maynard
8dfe8cd385 Rename ControlSignature tag TopologyIn to CellSetIn. 2016-05-17 15:07:08 -04:00
Robert Maynard
ba0a0b096b Simplify the fix for maxwell reduce by key bug. 2016-05-17 10:11:52 -04:00
Robert Maynard
e5c3f9c42d Solve reduce by key bugs with cuda 7.5 + maxwell hardware.
The concern is now all architectures are doing a hardware sync on reduce_by_key.
This isn't a super serious concern, but it is a downside.
2016-05-12 13:24:59 -04:00
Robert Maynard
90099d1c55 Simplify ThreadIndicies so link time is reduced.
ThreadIndicies constructor was templated on the invocation type, which created
thousand's of versions of that symbol which all had the same behavior. So now
remove that and move that logic into a Worklet function since it requires
the invocation info.
2016-05-04 14:48:42 -04:00
Robert Maynard
fbfd01a9bd Merge topic 'radix'
eeae5c13 Adding fast path for radix sort sort_by_key

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !407
2016-05-04 13:51:34 -04:00
Matt Larsen
eeae5c1352 Adding fast path for radix sort sort_by_key 2016-05-03 08:53:42 -07:00
Robert Maynard
e5d3095102 Solve the ParametricCoordinates issue by using VTKM_ASSUME. 2016-04-28 11:15:43 -04:00
Robert Maynard
1596f403ef Silence maybe-uninitialized warnings from ParametricCoordinates.h 2016-04-27 13:11:21 -04:00
Kenneth Moreland
b87cac7492 Fix warnings about unused parameters. 2016-04-21 09:32:02 -06:00
Kenneth Moreland
cc497e6a1b Remove cont/Assert.h and exec/Assert.h
These asserts are consolidated into the unified Assert.h. Also made some
minor edits to add asserts where appropriate and a little bit of
reconfiguring as found.
2016-04-20 15:41:14 -06:00
Kenneth Moreland
c503e0ce8a Move NewtonsMethod to the vtkm package
All the other math functions are in the vtkm package. This one was in
vtkm::exec because it uses a callback method. This can be problematic on
CUDA the the declaration of NewtonsMethod does not match the callback
method. However, we now have a VTKM_SUPPRESS_EXEC_WARNINGS macro that
allows a VTKM_EXEC_CONT_EXPORT function (like NewtonsMethod) to call
either a VTKM_EXEC_EXPORT or VTKM_CONT_EXPORT without a warning.
2016-04-14 14:36:02 -06:00
Robert Maynard
6883a5ac94 Simplify using CellSetPermutation by providing a default permutation type.
Previously you had to explicitly state you wanted a CellSetPermutation
with an ArrayHanlde of Id's, now that is done automatically.
2016-04-12 14:24:51 -04:00