Commit Graph

1029 Commits

Author SHA1 Message Date
Li-Ta Lo
cfea9b32d0 Merge topic 'array_handle_reverse'
5226fa8b add read only (for the moment) test and implementation of ArrayHandleReverse (a.k.a reverse iterator)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !763
2017-05-08 10:54:16 -04:00
Li-Ta Lo
5226fa8b53 add read only (for the moment) test and implementation of ArrayHandleReverse (a.k.a reverse iterator) 2017-05-05 13:45:23 -06:00
Sujin Philip
5eb6d3f142 Fix some errors in the clipping code 2017-05-05 15:34:08 -04:00
Robert Maynard
57ab48fe8e Replace occurrences of NULL with nullptr. 2017-05-04 10:50:57 -04:00
Robert Maynard
022c36fa4f Add vtkm::exec::TaskBase, and rename WorkletInvokeFunctor to TaskSingular
Previously WorkletInvokeFunctor inherited from vtkm::exec::FunctorBase,
which is also the base class for all users Worklets and for all functors
based to DeviceAdapter::Schedule.

This is done for a few reasons. The first is that we reduce the
minimum size of user worklets. Previously the users worklet would hold
a reference to the error message, and so would the wrapper class added
when calling DeviceAdapter::Schedule. Now we only have the users worklet
holding a reference.

Second, by refactoring to have two base classes we can better improve
the documentation on what responsibilities FunctorBase.h has, compared
to TaskBase.
2017-05-02 16:38:43 -04:00
Sujin Philip
e9898cc5cf Merge topic 'virtual-methods'
4049b5b2 Add ClipWithImplicitFunction Filter
82d02e46 Modify ImplicitFunctions to use Virtual Methods
968960c1 Add Virtual Methods Framework

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !750
2017-05-02 16:12:04 -04:00
Sujin Philip
82d02e46ef Modify ImplicitFunctions to use Virtual Methods 2017-05-01 16:55:59 -04:00
Sujin Philip
968960c1a1 Add Virtual Methods Framework 2017-05-01 16:51:42 -04:00
Li-Ta Lo
244697c93e Merge topic 'scanbykey'
987b51f6 add comments on ScanInclusiveByKey and ScanExclusiveByKey

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !754
2017-04-27 11:33:17 -04:00
Li-Ta Lo
987b51f604 add comments on ScanInclusiveByKey and ScanExclusiveByKey 2017-04-26 16:31:20 -06:00
Robert Maynard
80b9d74a23 Merge topic 'embed_more_into_vtkm_cont'
ec6589d3 Only enable -fPIC on component static libraries when necessary.
cbfe5fdd Fix up various issues with ArrayHandles in vtkm_cont.
355eea88 Get the vtkm cont cuda object to compile properly.
6ecc22bb First pass at compiling ArrayHandle into vtkm_cont.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !715
2017-04-26 13:47:10 -04:00
Li-Ta Lo
0ba9784082 Merge topic 'scanbykey'
5c735a38 this should resovle all the type conversion warnings
d8b02329 Merge branch 'scanbykey' of gitlab.kitware.com:ollielo/vtk-m into scanbykey
58ef7c8d one more attemp to get the data type right
22d0e355 attempt to fix warning on type conversion
ded4583a attempt to fix warning on type conversion
897b2f0f add tests for 1, 2 and ARRAY_SIZE elements for both ScanInclusiveByKey and ScanExclusiveByKey
c05a2c32 Merge branch 'scanbykey' of gitlab.kitware.com:ollielo/vtk-m into scanbykey
0e97fcb9 handle the case of 0 or 1 element in the input for ScanExclusiveByKey
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !746
2017-04-25 15:54:25 -04:00
Li-Ta Lo
5c735a385c this should resovle all the type conversion warnings 2017-04-25 10:12:11 -06:00
Li-Ta Lo
d8b02329c5 Merge branch 'scanbykey' of gitlab.kitware.com:ollielo/vtk-m into scanbykey 2017-04-20 15:13:05 -06:00
Li-Ta Lo
58ef7c8de0 one more attemp to get the data type right 2017-04-20 15:09:38 -06:00
Li-Ta Lo
22d0e35521 attempt to fix warning on type conversion 2017-04-20 10:22:43 -06:00
David C. Lonie
ec6589d391 Only enable -fPIC on component static libraries when necessary. 2017-04-20 12:15:31 -04:00
Li-Ta Lo
ded4583aca attempt to fix warning on type conversion 2017-04-20 08:54:09 -06:00
Li-Ta Lo
897b2f0f63 add tests for 1, 2 and ARRAY_SIZE elements for both ScanInclusiveByKey and ScanExclusiveByKey 2017-04-19 13:38:28 -06:00
Li-Ta Lo
c05a2c323e Merge branch 'scanbykey' of gitlab.kitware.com:ollielo/vtk-m into scanbykey 2017-04-18 16:13:51 -06:00
Li-Ta Lo
0e97fcb94f handle the case of 0 or 1 element in the input for ScanExclusiveByKey 2017-04-18 16:12:36 -06:00
Kenneth Moreland
4758d3d978 Gracefully handle array range requests on empty arrays
Previously, The ArrayRangeCompute code would throw an exception if you
tried to compute the array range on an empty array. This change instead
returns empty ranges.
2017-04-18 14:43:05 -06:00
Li-Ta Lo
bea8e85c47 handle the case of 0 or 1 element in the input for ScanExclusiveByKey 2017-04-18 13:26:15 -06:00
Li-Ta Lo
a2085abaf6 add DerivedAlgorithm when calling other methods 2017-04-18 09:39:15 -06:00
Li-Ta Lo
0e107f5c3f remove unused InclusiveToExclusiveByKeyKernel functor 2017-04-18 09:34:52 -06:00
Li-Ta Lo
a205f21043 make ScanExclusiveByKey return void, rearrange parameter ordering 2017-04-17 16:11:02 -06:00
Li-Ta Lo
7023266585 add both generic and Thrust ScanExclusiveByKey 2017-04-17 15:03:49 -06:00
Li-Ta Lo
e77f9fac6a add CUDA implementation of ScanInclusiveByKey using Thrust library 2017-04-14 11:25:25 -06:00
David C. Lonie
4807b3c472 Silence warnings about unavoidable weak vtables.
- Exception classes cannot be exported due to MSVC's design decisions.
  See http://stackoverflow.com/questions/24511376. We must leave these
  classes as header only and silence the warnings.
