Commit Graph

103 Commits

Author SHA1 Message Date
Allison Vacanti
c07c37aea2 Remove assert for incorrect assumption new TBB::RBK impl.
The assertion assumes that the RHS of the join operation has not been
yet reduced, which is not correct.
2017-09-18 16:12:07 -04:00
Allison Vacanti
d174c0fe3b Add TBB specialization for ReduceByKey.
TBB's ReduceByKey was using the generic DeviceAdapterGeneral
implementation and was about 50x slower than the serial implementation,
which is very efficient.

This patch improves TBB's RBK implementation significantly, though it still
does not scale well. On a quad core processor, this implementation performs
comparably or slightly worse than the highly efficient serial algorithm.
More than 4 cores may be needed to see sufficient parallel speedup that
would overcome the TBB overhead, and grain size does not seem to affect the
performance significantly.
2017-09-15 14:25:16 -04:00
Robert Maynard
f68635941e Convert VTK-m over to use 'using' instead of 'typedef' 2017-08-17 10:47:25 -04:00
Robert Maynard
a487017fd1 Remove lines that only contain a semi-colon. 2017-08-16 14:31:17 -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
c09e88d214 Improve the overall doxygen content for vtk-m. 2017-07-07 11:14:25 -04:00
David C. Lonie
b2c3e41645 Refactor array transfer logic for basic storage.
The old templated array transfer mechanism generated a lot of code
that ended up doing a simple, type-agnostic memcpy for most devices.
This patch specialized array handles for basic storage and uses a
fast-path array transfer implementation. This reduces the size of the
vtkm_cont library by 27% on gcc (from 6.2MB to 4.5MB).
2017-06-29 13:18:44 -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
Robert Maynard
60a405ef65 Add TaskTiling1D/3D which use faux virtuals to reduce binary size.
Redesigns the TBB and Serial backends and the vtkm::exec::Task concept so that
we can re-use the same launching logic for all Worklets, instead of generating
per worlet code. To keep the performance the same the TilingTask now is past
a range of indices to work on, rather than a single index.

Binary size reduction:
WorkletTests_SERIAL old - 19MB
WorkletTests_SERIAL new - 18MB

WorkletTests_TBB old - 39MB
WorkletTests_TBB new - 18MB

libvtkAcceleratorsVTKm old - 48MB
libvtkAcceleratorsVTKm new - 19MB
2017-05-25 11:00:01 -04:00
Kitware Robot
4ade5f5770 clang-format: apply to the entire tree 2017-05-25 07:51:37 -04:00
Ben Boeckel
db36ee22b0 cont: move VTKM_SUPPRESS_EXEC_WARNINGS to above declarations
Most uses of this macro appeared before any associated `template` lines.
Make them consistent. This also makes clang-format happier.
2017-05-23 14:34:20 -04:00
Robert Maynard
9d75e7b775 Remove unneeded member variables from tbb ScheduleKernelId3 2017-05-23 10:49:19 -04:00
Kitware Robot
efbde1d54b clang-format: sort include directives 2017-05-18 12:59:33 -04:00
Robert Maynard
57ab48fe8e Replace occurrences of NULL with nullptr. 2017-05-04 10:50:57 -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
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
David C. Lonie
ec6589d391 Only enable -fPIC on component static libraries when necessary. 2017-04-20 12:15:31 -04: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
David C. Lonie
6ecc22bb8c First pass at compiling ArrayHandle into vtkm_cont. 2017-04-05 15:45:01 -07: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
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
a88807fd7e Catch all exceptions by reference 2017-02-23 13:25:01 -05:00
Robert Maynard
35585f39ba Correct a bug in tbb scan exclusive that was found using tbb 2017. 2017-01-11 14:10:49 -05:00
Robert Maynard
a339f3ac0e Had to rewrite tbb reduce to correct all the problems.
The previous implementation(s) didn't properly handle non identity
initial values properly.
2017-01-04 17:27:21 -05:00
Robert Maynard
0120157e2e Correct tbb reduction algorithm to be correct when using multiple threads. 2017-01-04 13:43:55 -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
295de14deb Merge topic 'consistently_guard_around_windows_h'
6b1094c7 Consistently include windows.h by making a wrapper header.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !620
2016-11-30 13:56:49 -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
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
Robert Maynard
c8da8ae354 TBB now uses tbb::parallel_reduce for reductions.
This results in a reductions under tbb have a 2x to 4x performance increase.
2016-11-23 14:32:18 -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
154a4ab6e5 Make sure tbb doesn't enable autolinking on windows.
Since vtk-m is header only, we don't want everybody that is including
the tbb headers to auto-link to libtbb. So disable this behavior.
2016-10-07 16:08:16 -04:00
Robert Maynard
12810165bb Switch over to c++11 type_traits. 2016-08-31 16:11:26 -04: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
Robert Maynard
12ffd536fd Suppress false positive warnings from nvcc about host/device. 2016-04-01 15:50:52 -04:00
Kenneth Moreland
316ccc04a9 Remove the Extent class and related functions.
We have decided that we do not need the concept of an Extent in our data
model. Instead, we simply use dimensions, which can be represented in a
vtkm::Id3.
2016-03-22 15:41:42 -06: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
00a7f6c14b Correcting function call 2016-03-08 12:04:55 -08:00
Matt Larsen
43131ee02b Adding comments about CAS 2016-03-08 09:58:20 -08:00
Matt Larsen
40b6db7eee Inserted missing , 2016-03-08 09:51:50 -08:00
Matt Larsen
3b46706e1f Adding compare and swap and removing unsigned atomics 2016-03-08 09:41:02 -08:00
Matt Larsen
12632de34b Casting Uint64 to long long 2016-03-04 15:17:56 -08:00
Matt Larsen
ecc12dddb7 using reinterpret cast and removing warning from atomic array test 2016-03-04 14:46:45 -08:00
Matt Larsen
72f2549bb9 Removing shadow variable 2016-03-04 12:12:25 -08:00
Matt Larsen
f3c7f188ee Fixing problem with function signatures matching long * to int * 2016-03-04 11:52:52 -08:00
Matt Larsen
733edc8325 changing MS method signatures to long instead of int 2016-03-04 11:13:53 -08:00