Commit Graph

178 Commits

Author SHA1 Message Date
Allison Vacanti
d833d9285f Merge topic 'openmp'
183bcf109 Add initial version of an OpenMP backend.
7b5ad3e80 Expand device scheduler test to check for overlap.
e621b6ba3 Generalize the TBB radix sort implementation.
d60278434 Specialize swap for ArrayPortalValueReference types.
761f8986f Cache inputs to SSI::Unique benchmark.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1099
2018-05-31 16:49:15 -04:00
Shreeraj Jadhav
6e099b7c09 Fix issue #110 TestingDeviceAdapter uniform_int_distribution
This fix addresses issue #110. Test functions in TestingDeviceAdapter have
been updated to test large arrays through random indices using
std::uniform_int_distribution rather than testing every 100th or 50th value.
2018-05-30 11:04:02 -04:00
Allison Vacanti
7b5ad3e80c Expand device scheduler test to check for overlap.
Add a test that fails if DeviceAdapterAlgorithm::Schedule
executes the same instance twice. Useful for checking block
scheduling algorithms.
2018-05-29 14:49:44 -04:00
Allison Vacanti
93506d25e2 Change function signatures to use 'using' aliases.
Also cleaned up some lingering type typedefs.
2018-05-25 17:18:41 -04:00
Robert Maynard
22ea58335a iVTK-m CUDA backend doesn't use thrust::cuda::pointer any more.
This was removed as CUDA 9.0 on MSVC has issues where CUB/Thrust
would fail to compile when given these types.
2018-02-02 08:33:17 -05:00
Sujin Philip
8c242cef91 Switch from faux to true virtuals 2017-11-06 15:25:29 -05:00
Robert Maynard
27d1275249 Correct issues on windows with debug tests timing out.
The tests actually raised a std assert which was causing a timeout as it
required user intervention to click through.
2017-10-31 13:35:13 -04:00
Kenneth Moreland
e50ec6b667 Fix type error in ScanExclusiveByKey
The implementation of ScanExclusiveByKey in
DeviceAdapterAlgorithmGeneral by shifting values in the input values
array and then calling ScanInclusiveByKey. However, the temporary
shifted values array was created using the key type instead of the
values type. This caused a compile error when the keys and values had
different types.
2017-10-24 16:12:30 -06:00
Allison Vacanti
1018d981a0 Check for overlap in CopySubRange.
Some parallel copy implementations will not handle this sanely.
2017-10-11 16:52:32 -04:00
Kenneth Moreland
c3a3184d51 Update copyright for Sandia
Sandia National Laboratories recently changed management from the
Sandia Corporation to the National Technology & Engineering Solutions
of Sandia, LLC (NTESS). The copyright statements need to be updated
accordingly.
2017-09-20 15:33:44 -06:00
Robert Maynard
f68635941e Convert VTK-m over to use 'using' instead of 'typedef' 2017-08-17 10:47:25 -04:00
Robert Maynard
b85cdd9080 Convert VTK-m over to use 'using' instead of 'typedef' 2017-08-07 14:05:43 -04:00
Robert Maynard
5dd346007b Respect VTK-m convention of parameters all or nothing on a line
clang-format BinPack settings have been disabled to make sure that the
VTK-m style guideline is obeyed.
2017-05-26 13:53:28 -04:00
Kitware Robot
4ade5f5770 clang-format: apply to the entire tree 2017-05-25 07:51:37 -04:00
Kitware Robot
efbde1d54b clang-format: sort include directives 2017-05-18 12:59:33 -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
968960c1a1 Add Virtual Methods Framework 2017-05-01 16:51:42 -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
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
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
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
Li-Ta Lo
da8a2315ce add wip for exclusive scan by key 2017-04-13 11:50:56 -06:00
Li-Ta Lo
847c73b7d4 first attemp at segmented inclusive scan 2017-03-29 09:29:11 -06: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
Sujin Philip
9eddce6c99 Rename StreamCompact to CopyIf
Plus, removes the version that uses one array as both input and stencil.
2017-03-06 11:08:27 -05:00
Sujin Philip
a88807fd7e Catch all exceptions by reference 2017-02-23 13:25:01 -05:00
David C. Lonie
f601e38ba8 Simplify exception hierarchy.
Remove the ErrorControl class such that all subclasses now inherit from
error. Renamed all exception classes via s/ErrorControl/Error/.

See issue #57.
2017-02-07 15:42:38 -05:00
Robert Maynard
79b74ccd3c Merge branch 'gcc6_warnings' into 'master'
Fix warnings on GCC6.

