Commit Graph

122 Commits

Author SHA1 Message Date
David C. Lonie
fb2d36be1e Refactor VecRectilinearPointCoordinates.
See #163.
2017-07-07 13:49:35 -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
Robert Maynard
57ab48fe8e Replace occurrences of NULL with nullptr. 2017-05-04 10:50:57 -04:00
Sujin Philip
82d02e46ef Modify ImplicitFunctions to use Virtual Methods 2017-05-01 16:55:59 -04:00
David C. Lonie
77baa8a295 Add test for exceptions thrown across library boundaries. 2017-04-13 15:16:35 -04: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
Patricia Kroll Fasel - 090207
6ac2314796 Add unit test for Box ImplicitFunction 2017-03-30 16:31:38 -06:00
Sujin Philip
8c4bbc39ad Use C++11 =delete keyword 2017-02-24 09:39:22 -05:00
Sujin Philip
a88807fd7e Catch all exceptions by reference 2017-02-23 13:25:01 -05:00
Kenneth Moreland
cd64b69a55 Add Keys class
This class will manage the keys during a reduce-by-key worklet
execution.
2017-01-17 15:53:04 -07:00
Robert Maynard
4a8707189a Fix a unused parameter warning in the UnitTestListTag 2017-01-02 10:39:41 -05:00
Robert Maynard
c27bb01f26 Introduces ListTagUniversal which represents a list of everything.
This makes the FilterTraits design simpler and easier to understand.
2016-12-30 15:44:21 -05:00
Robert Maynard
49c5e8222e vtkm can now find the intersection of two ListTags.
This is the first step in having filters which obey both
the filters field policy and the users applied policy in
field what fields they can run on.
2016-12-29 17:18:29 -05:00
Ben Boeckel
7d09befc9f Merge topic 'vector-gradients'
2e05c1dd Support derivatives of vectors
dd45b568 Vec of Vec fixes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !630
2016-12-09 09:31:48 -05:00
Kenneth Moreland
dd45b5684b Vec of Vec fixes
Fix a couple of places where having a Vec of a Vec (for example
vtkm::Vec<vtkm::Vec<vtkm::Float32, 3>, 3>) did not work as it should.

One major place was in the test_equal function used in the testing
framework. If given a Vec of Vec, it would try to convert the Vec to
Float64 and fail. Now the comparison decends as many levels as need be.

The second place was in TypeTraits::ZeroInitialization() for all Vec
types. Originally it initialized the Vec using the default constructor
of the component type. This works fine when the component type is a
standard type, but if the component type is itself a Vec, then the
default constructor does not actually set any of the sub components.
Solved the issue by using the result of ZeroInitialization for the
component type, which will work for basic types and Vecs and anything
else supported by TypeTraits.
2016-12-05 14:41:33 -07:00
Kenneth Moreland
f53cd748f3 Add VecC and VecCConst structs
These structs behave much like Vec except that they work on a short C
array given to them rather than having the statically sized short array
defined within.

I expect to use this in the short term to help implement cell face
classes, but there are probably many other uses.
2016-12-01 15:04:22 -06:00
Kenneth Moreland
ec5fd17536 Modify test_equal for values close to zero
I noticed the UnitTestTransform3D test failed using the random seed
1480544620. On closer inspection, I found that the issue was with the
comparison of two numbers close to 0. The numbers were just above the
threshold, but their difference was not quite enough to make the ratio
below the threshold.

After reviewing some other floating point comparisons, they seem to be
more forgiving of numbers close to 0. Thus, I changed this comparison to
pass if the difference between the numbers was below the threshold.

