Commit Graph

75 Commits

Author SHA1 Message Date
Kenneth Moreland
ffa3b167b5 Add ValueCount tag to WorkletReduceByKey 2017-01-17 15:53:10 -07:00
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
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
9f2b680594 WholeCellSetIn now uses the proper fetch tag. 2016-12-12 13:26:16 -05: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
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
d92f39df12 Merge branch 'master' into StreamingArray 2016-09-15 17:54:59 -06: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
Robert Maynard
8dfe8cd385 Rename ControlSignature tag TopologyIn to CellSetIn. 2016-05-17 15:07:08 -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
Kenneth Moreland
1a538ca196 Merge branch 'scatter-worklets' into 'master'
Scatter in worklets

Add the functionality to perform a scatter operation from input to output in a worklet invocation. This allows you to, for example, specify a variable amount of outputs generated for each input.

See merge request !221
2015-11-11 13:09:47 -05:00
Kenneth Moreland
342a57efcd Fix double reference compile error. 2015-11-07 11:23:03 -07:00
Kenneth Moreland
bf03243516 Add ability to multiply any Vec by vtkm::Float64.
This has been requested on the mailing list to make it easier to
interpolate integer vectors.

There are a couple of downsides to this addition. First, it implicitly
casts doubles back to whatever the vector type is, which can cause a
loss of precision. Second, it makes it more likely to get overload
errors when multiplying with Vec. In particular, the operator to cast
Vec of size 1 to the component class had to be removed.
2015-11-07 06:33:50 -07:00
Kenneth Moreland
d44860c3cf Change tetrahedralize filters to use new Scatter mechanism
The tetrahedralize algorithms have been changed to use the Scatter
classes to build indices rather than build them on their own.

To implement this efficiently with structured grids, a new ScatterUniform
class was made. I also added a new execution argument tag that allows
you to get the thread indices object from within the worklet.
2015-11-07 04:57:16 -07:00
Kenneth Moreland
45abbb5c75 Share from indices vector.
Previously, each VecFromPortalPermute (the type that held the from field
values) held its own copy of the indices. For point to cell on
structured grids, this was a lot of repeated data values, which has the
potential to fill up cache and registers. Instead, just use pointer
references.
2015-11-06 18:05:21 -07:00
Kenneth Moreland
7b6e6e4a66 Enable output to input map in fetch mechanism.
This changes the interface to the ThreadIndices classes to have both
input and output indices. It also adds a visit index to ThreadIndices.

Also added the VisitIndex execution signature tag, which relies on this
behavior.
2015-11-06 18:05:20 -07:00
Kenneth Moreland
b0c5a32611 Add Scatter parameters to Invocation.
We are passing in execution objects with the Invocation when the Worklet
is scheduled, but we are not using it yet.
2015-11-06 18:05:20 -07: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
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
9965977f47 Merge topic 'FetchTagTopologyIn_return_shape_type'
a1f5bc9f FetchTagTopologyIn updated to properly return CellShape.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !209
2015-09-30 10:18:17 -04:00
Robert Maynard
fc79055f76 Add suppression pragmas to exec::Fetch classes 2015-09-24 10:39:48 -04:00
Robert Maynard
a1f5bc9f0a FetchTagTopologyIn updated to properly return CellShape. 2015-09-23 10:45:06 -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
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
08f9c04fab Add specialization of topology map fetch for regular point coords
In the special case where you are loading the point coordinates for a
structured grid in a point to cell map (an important use case), create a
VecRectilinearPointCoordinates rather than build a Vec of the values.
This will activate the cell specalizations in previous commits.

These changes also added some flat-to-logical index conversion and vice
versa in ConnectivityStructuredInternals. This change also fixed a bug
in getting cells attached to points in 2D grids. (Actually, technically
someone else fixed it and checked it in first. The changes were merged
during a rebase.)