See merge request !656
2017-01-11 15:37:30 -05:00
Robert Maynard
9335e75e51 Fix casting warnings in TestingDeviceAdapter. 2017-01-11 09:47:24 -05:00
David C. Lonie
c928b14cfe Fix warnings on GCC6. 2017-01-10 14:22:22 -05:00
Robert Maynard
ad28ccad5a Update the default ARRAY_SIZE in TestingDeviceAdapter.
This will expose bugs inside the tbb backend. We had to use heap allocations
for test arrays, instead of stack as the new array increases started to
cause stack overflow on windows.
2017-01-09 13:41:21 -05:00
Robert Maynard
a74bab02f4 Merge topic 'allow_reduction_to_different_T_type'
b97b4cc7 Allow thrust::reduce to work when iterator and initial value types differ.
64bcc343 Refactor MinAndMax to use vtkm::Vec<T,2> instead of Pair.
8d60ed57 Refactor MinAndMax to be a shared binary operator.
18375b54 Update Bound computations to always use a single Reduce call
2cfc9743 Reduce can support reduce to a T type that isn't the arrayhandles T type.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !614
2016-12-01 07:56:30 -05:00
Robert Maynard
6b1094c767 Consistently include windows.h by making a wrapper header.
We previously included windows.h in numerous locations using different
techniques to guard against bringing in parts of the file that are bad
(min/max macros, etc). This solves the problem by consistently using
vtkm/internal/Windows.h to setup everything.
2016-11-28 09:54:37 -05:00
Robert Maynard
64bcc34389 Refactor MinAndMax to use vtkm::Vec<T,2> instead of Pair.
The types are the same which makes Vec a more suitable container.
2016-11-25 13:11:19 -05:00
Robert Maynard
8d60ed57ad Refactor MinAndMax to be a shared binary operator. 2016-11-25 11:40:46 -05:00
Robert Maynard
18375b5424 Update Bound computations to always use a single Reduce call 2016-11-25 11:40:46 -05:00
Robert Maynard
2cfc9743e3 Reduce can support reduce to a T type that isn't the arrayhandles T type.
This has been done so that operations such as computing the Min/Max of
an array can be done in a single reduce step.
2016-11-25 11:40:46 -05: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
f31d6c2258 Refactor vtkm::Types to be concise and move math helpers out of internal.
I have verified that the optimized assembly for Vec<3> and Vec<4> are consistent
with what we generated before.
2016-10-28 14:57:16 -04:00
Robert Maynard
51e50d2933 Add DeviceAdapter::CopySubRange to all device adapters.
This allows callers to copy a subsection of an array into another array,
without clearing the contents of the destination array if a resize
is required.
2016-08-24 15:42:51 -04:00
John Biddiscombe
bafee5dd71 Add a Copy benchmark 2016-06-16 09:18:26 -04:00
John Biddiscombe
208b1ddda3 Add a DeviceAdapter Copy test 2016-06-15 16:27:06 -04:00
Robert Maynard
ee4e490f1d Moved SMP atomic operations from TBB to General.
Even when running with the serial backend, the compiler might enable SIMD
vectorization when optimizations are turned on. When this occurs, we need
to use properly atomic Add's and CAE's.
2016-03-14 10:40:42 -04:00
Matt Larsen
3b46706e1f Adding compare and swap and removing unsigned atomics 2016-03-08 09:41:02 -08:00
Matt Larsen
ecc12dddb7 using reinterpret cast and removing warning from atomic array test 2016-03-04 14:46:45 -08:00
mclarsen
ca37b2e9cb Fixed compiler error with atomics 2016-02-10 08:21:38 -08:00
Matt Larsen
2baac9cd8b initial commit of atomic adds 2016-02-10 07:51:31 -08:00
Kenneth Moreland
3f446ad261 Add ErrorControlCuda for better CUDA error checking.
Add lots of checks to CUDA calls in the timer to try to identify any
problems that might be showing up on the dashboard.

Also adding some print statements around the sleep function in the
device adapter testing. For some reason the problem just went away with
them.
2016-01-12 15:19:54 -07:00
Robert Maynard
c70da5fc23 Extend vtkm::DeviceAdapterTraits to include a unique numeric identifier.
Previously each device adapter only had a unique string name. This was
not the best when it came to developing data structures to track the status
of a given device at runtime.