Because this makes the comparison a lot more forgiving for small
numbers, I lowered the default threshold by an order of magnitude. So
far it looks like the tests are passing, but we should look out for
occasional failures.
2016-11-30 21:57:15 -06:00
Kenneth Moreland
b3d0e1f99b Move VecFromPortal classes to vtkm package
These Vec-like objects can be generally usable in both the control and
execution environments.
2016-11-22 17:04:55 -07: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
97b3b4ceff Increase tolerance on ACos tests when using ICC.
When the intel compiler has vectorization enabled ( -O2/-O3 ) it converts the
`adjacent/hypotenuse` divide operation into reciprocal (rcpps) and
multiply (mulps) operations. This causes a change in the expected result that
is larger than the default tolerance of test_equal. So to resolve the problem
we increase the tolerance for acos when using icc.
2016-11-10 13:48:19 -05:00
Robert Maynard
c23c91de14 Exclude a specific ACos test on ICC in release mode.
When the intel compiler has vectorization enabled ( -O2/-O3 ) it converts the
`adjacent/hypotenuse` divide operation into reciprocal (rcpps) and
multiply (mulps) operations. This causes a change in the expected result that
is larger than the tolerance of test_equal.
2016-10-28 14:57:16 -04:00
Robert Maynard
0f58d6fc54 Add vtkm/cont/serial directory for the serial backend. 2016-09-28 14:22:53 -04:00
Robert Maynard
7ad88b6e5c Use c++11 variadic templates as storage of ListTags. 2016-09-23 16:39:20 -04:00
Kenneth Moreland
e6686e8be7 Merge branch 'master' into rendering-library 2016-09-09 13:59:15 -06:00
Robert Maynard
c2769b81e6 Move over from boost/random to c++11 random. 2016-09-08 17:10:39 -04:00
Kenneth Moreland
c446f1bc7a Add TextAnnotation to rendering library
Also made the TextAnnotation classes conform better to VTK-m coding
style. Specifically, changed the order of words in subclass names (e.g.
TextAnnotationBillboard instead of BillboardTextAnnotation) and broke
out each subclass into its own header/source files.
2016-09-07 16:47:58 -06:00
Robert Maynard
310f1bc0a5 Correct missing std::time includes that vtkm::Math was hiding. 2016-09-02 14:44:30 -04:00
Robert Maynard
f81c42b9b4 Replace NULL with nullptr where applicable. 2016-09-01 09:38:25 -04:00
Robert Maynard
12810165bb Switch over to c++11 type_traits. 2016-08-31 16:11:26 -04:00
Kenneth Moreland
f8442903d8 Replace TryAllTypes with trying exemplar tests
There were many tests that created code paths for every base and Vec
type that VTK-m supports (up to 4 components). Although this is
admirable, it is also excessive, and our compile times for the tests are
very long.

To shorten compile times, remove the TryAllTypes method. Replace it with
a version of TryTypes that uses a default list of "exemplar" set of
integers, floats, and Vecs.
2016-08-24 16:02:18 -06:00
Kenneth Moreland
dd2edcab6c Add general ability to try execution on multiple devices
There are various reasons why you might want to execute something but
not have a specific device to execute on. To mange this, add a general
function that will try a list of devices in order and attempt to run on
them in order.
2016-08-15 17:16:58 -06:00
T.J. Corona
3463db3b28 Add division operator for Vec/scalar operations. 2016-08-02 14:21:19 -04:00
Kenneth Moreland
45a73baab1 Use degrees instead of radians for rotation transforms
It is more common to use degrees when specifying a transform (thanks to
the classic OpenGL interface). Also, camera specifies the field of view in
degrees, which made rotations inconsistent. This change unifies all that.
2016-06-14 13:52:55 -06:00
Kenneth Moreland
cdeeda67bb Make a shared header of 3D transformations
Affine transformations of homogeneous coordinates using 4x4 matrices are
quite common in visualization. Create a new math header file in the base
vtkm namespace that has common functions for such coordinates.

Much of this implementation was taken from the rendering matrix helpers.
2016-06-09 13:34:29 -06:00
Kenneth Moreland
b5415169e2 Change Field and related methods to use Range and Bounds
First, be more explicit when we mean a range of values in a field or a
spacial bounds. Use the Range and Bounds structs in Field and
CoordinateSystem to make all of this more clear (and reduce a bit of
code as well).
2016-05-29 18:49:36 -06:00
Kenneth Moreland
d75857d0bc Add Bounds struct
This is a simple struct that defines min and max values over X, Y, and Z
to define an axis-aligned bounding box.
2016-05-29 18:49:36 -06:00
Kenneth Moreland
b358fcb19f Add Range struct
This is a simple struct that has a min and max scalar value to represent
a range of scalar values. It also comes with several helper methods.
2016-05-29 18:49:36 -06:00
Kenneth Moreland
b20c4fc8ef Fix test that fails during optimization.
After the most recent changes, I noticed that the matrix unit test
started failing for some optimized compiles. I'm not sure if it was
these changes or others. What I think happened is that it was a check
for a Matrix operation that should be invalid. It checked the valid flag
without checking the data (which, of course, is invalid). However, I
think the optimizer saw that the data generated was never used so
removed that part of the computation so the invalid flag was never set.
Add a condition that uses the result even though it should never be
called to hopefully force the compiler to compute it.
2016-04-21 11:02:45 -06:00
Kenneth Moreland
eede71f918 Merge branch 'fix-vector-analysis-failure' into 'master'
Fix issues with UnitTestVectorAnalysis for MSVC.