- TransferResource in BufferState.h must remain a header-only class since
  there is no vtkm_interop library to compile the class into.
- The VTKDataSetReader hierarchy must similarly remain header-only since
  there is no vtkm_io library.
- The OptionParser Action classes are part of a header-only utility and
  cannot be easily compiled into a library.
-
2017-04-13 14:06:33 -04:00
Li-Ta Lo
da8a2315ce add wip for exclusive scan by key 2017-04-13 11:50:56 -06:00
Li-Ta Lo
ff37e31e63 Merge branch 'master' of gitlab.kitware.com:vtk/vtk-m into scanbykey 2017-04-07 13:44:20 -06:00
Robert Maynard
5f55be17e7 Update the TBB grain size to be a more reasonable default.
We not only update the TBB grain size to be a more value, we also specify
a grain size for the 3D scheduler.
2017-04-06 16:34:15 -04:00
David C. Lonie
cbfe5fddd9 Fix up various issues with ArrayHandles in vtkm_cont. 2017-04-05 15:45:11 -07:00
Robert Maynard
355eea887c Get the vtkm cont cuda object to compile properly. 2017-04-05 15:45:10 -07:00
David C. Lonie
6ecc22bb8c First pass at compiling ArrayHandle into vtkm_cont. 2017-04-05 15:45:01 -07:00
Li-Ta Lo
18c2f2413a Merge branch 'master' into scanbykey 2017-03-31 12:17:50 -06:00
Li-Ta Lo
847c73b7d4 first attemp at segmented inclusive scan 2017-03-29 09:29:11 -06:00
Kenneth Moreland
d68b211346 Remove TransportTagReducedValuesIn
Now that the transport takes the input range as one of its arguments,
this functionality can be implemented by the more general
TransportTagArrayIn.
2017-03-24 15:32:27 -06:00
Kenneth Moreland
dc192b793d Add input range to arguments of transport
Previously the arguments to the operator of a vtkm::cont::arg::Transport
were the control object, the input domain object, and the output range.
If you wanted to, for example, check the size of an input array to make
sure it matched the input range, you would have to know the meaning of
the input domain object to query its range. This made it hard to create
generic transports, like TransportTagArrayIn, that accept data from
multiple different input domains but need to know the input range.
2017-03-24 15:14:18 -06:00
Li-Ta Lo
5a50d60573 Merge topic 'unified-memory'
2bdc0be5 add cuda calls for memory advise as per Tom Fogel
6ce8a013 Merge branch 'master' into unified-memory
b470175f new unified memory effort with the new Thrust device
835073da clean up with custom allocator
dfae8f5e Fixing merge issue with contour_tree
82c40a63 First support for unified memory

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !729
2017-03-16 15:14:55 -04:00
Li-Ta Lo
2bdc0be5ca add cuda calls for memory advise as per Tom Fogel 2017-03-14 14:19:01 -06:00
Sujin Philip
566d70c450 Merge topic 'fix-windows_h-include-logic'
25f9f88f Fix windows.h include logic

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !722
2017-03-13 09:59:24 -04:00
Sujin Philip
25f9f88f3e Fix windows.h include logic
windows.h was only being included for MSVC, while in UnitTestTimer.cxx, the
Windows function Sleep was being called after check for _WIN32. This was
causing compilation failure in MINGW.