This adds in a unique numeric identifier to each device adapter. This will
allow classes to easily create bitmasks / lookup tables for the validity of
devices.
2015-12-16 11:18:52 -05:00
Robert Maynard
a7127f0fc3 Adding vtkm::cont::RuntimeDeviceInformation.
The RuntimeDeviceInformation class allows developers to check if a given
device is supported on a machine at runtime. This allows developers to properly
check for CUDA support before running any worklets.
2015-12-15 17:25:27 -05:00
Robert Maynard
7d249e8996 Move DeviceAdapterTraits into vtkm::cont as they are user API.
When writing multiple backend code users of vtkm need to use the
DeviceAdapterTraits classes, so therefore we should move them to vtkm::cont
to signify this.
2015-12-11 09:52:18 -05: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
Robert Maynard
f38673f618 Replace ErrorControlOutOfMemory with ErrorControlBadAllocation. 2015-10-01 14:25:28 -04:00
Kenneth Moreland
891182ee19 Add ArrayHandleIndex class.
This is the most common use case for ArrayHandleCounting, and this class
is a bit easier to use and a bit faster.
2015-09-14 22:11:09 -06:00
Sujin Philip
514ac54e59 Add custom operator and initial value support to ExclusiveScan 2015-08-28 09:56:04 -04:00
Robert Maynard
bae6ff7f55 Merge branch 'introduce_binary_and_unary_operators' into 'master'
Introduce binary and unary operators

See merge request !94
2015-08-06 15:14:28 -04:00
Robert Maynard
f20b1ea99a Add vtkm/BinaryPredicates header.
Currently includes the following predicates:
  - Equal
  - NotEqual
  - SortLess
  - SortGreater
  - LogicalAnd
  - LogicalOr
2015-08-04 16:55:53 -04:00
Robert Maynard
19aa6b8d62 Update the 3d scheduling benchmark code to use the new 1d scheduler 2015-07-23 16:31:41 -04:00
Robert Maynard
e1cd7737c6 Add a test to verify that we can schedule large arrays. 2015-07-23 16:31:23 -04:00
Will Usher
50fa6f78d3 Fix support for enabling 64bit vtkm::Id and double precision
The CMake flag and define differ in their capitalization of the 'm' in
VTKm so I've made CMake variables that match those used in Configure.h.in,
thereby keeping the original naming of VTKm in CMake code, and VTKM in the
C++ code.

This fix also revealed some areas in CellSet and CellSetExplicit where ints
where used instead of vtkm::Ids which caused errors with child classes who
override the methods and returned a vtkm::Id instead of an int.

Also fixed issues that appeared in TestOutOfMemory which got out of date due
to not being compiled since the `VTKM_USE_64BIT_IDS` flag would never be set.
The test now runs and passes when 64bit ids are enabled.
2015-07-23 09:01:39 -04:00
Robert Maynard
ffa1e4ed50 Remove unneeded helpers from the TestingDeviceAdapter. 2015-07-08 10:58:20 -04:00
Sujin Philip
273281f581 Fix Parallel Scan implementation for TBB Device
The previous implementation assumed the identity value to be zero, which does
not work for multiplication. Changed the interface to require an initial value
for Exclusive Scan with custom operator (TBB Device only, for now).
2015-06-24 09:24:58 -04:00
Robert Maynard
011b79ba00 Verify permutation array works with Sort and Reduce. 2015-06-19 08:44:21 -04:00
Robert Maynard
2ce14c7760 DeviceAdapter's now properly init all value types.
This is needed when use vtkm::Vec, as it doesn't zero the memory it contains.
2015-06-16 08:35:04 -04:00
Chun-Ming Chen
32f3fa6d87 Fix unmerged codes from the previous merge. Use multiply in customed operator ReduceByKey test 2015-06-15 11:12:51 -04:00
Chun-Ming Chen
4d9c25deff Merge remote-tracking branch 'robert/reduce_by_key_custom_binary_function' into ReduceByKey_fix 2015-06-15 10:55:44 -04:00
Chun-Ming Chen
dcc12e733f Fix ReduceByKey general algorithm to work with parallel ScanInclusive. Use bit representation for states. 2015-06-13 02:46:36 -04:00
Robert Maynard
53d7053d7a Fix a bug where DeviceAdapterGeneral::ReduceByKey ignored custom binary functor 2015-06-12 16:11:28 -04:00
Robert Maynard
50ffcec3bb Merge branch 'tbb_SortByKey_ZipArray_fix' into 'master'
TBB sort by key zip array fix

