Commit Graph

179 Commits

Author SHA1 Message Date
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
Matt Larsen
47452d82bc fixing typo 2016-03-04 10:49:43 -08:00
Matt Larsen
6d63961311 Misplaced bracket 2016-03-04 10:42:07 -08:00
Matt Larsen
da66ea6a15 Refactoring TBB atomics 2016-03-04 10:18:35 -08:00
Matt Larsen
f0f8f0b556 attempt 6 2016-03-03 23:36:21 -05:00
Matt Larsen
5df9088e1d Adding volatile 2016-03-03 23:13:26 -05:00
Matt Larsen
25604a0288 Another typo 2016-03-03 22:46:15 -05:00
Matt Larsen
4a28124658 Fixing typo 2016-03-03 22:17:29 -05:00
Matt Larsen
29ca4f38f6 Attempting type match 2016-03-03 19:42:35 -05:00
Matt Larsen
1448d0d3b4 Adding another typename 2016-03-03 16:04:04 -05:00
Matt Larsen
23e801da55 Adding typename 2016-03-03 15:34:44 -05:00
Matt Larsen
f0c20903b3 Sorting out iterator type 2016-03-03 15:30:28 -05:00
mclarsen
78888e6542 Testing Interlock exchange 2016-03-02 13:53:28 -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
Sujin Philip
6efc1920df Fix VTKM_VECTORIZATION_IN_LOOP placement
It is only applicable on the statement on following line.
2016-01-25 10:59:08 -05:00
Robert Maynard
b8e5923ae1 FunctorsTBB now uses VTKM_VECTORIZATION_X macros everywhere. 2016-01-12 08:43:06 -05:00
Robert Maynard
c7756c78bb TBB SortByKey works now when the key is a ArrayHandleZip.
The issue was that the temporary index array storage container
was the same as the input ArrayHandleZip which is not correct.
2016-01-04 16:55:47 -05: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
bfb6c26a98 Simplify the design of vectorization support.
Remove the configured file variables, as that causes problems
when using an installed version of VTK-m.
2015-12-01 11:37:41 -05:00
Robert Maynard
4ceb111a68 Enable vectorization inside the Serial and TBB backends. 2015-11-25 15:59:13 -05:00
Robert Maynard
8816642dfd Move algorithms out of DeviceAdapterAlgorithmGeneral to reduce compilation size 2015-10-26 17:22:49 -04:00
Robert Maynard
c78e54facc Move algorithms out of DeviceAdapterAlgorithmTBB to reduce compilation size. 2015-10-26 09:47:13 -04: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
b1c96381de Merge branch 'multiple_backend_example' into 'master'
Correct the tbb install rules when tbb is disabled.

See merge request !201
2015-09-17 14:04:37 -04:00
Robert Maynard
0b97d4c458 Correct the tbb install rules when tbb is disabled. 2015-09-17 13:59:26 -04:00
Robert Maynard
9b877ef49b Merge topic 'multiple_backend_example'
fd685210 Always install all device headers even when device isn't enabled.
b1663b24 Add an example of using multiple backends from a single translation unit.
fc0ff69d Methods with try/catch need to be host only.
4d635d64 DeviceAdapter Tags now always exist, and contain if the device is valid.
cf32b430 Teach Configure.h to store if TBB and CUDA are enabled.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !198
2015-09-17 09:49:49 -04:00
Robert Maynard
fd68521066 Always install all device headers even when device isn't enabled.
vtkm_declare_headers now is able to not test headers, by using the
TESTABLE keyword.
2015-09-17 09:28:21 -04:00
Robert Maynard
fc0ff69d04 Methods with try/catch need to be host only.
When compiling with cuda and tbb enabled in a single translation unit you
need to make sure all try/catch blocks are marked as host only otherwise
the cuda compiler will error out.
2015-09-17 09:28:21 -04:00
Robert Maynard
4d635d642b DeviceAdapter Tags now always exist, and contain if the device is valid.
Previously it was really hard to verify if a device adapter was valid. Since
you would have to check for the existence of the tag. Now the tag always
exists, but instead you query the traits of the DeviceAdapter to see if
it is a valid adapter.

