Commit Graph

743 Commits

Author SHA1 Message Date
Robert Maynard
9e5f24b3b3 Merge branch 'msvc-issues' into 'master'
MSVC issues

Fix various issues encountered with the MSVC compiler.

See merge request !105
2015-07-29 15:32:38 -04:00
Robert Maynard
bb582ae4ec Update the cuda IteratorFromArrayPortal to use ptrdiff_t.
This make the advance / distance_to function signatures constant no matter
if we are building with 32/64 bit ids.
2015-07-29 09:57:42 -04:00
Robert Maynard
fcd07bbbd9 Merge branch 'make_cuda_version_check_faster' into 'master'
Make detecting if we are cuda 3+ gpu running cuda 2 code faster.

The original implementing tried to run 2^31 kernels and detect a
launch failure to determine this use-case. The issue with this approach
is that on a cuda 3+ gpu, this would take multiple seconds and cause
the gpu to terminate the kernel when opengl was also loaded.

See merge request !104
2015-07-29 09:17:35 -04:00
Kenneth Moreland
b8febd1c01 DataSet now holds DynamicCellSet instead of smart_ptr<CellSet>
The Invoke of the topology dispatcher is also changed to expect a
concrete cell set (which the DynamicCellSet is automatically cast to)
rather than a connectivity structure. The dispatcher calls the
GetNodeToCellConnectivity method for you. (That is currently the only
one supported.)
2015-07-28 17:33:52 -06:00
Kenneth Moreland
7d5fc75dd5 Fix issue with MSVC/NVCC determining a type. 2015-07-28 16:48:42 -06:00
Robert Maynard
d9fd702b1c Make detecting if we are cuda 3+ gpu running cuda 2 code faster.
The original implementing tried to run 2^31 kernels and detect a
launch failure to determine this use-case. The issue with this approach
is that on a cuda 3+ gpu, this would take multiple seconds and cause
the gpu to terminate the kernel when opengl was also loaded.
2015-07-28 17:04:24 -04: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
Kenneth Moreland
514253e103 Use default iterator difference type for IteratorFromArrayPortal
Previously, IteratorFromArrayPortal was declaring its difference_type
to be vtkm::Id. Although this is allowed, there is code that assumes
that iterators have a difference_type that is ptrdiff_t or something
similar. This change makes the difference_type the default for the
boost iterator facade, which should be the type other code that\
neglects to check expects.
2015-07-28 14:06:43 -06:00
Will Usher
eab098b862 Merge topic 'improve-benchmark-statistics'
e982ebe4 Measurement and general improvements to the benchmark suite

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !102
2015-07-28 13:16:45 -04:00
Will Usher
e982ebe41e Measurement and general improvements to the benchmark suite
- A warm up run is done and not timed to allow for any allocation of
  room for output data without accounting for it in the run times.
Previously this time spent allocating memory would be included in the
time we measured for the benchmark.

- Benchmarks are run multiple times and we then compute some statistics
  about the run time of the benchmark to give a better picture of the