I also added a specalization to Vec for 1D that implicitly converts
between the 1D Vec and the component. This can be convenient when
templating on the Vec length.
2015-09-02 13:54:51 -07:00
Kenneth Moreland
3e251de469 The CellShape fetch returns a tag rather than ID.
Previously, when you requested a CellShape in the ExecutionSignature,
you just got an ID stored in a vtkm::IdComponent. This change returns a
cell shape tag of the appropriate type (or generic if the type is not
known at compile time). This will allow functions called from the
worklet to specialize on the cell type better.
2015-08-27 16:31:06 -06:00
Kenneth Moreland
6598b296a6 Remove TopologyData class.
This class was used to store a group of from field data in a topology
map. However, the fetching has been changed to use a customized class
for each type of fetch that can be optimized for the fetch type and does
not require to know the number of items in the fetch at compile time.
Thus, this class is no longer needed, so it is being removed.
2015-08-14 09:17:34 -06:00
Kenneth Moreland
f7a6946d9a Use variable Vec-like objects for topology map fetching
This change removes the requirement to specify some maximum cell length
in each of the worklets, which is basically impossible. It also makes
some of the loading more lazy, which might help reduce the number of
registers required in a worklet.
2015-08-14 09:17:13 -06:00
Kenneth Moreland
c847f0b148 Get FromIndices as unknown type.
We want to be able to get topological connections where it is difficult
to know how many values you get each time. In this change, the type of
the vector holding the from indices is determined from the connectivity
object, and the worklet does not know the type (it must be templated).

Although you do not need to specify the max number for this value set
(you still currently do for field values), we still need to change the
type for explicit sets that uses something that does not rely on the Vec
class. The cell-to-point method also needs a Vec wrapper that allows it
to shorten the vector dynamically.
2015-08-14 09:15:46 -06:00
Robert Maynard
ab59e34a2f Rename pragma header guard so it makes sense for tbb and thrust.
Boost is not the only thirdparty that we are supressing warnings for, so
make the name more generic.
2015-08-13 09:04:23 -04:00
Kenneth Moreland
42aba97728 Add in-place (in-out) arrays to worklets.
Previously, all arrays passed to worklets were designated as either
input or output. No in-place operation was permitted. This change adds
the FieldInOut tag for ControlSignature in both WorkletMapField and
WorkletMapTopology that allows you to read and write from the same
array.
2015-08-12 14:41:56 -06:00
Kenneth Moreland
63b45ad1e5 Consistently use from/to for topological links
In the CellSet and related classes, a connection was referred to by a
"from" topology element and a "to" topology element. However, in the
worklet control signature tags the elements were referred to by "src"
and "dest." To make things consistent, use "from" and "to" everywhere.
2015-08-03 10:48:50 -06:00
Kenneth Moreland
01757ea136 Change Node -> Point
Most of VTK-m follows the convention of calling the 0D topology elements
"points" (which follows the convention of VTK). However, there were
several places where they were referred to as "nodes." Make things
consistent by calling them points everywhere.

Also merged some redundant ExecutionSignature tags.
2015-08-03 10:06:59 -06:00
Kenneth Moreland
b392dc509e Move RegularStructure to ConnectivityStructuredInternals
Also moved from vtkm namespace to vtkm::internal namespace. This change
is to then move the structured connectivity classes to the cont and exec
namespaces.
2015-07-31 15:48:06 -06:00
Kenneth Moreland
04fce28ae3 Deal with small integer promotions
C and C++ has a funny feature where operations on small integers (char
and short) actually promote the result to a 32 bit integer. Most often
in our code the result is pushed back to the same type, and picky compilers
can then give a warning about an implicit type conversion (that we
inevitably don't care about). Here are a lot of changes to suppress
the warnings.
2015-07-30 17:41:58 -06:00
Kenneth Moreland
21b3b318ba Always disable conversion warnings when including boost header files
On one of my compile platforms, GCC was giving conversion warnings from
any boost include that was not wrapped in pragmas to disable conversion
warnings. To make things easier and more robust, I created a pair of
macros, VTKM_BOOST_PRE_INCLUDE and VTKM_BOOST_POST_INCLUDE, that should
be wrapped around any #include of a boost header file.
2015-07-30 17:40:40 -06:00
Robert Maynard
98d6e99275 Correct some warnings about 64bit to 32bit conversion. 2015-07-23 09:29:10 -04:00
Robert Maynard
0a433303e6 Correct headers to have the new copyright. 2015-06-03 15:06:43 -04:00
Robert Maynard
7f2ee8d050 Merge branch 'master' into datamodel-design 2015-06-03 14:36:53 -04:00
Robert Maynard
9eb84295fa correct a bad file being in the cmakelists. 2015-05-29 15:53:20 -04:00
Robert Maynard
7552509e4b Include all the new DataSet header in CMakeLists.
This will make sure that we properly install these headers.
2015-05-29 12:07:46 -04:00
Robert Maynard
07970cf476 Correct all signed / unsigned and narrowing warnings ( 64bit to 32bit ). 2015-05-28 09:05:17 -04:00