Fixes #122
2017-03-10 16:28:13 -05:00
Li-Ta Lo - 194699
6ce8a0135a Merge branch 'master' into unified-memory 2017-03-09 14:54:03 -07:00
Li-Ta Lo - 194699
b470175f98 new unified memory effort with the new Thrust device 2017-03-09 14:51:45 -07:00
Kenneth Moreland
6fdc7eb8c0 Add Field::GetRange and CoordinateSystem::GetBounds to library
Following what was done with ArrayRangeCompute, the GetRange and
GetBounds methods are embedded into the vtkm_cont library for the most
common type lists.

Also, and probably more importantly, the device adapter is no longer one
of the arguments for either of these methods. It is no longer needed as
ArrayRangeCompute no longer needs it.
2017-03-09 13:18:36 -05:00
Kenneth Moreland
c16236ce69 Use ArrayRangeCompute without specifying a device
Most uses of ArrayRangeCompute just want to get the range of the data
and probably don't have a particular device in mind. Thus, it is better
to use a TryExecute internally use whatever devices are available.

Note that when using TryExecute, the calling code is expected to be able
to support all devices. That might not always be the case. Thus, I am
experimenting a bit with how we incorporate this in a library. The
advantage of having the code compiled in a library is that you only have
to compile it once and the calling code does not need to worry about
CUDA, etc.

However, because ArrayRangeCompute is templated, we can only pre-compile
some subset of array handle types. The most common are compiled into the
code (matching all the predefined ArrayHandles as well as some special
cases). If the code wants to use some other type, it has to include
ArrayRangeCompute.hxx. The only place where this is necessary is a test
that intentially trys to find the range on an uncommon type.

If array portals were to support virtual methods, then we should be able
to modify this code so that we could precompile for all array handle
types.
2017-03-09 13:18:36 -05:00
Kenneth Moreland
8b33f2bc79 Fix device adapter algorithms for small arrays
There were some issues for device adapter algorithms (like scan and
reduce) for empty arrays or arrays of size 1. This adds tests for these
short arrays to the device adapter algorithm tests and fixes these
problems.
2017-03-08 19:05:28 -05:00
Kenneth Moreland
726546419d ArrayHandle reallocations of 0
The basic storage has an implicit invariant that if the size of the
storage is 0 then the array is a null pointer. That invariant was broken
if the array was allocated and then Shrink or Allocate was called with
0. In that case, the array remained allocated by the size was set to 0.

This fixes the problem by making sure a Shrink(0) actually does an
Allocate(0) (to clear out the data) and that the basic storage always
frees its memory when allocating a 0 sized array.
2017-03-08 18:53:06 -05:00
Robert Maynard
d5dfb1f673 Restore ArrayRangeCompute to using a single Reduce call.
We can easily compute the min and max of an array using a single reduction
2017-03-06 16:14:48 -05:00