expected run time of the function. To this end we run the benchmark
either 500 times or for 1.5s, whichever comes sooner (though these are
easily changeable). We then perform outlier limiting by Winsorising the
data (similar to how Rust's benchmarking library works) and print out
the median, mean, min and max run times along with the median absolute
deviation and standard deviation.

- Because benchmarks are run many times they can now perform some
  initial setup in the constructor, eg. to fill some test input data
array with values to let the main benchmark loop run faster.

- To allow for benchmarks to have members of the data type being
  benchmarked the struct must now be templated on this type, leading to
a bit of awkwardness. I've worked around this by adding the
`VTKM_MAKE_BENCHMARK` and `VTKM_RUN_BENCHMARK` macros, the make
benchmark macro generates a struct that has an `operator()` templated on
the value type which will construct and return the benchmark functor
templated on that type. The run macro will then use this generated
struct to run the benchmark functor on the type list passed. You can
also pass arguments to the benchmark functor's constructor through the
make macro however this makes things more awkward because the name of
the MakeBench struct must be different for each variation of constructor
arguments (for example see `BenchLowerBounds`).

- Added a short comment on how to add benchmarks in
  `vtkm/benchmarking/Benchmarker.h` as the new system is a bit different
from how the tests work.

- You can now pass an extra argument when running the benchmark suite to
  only benchmark specific functions, eg. `Benchmarks_TBB
BenchmarkDeviceAdapter ScanInclusive Sort` will only benchmark
ScanInclusive and Sort. Running without any extra arguments will run all
the benchmarks as before.
2015-07-28 11:03:28 -06:00
Kenneth Moreland
b270438fea Prevent warning about divide by zero.
The test_equal method compares the ratio of the two values to decide if
they are close enough. Although there is a previous check to make sure
that neither value is too close to zero, the MSVC sometimes gives a
warning because it cannot trace the flow of the check. Add another
conditional (that will never actually be executed) to check a second time
that we never divide by 0.
2015-07-28 09:52:04 -06:00
Kenneth Moreland
6b68666d0c Created DynamicCellSet
The DynamicCellSet will be used in place of the pointer to a CellSet
in a DataSet. This will prevent us from having to cast it all the time
and also remove reliance on boost smart_ptr.
2015-07-27 16:58:29 -06:00
Kenneth Moreland
53d669772f Merge branch 'msvc-array-handle-fail' into 'master'
MSVC ArrayHandle fail

Fix the fact that UnitTestArrayHandle is failing on the Windows dashboards. Also fix some of the MSVC warnings.

See merge request !101
2015-07-27 18:36:11 -04:00
Kenneth Moreland
b90b1132c7 Fix ArrayHandle test on MSVC
The test was creating a large array on the stack, and this caused a
problem on Windows for some reason. Instead of putting the array on
the stack, use an std::vector. Also reduced the size of the array
used. It seemed unnecessarily large.

Also re-enabled the tests where VTK-m allocates its own ArrayHandle
data.
2015-07-27 15:56:51 -06:00
Kenneth Moreland
85a2545c1e Fix various MSVC warnings.
Most warnings had to do with implicit type conversions and some on
treating an integer (actually a pointer) as a boolean.
2015-07-27 15:56:04 -06:00
Kenneth Moreland
8d3dbe35c2 Merge branch 'conventions-on-data-set' into 'master'
Conform DataSet classes to coding practices better

The most common changes were making class members uppercase and spelled
out, adding "this->" whenever a class member is used, and declare
functions and members with export macros. Also fixed some uses of int
(instead of vtkm::Id or something similar) and a bit of indentation. I
also sprinkled some const goodness over the code.

It should be noted that I had about a week delay between first making
these changes and checking them in. In the mean time Sujin also made
some similar changes, so there might be some repetative changes.

See merge request !100
2015-07-27 16:40:27 -04:00
Kenneth Moreland
7b6fe9c19b Correct use of GetPortalControl vs GetPortalConstControl
ArrayHandle::GetPortalControl should only be used when the array is
going to be modified. Using it on a const ArrayHandle should be a
compiler error (although some compilers are not always giving an error).
Also, GetPortalControl has a side effect where any data in the excution
environment gets wiped out (because it might change), which can lead to
inefficiencies when used unnecessarily.
2015-07-27 14:22:45 -06:00
Kenneth Moreland
19db32f084 Conform DataSet classes to coding practices better
The most common changes were making class members uppercase and spelled
out, adding "this->" whenever a class member is used, and declare
functions and members with export macros. Also fixed some uses of int
(instead of vtkm::Id or something similar) and a bit of indentation. I
also sprinkled some const goodness over the code.

It should be noted that I had about a week delay between first making
these changes and checking them in. In the mean time Sujin also made
some similar changes, so there might be some repetative changes.
2015-07-27 12:49:42 -06:00
Robert Maynard
cc43ac349e Merge branch 'correct_scheduling_over_65k_blocks' into 'master'
Cuda now can schedule worklets that require more than 2B instances.

See merge request !95
2015-07-23 17:23:06 -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
d0d11640ea Cuda now can schedule worklets that require more than 2B instances. 2015-07-23 16:31:28 -04:00
Robert Maynard
e1cd7737c6 Add a test to verify that we can schedule large arrays. 2015-07-23 16:31:23 -04:00
Robert Maynard
48e0af32b7 Merge branch 'fix-64bit-and-doubles' into 'master'
Fix 64bit and doubles

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.

See merge request !99
2015-07-23 11:19:53 -04:00
Robert Maynard
98d6e99275 Correct some warnings about 64bit to 32bit conversion. 2015-07-23 09:29:10 -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
2bcb70b1f6 Merge branch 'update_find_boostheaders' into 'master'
Update FindBoostHeaders to include boost 1.57 and 1.58

See merge request !97
2015-07-23 08:31:07 -04:00
Kenneth Moreland
68bfc59c90 Merge branch 'vec-min-max' into 'master'
Component Min/Max for Vec classes

Changes the <code>vtkm::Min</code> and <code>vtkm::Max</code> methods in Math.h to correctly handle <code>vtkm::Vec</code> and similar classes by doing a per component operation.

See merge request !96
2015-07-22 15:31:33 -04:00
Robert Maynard
4ee084487b Update FindBoostHeaders to include boost 1.57 and 1.58 2015-07-22 14:59:26 -04:00
Sujin Philip
c7d3d0df5c Merge branch 'add-compute-bounds' into 'master'
Add compute bounds to Fields

See merge request !88
2015-07-22 14:26:48 -04:00
Kenneth Moreland
13023792c4 Add component-wise Min/Max methods for Vec classes. 2015-07-22 13:27:44 -04:00
Sujin Philip
91b191bf83 Add compute bounds to Fields 2015-07-22 12:17:33 -04:00
Kenneth Moreland
d9607dac6e Update Math.h.in comments to match Math.h. 2015-07-22 11:51:14 -04:00
Robert Maynard
0aba1b080e Merge branch 'reduce_dynamic_handle_compilation_size' into 'master'
Remove the usage of enable_if as return type to reduce binary size.

Using enable_if/disable_if as a return type has a negative impact on
binary size compared to use a boost::true/false_type as a method parameter.

For comparison the WorkletTests_TBB sees a 6-7% reduction in binary size when
compiled with O3.

Origin WorkletTests_TBB size details:
__TEXT  __DATA  __OBJC  others  dec hex
2363392 49152 0 4297793536  4300206080  1004ff000

Updated WorkletTests_TBB size details:
__TEXT  __DATA  __OBJC  others  dec hex
2215936 49152 0 4297568256  4299833344  1004a4000

See merge request !90
2015-07-22 08:30:56 -04:00
Robert Maynard
4156130ee8 Remove the usage of enable_if from method signatures to reduce binary size.
Using enable_if/disable_if as a return type has a negative impact on
binary size compared to use a boost::true/false_type as a method parameter.

For comparison the WorkletTests_TBB sees a 6-7% reduction in binary size when
compiled with O3.

Origin WorkletTests_TBB size details:
__TEXT  __DATA  __OBJC  others  dec hex
2363392 49152 0 4297793536  4300206080  1004ff000

Updated WorkletTests_TBB size details:
__TEXT  __DATA  __OBJC  others  dec hex
2215936 49152 0 4297568256  4299833344  1004a4000
2015-07-21 15:05:02 -04:00
Robert Maynard
c4bd3bbc27 Merge branch 'remove_unneeded_typedef' into 'master'
Remove unneeded typedef.

See merge request !92
2015-07-21 07:55:33 -04:00
Robert Maynard
b3f741488a Merge branch 'shorten_paths_for_windows' into 'master'
Reduce the length of generated TestBuild files.

VisualStudio 2010 has issues with files with extremely long names, and CMake
will generate warnings when it detects problematic files.

See merge request !93
2015-07-21 07:34:30 -04:00
Robert Maynard
026ba0daa0 Reduce the length of generated TestBuild files.
VisualStudio 2010 has issues with files with extremely long names, and CMake
will generate warnings when it detects problematic files.
2015-07-20 15:43:19 -04:00
Robert Maynard
b2db2e79a2 Remove unneeded typedef. 2015-07-20 15:02:52 -04:00
Robert Maynard
780f3fea29 Merge branch 'correct_cuda_scheduling_over_8m' into 'master'
Correct cuda scheduling over 8m

See merge request !91
2015-07-20 15:01:05 -04:00
Robert Maynard
9f16669e3c Increase the robustness of 3d scheduling when X dim is very small. 2015-07-20 13:27:58 -04:00
Robert Maynard
7a21a08c46 Handle 1D scheduling with over 65k blocks on SM2.X arch.
The initial implementation forgot about the fact that SM2.X architectures
can only handle 65k blocks. Now we gracefully handle when compiling for
SM2.X.
2015-07-20 13:26:16 -04:00
Sujin Philip
6e16591ca3 Merge branch 'add-doxygen-support' into 'master'
Initial support for generating documentation using Doxygen

See merge request !89
2015-07-20 11:42:30 -04:00
Robert Maynard
aea1a9e129 Merge branch 'correct_cuda_errors_osx_nvcc65' into 'master'
Correct issues compiling on OSX 10.8 with CUDA 6.5

Removed the MultiParam test as we have PointElevation which does the exact
same thing.

See merge request !87
2015-07-20 08:38:17 -04:00
Sujin Philip
1a9e8d1e3d Initial support for generating documentation using Doxygen 2015-07-17 15:35:59 -04:00
Robert Maynard
69eb4bb46b Correct issues compiling on OSX 10.8 with CUDA 6.5
Removed the MultiParam test as we have PointElevation which does the exact
same thing.
2015-07-16 14:38:56 -04:00
Robert Maynard
74377ecc92 Merge branch 'simplify_cuda_iterator_detection' into 'master'
Simplify cuda iterator detection

See merge request !83
2015-07-16 14:19:59 -04:00
Robert Maynard
bde08f77cf Merge branch 'refactor_cmake_macros' into 'master'
Refactor cmake macros

See merge request !86
2015-07-16 13:20:55 -04:00
Robert Maynard
cc94027c4b Correct logic bug in setting the NVCC flags inside a function. 2015-07-16 10:19:34 -04:00
Robert Maynard
a4be794a33 More refactoring to simplify the msvc exceptions in VTKmMacros. 2015-07-15 15:52:54 -04:00
Robert Maynard
7bab948682 Refactor common nvcc flag code to only exist in a single place. 2015-07-15 15:45:05 -04:00