This makes compiling with multiple backends alot easier.
2015-09-17 09:28:21 -04:00
Kenneth Moreland
e23649d290 Fix use of ArrayHandleCounting in TBB device adapter 2015-09-15 14:19:10 -06:00
Robert Maynard
fd982f1b93 Don't use guards in parallel_sort as it doesn't use vtkm configure. 2015-08-13 10:50:17 -04: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
Robert Maynard
8204db2f6a Use VTKM_BOOST_PRE_INCLUDE around thrust headers too. 2015-08-13 08:26:41 -04:00
Kenneth Moreland
923fac45dd Allow TBB back to version 4.0.
Robert Maynard tells me that the TBB backend has been tried on versions
of TBB back to 4.0. Since the patch appears to work across them, allow
those versions too.
2015-08-04 10:13:43 -06:00
Kenneth Moreland
ce8ecf9e8b Don't use patched version of TBB on newer versions.
We have a patched version of TBB's parallel_for.h in our files that
fixes a problem with using std::swap. This issue has since been fixed in
TBB, so for newer versions we should revert back to TBB's
implementation.
2015-08-04 09:14:24 -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
Kenneth Moreland
57d64f4a20 Use ptrdiff_t instead of size_t with TBB iterators.
Math on random iterators needs signed numbers, otherwise signed/unsigned
warnings can occur.
2015-07-29 19:13:30 -06:00
Kenneth Moreland
be045d7a77 Fix warnings about implicit conversions in MSVC.
These occur in the TBB device adapter code.
2015-07-28 14:10:18 -06:00
Robert Maynard
765cc36ba5 Guard against tbb including windows.h in a damaging fashion.
tbb includes windows.h, and doesn't use the NOMINMAX so we need to do
that ourselves so that we can use std::min/max and limits<T>::min/max.

At the same we also define WIN32_LEAN_AND_MEAN so that the total number of
macros that windows.h defines is reduced.
2015-07-15 09:51:46 -04:00
Robert Maynard
c28ca7aa41 Up the default tbb grain size, and use the grain size everywhere. 2015-07-09 15:51:29 -04:00
Kenneth Moreland
4fc3626712 Fix compiler directives for icc
The Intel icc compiler tries to pretend it is gcc, but it sometimes
behaves differently. Add more explicit checks for what compiler is
being used.
2015-07-06 10:35:06 -06: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
7ee3084868 Update the name of the binary functor for Sort. 2015-06-23 08:36:42 -04:00
Robert Maynard
604289c1ce Update the name of the binary functor for ScanInclusive 2015-06-23 08:26:04 -04:00
Robert Maynard
b36211baf2 Improve the performance of tbb sortbykey with heavy value arrays. 2015-06-19 14:37:59 -04:00
Robert Maynard
6279b8ed28 Correct tbb to properly sort all arrrays in parallel. 2015-06-16 14:40:25 -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
Robert Maynard
543a3a0453 Allow TBB Device Adapter to sort array handle zip. 2015-06-10 14:15:39 -04:00
Robert Maynard
0bd7d5e0f5 Merge branch 'schedule_id3_serial' 2015-06-08 10:38:20 -04:00
Robert Maynard
2d6bdd1496 Correct a bug in the TBB Schedule 3D implementation. 2015-06-08 09:49:08 -04:00
Sujin Philip
4c51138f60 Add new lines at end of files. 2015-06-05 13:14:28 -04:00
Robert Maynard
e0e6ffb705 Suppress warnings generated by TBB code, which we can change.
These warnings are caused by tbb code, which we have zero control over.
2015-06-02 09:42:40 -04:00
Sujin Philip
08f88b1cb9 Add TBB backend. 2015-06-01 13:57:37 -04:00