We have been having a problem with one of the MSVC dashboards failing
the UnitTestVectorAnalysis test. The test just dies in the middle with
no indication of what problematic thing was run.

After playing with this for quite a while, I found that it could by
triggered exclusively in the Lerp test. I further found that if I
switched the order of the test and check Lerp the test worked. This is
strange behavior and leads me to believe one of the following is going
on:

1. There is an error such as an invalid memory access happening in
the VTK-m code that is sometimes corrupting the stack.
2. Somewhere there is an expression that has undefined behavior. Usually
it works OK, but some optimization sequence causes it to fail.
3. There is a bug in one of the compiler's optimizations.

It concerns me that I cannot identify exactly where the problem lies.
I've looked very hard at the vtkm::Vec and vtkm::Lerp code to try to find
possible problems, but I have not been able to find anything.

See merge request !399
2016-04-20 12:05:31 -04:00
Kenneth Moreland
7e1b9b8886 Fix issues with UnitTestVectorAnalysis for MSVC.
We have been having a problem with one of the MSVC dashboards failing
the UnitTestVectorAnalysis test. The test just dies in the middle with
no indication of what problematic thing was run.

After playing with this for quite a while, I found that it could by
triggered exclusively in the Lerp test. I further found that if I
switched the order of the test and check Lerp the test worked. This is
strange behavior and leads me to believe one of the following is going
on:

1. There is an error such as an invalid memory access happening in
the VTK-m code that is sometimes corrupting the stack.
2. Somewhere there is an expression that has undefined behavior. Usually
it works OK, but some optimization sequence causes it to fail.
3. There is a bug in one of the compiler's optimizations.

It concerns me that I cannot identify exactly where the problem lies.
I've looked very hard at the vtkm::Vec and vtkm::Lerp code to try to find
possible problems, but I have not been able to find anything.
2016-04-19 14:39:16 -06:00
Kenneth Moreland
c503e0ce8a Move NewtonsMethod to the vtkm package
All the other math functions are in the vtkm package. This one was in
vtkm::exec because it uses a callback method. This can be problematic on
CUDA the the declaration of NewtonsMethod does not match the callback
method. However, we now have a VTKM_SUPPRESS_EXEC_WARNINGS macro that
allows a VTKM_EXEC_CONT_EXPORT function (like NewtonsMethod) to call
either a VTKM_EXEC_EXPORT or VTKM_CONT_EXPORT without a warning.
2016-04-14 14:36:02 -06: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
Chuck Atkins
f74c0d3c88 Remove type conversion related warnings for GCC 2016-03-17 13:05:38 -04:00
Robert Maynard
0642478668 Correct implicit function test failures when vectorization is enabled.
When vectorization is enabled we start using 'fast' math, and therefore instead
of getting perfect 0.0 values we get values that are extremely close to zero.
2016-03-14 15:56:27 -04:00
Kenneth Moreland
e6a9c96c96 Adding ScatterCounting 2015-11-06 18:05:20 -07:00
Sujin Philip
5ea70b6ddd Add implicit functions 2015-10-08 09:32:14 -04:00
Kenneth Moreland
fcfe63ef85 Fix unnecessary warning about divide by zero.
Again. Hopefully I got it right this time.
2015-09-24 21:52:58 -06:00
Kenneth Moreland
fa0c695424 Fix issue with test_equal of 0 numbers
There was an error in the test_equal comparison that would return true
when the second value was 0 (or close to 0) and the first value was not.

This was a bug I introduced with commit
b270438fea8a9fe4200322bfe6344ab2075c4d9a. I clearly misinterpreted how a
conditional worked.
2015-09-24 16:48:03 -06:00