The original codes do not accept when the zip handle array contains two different storage types

See merge request !25
2015-06-12 15:43:09 -04:00
Chun-Ming Chen
360279c29a A more general Copy that allows copying into a diff. array type. Testing codes are added. 2015-06-12 12:42:43 -04:00
Robert Maynard
791e0c477c Add a test to use Reduce and ArrayHandleZip together. 2015-06-12 11:56:46 -04:00
Chun-Ming Chen
84192883fa Merge branch 'tbb_SortByKey_ZipArray_fix' of https://gitlab.kitware.com/chunmingchen/vtk-m into tbb_SortByKey_ZipArray_fix 2015-06-11 11:51:43 -04:00
Chun-Ming Chen
ebf814cb81 This merge adds ReduceByKey with different keys
Merge branch 'test_tbb_SortByKey' into tbb_SortByKey_ZipArray_fix

Conflicts:
	vtkm/cont/testing/TestingDeviceAdapter.h
2015-06-11 11:48:13 -04:00
Chun-Ming Chen
d42edb51ab Include ArrayHandleZip in related testing codes 2015-06-11 11:29:51 -04:00
Chun-Ming Chen
267505ff0f Remove unncecessary comments 2015-06-11 11:29:51 -04:00
Chun-Ming Chen
c7cf1a27f2 add testing ReduceByKey with zipped array with heterogeneous value types 2015-06-11 11:29:51 -04:00
Chun-Ming Chen
1088e855c3 Add ReduceByKey support for zip array input. A testing codelet to demo the problem. 2015-06-11 11:29:51 -04:00
Chun-Ming Chen
c60b9688fc TBB may fail in the new test case 2015-06-10 16:37:52 -04:00
Robert Maynard
cbf3faf135 Simplify the SortGreater and SortLesser Implementation. 2015-06-10 14:15:40 -04:00
Robert Maynard
549a7dd7c7 Adding support to cuda backend to write to a ZipHandle. 2015-06-10 14:15:40 -04:00
Robert Maynard
493d201029 Add tests to verify that you can properly sort ArrayHandleZip.
We have increased the ARRAY_SIZE for the TestingDeviceAdapter to work
around issues with backends not using parallel algorithms for arrays of length
500 or less.
2015-06-10 14:15:40 -04:00
Chun-Ming Chen
8a3cc844e8 Include ArrayHandleZip in related testing codes 2015-06-08 13:31:31 -04:00
Chun-Ming Chen
bf44b9a840 Remove unncecessary comments 2015-06-08 12:13:19 -04:00
Chun-Ming Chen
5d87c1fa79 add testing ReduceByKey with zipped array with heterogeneous value types 2015-06-08 11:57:29 -04:00
Chun-Ming Chen
1533d7c63a Add ReduceByKey support for zip array input. A testing codelet to demo the problem. 2015-06-08 11:57:29 -04:00
Robert Maynard
0bd7d5e0f5 Merge branch 'schedule_id3_serial' 2015-06-08 10:38:20 -04:00
Robert Maynard
1d595b868c Make Schedule 3D use a larger dim size to throughly test implementations.
A smaller dim size can hide problems with algorithms that don't sum properly,
or do to much math per iteration.
2015-06-08 09:47:17 -04:00
Robert Maynard
8a8fc9ea73 Remove unused code from TestingDeviceAdapter. 2015-06-08 08:45:38 -04:00
Robert Maynard
b43fb01ff0 Redesign StorageBasic to allow modification of user provided memory.
The driving desire for this change was to make vtk-m ArrayHandle behave more
like the standard vector. The canonical example of what we want to support is:

```
std::vector<vtkm::Id> values;
values.resize(100);
vtkm::cont::ArrayHandle<vtkm::Id> array = vtkm::cont::make_ArrayHandle(values);
vtkm::cont::DeviceAdapterAlgorithm<DeviceAdapter>::Sort(array);
```

And with-out the ability to modify user provided memory, this was impossible.
2015-06-05 10:32:48 -04:00
Robert Maynard
98bd557a4f TestingDeviceAdapter now doesn't use initializer lists for vtkm::Vec
Since initializer lists are a c++11 feature we shouldn't use them.
2015-06-01 14:50:35 -04:00
Chun-Ming Chen
7ea9563d19 Fixed bug in ReduceByKey 2015-06-01 12:33:08 -04:00
Robert Maynard
d54aee7eb5 Merge branch 'fix_typo_in_copyright' 2015-05-21 10:32:08 -04:00