Commit Graph

78 Commits

Author SHA1 Message Date
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
Kenneth Moreland
493656e419 Special implementation of parametric coordinates for rectilinear cells 2015-09-02 13:50:31 -07:00
Kenneth Moreland
429f9c0cb7 Add VecRectilinearPointCoordinates class
This class implicitly stores the point coordinates for a rectilinear
cell (such as a voxel) with just the location of the lower left point
and the spacing in each dimension. In addition to saving space, this
class should allow cell-specific functions to specialize for faster
processing.
2015-09-02 13:50:31 -07:00
Kenneth Moreland
688eafe5f8 Tests catch STL exceptions and report on their names. 2015-08-28 12:19:46 -06:00
Kenneth Moreland
827b58a8f2 Merge branch 'shape-specific-functions' into 'master'
Shape specific functions

These changes support creating methods that are specific to cell shape in worklets (issue #27).

See merge request !149
2015-08-28 13:21:21 -04:00
Kenneth Moreland
c81bc3d501 Add CellShapeTag classes
Each cell shape id has an associated cell shape tag. There is also a
macro to write functions that are conditional on the cell shape.
2015-08-27 16:30:58 -06:00
Kenneth Moreland
9cd8cb22eb Make PrintSummary actually work for Field and CoordinateSystem.
The PrintSummary for CoordinateSystem went in an infinite loop. It was
supposed to call PrintSummary of its superclass (Field), but instead it
called itself.

The PrintSummary for Field only worked for fields of type vtkm::Float32.
To make it work for all array types, I added a PrintSummary method to
DynamicArrayHandle, and Field calls that without trying to cast to a
static type.
2015-08-27 10:20:30 -06:00
Kenneth Moreland
cf6af174eb Merge branch 'variable-topology-fields' into 'master'
Variable topology fields

Changes to fetching in topology maps that lets you properly deal with cases where you do not know how many values are being fetched at compile time. For example, explicit cell sets can have any number of cell shapes that have different numbers of nodes.

This change should resolve issue #26.

See merge request !128
2015-08-19 11:27:43 -04:00
Kenneth Moreland
616c179a12 Fix NaN check that was optimized away.
The PGI compiler appearently saw the condition (var != var) and optimized
it to always be false. However, in this particular case var was holding
a NaN value that we were testing to make sure it does not equal itself.
Get around the problem by comparing the variable to the result of a
function call.
2015-08-17 07:35:39 -06:00
Kenneth Moreland
da2e601b6a Add VecVariable
This class holds a Vec and exposes some number of components. The class
is used when you need a Vec of a size that is not known at compile time
but that a maximum length of reasonable size is known.
2015-08-14 09:15:46 -06:00
Kenneth Moreland
5c3646af70 Changes to Vec/VecTraits for Vec-like objects.
Some changes to the Vec class and VecTraits in anticipation of creating
Vec-like objects. The following changes are made:

* Add GetNumberOfComponents to Vec, which returns NUM_COMPONENTS.

* Likewise, all VecTraits have a GetNumberOfComponents method.

* The ToVec method in VecTraits is changed to CopyInto so that it can be
used when the length of the Vec-like is not known. CopyInto is also
added to Vec.

* VecTraits has a typedef named IsSizeStatic which is set to
VecTraitsTagSizeStatic when the number of components is known at compile
time and VecTraitsTagSizeVariable when the number of components is not
known until runtime.
2015-08-14 09:15:46 -06: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
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
0b4cb9c2c6 Add UnitTest for BinaryOperators. 2015-08-04 16:55:53 -04:00
Robert Maynard
f96a02adcb Add UnitTest for BinaryPredicates. 2015-08-04 16:55:53 -04:00
Robert Maynard
7bf0e41844 Add UnitTest for UnaryPredicates. 2015-08-04 16:55:53 -04:00
Kenneth Moreland
04fce28ae3 Deal with small integer promotions
C and C++ has a funny feature where operations on small integers (char
and short) actually promote the result to a 32 bit integer. Most often
in our code the result is pushed back to the same type, and picky compilers
can then give a warning about an implicit type conversion (that we
inevitably don't care about). Here are a lot of changes to suppress
the warnings.
2015-07-30 17:41:58 -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
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
13023792c4 Add component-wise Min/Max methods for Vec classes. 2015-07-22 13:27:44 -04:00
Kenneth Moreland
79960e8383 Merge branch 'vector-analysis' into 'master'
Vector Analysis

Add basic vector analysis methods.

See merge request !73
2015-07-07 17:38:48 -04:00
Kenneth Moreland
3350c0da38 Add basic vector analysis methods. 2015-07-07 14:25:58 -06:00
Kenneth Moreland
fd1a36dce7 Remove cast warnings in UnitTestMatrix.
Unlike most compilers, MSVC will give conversion warnings when
implicitly converting a 32-bit int to a 32-bit float because the
mantissa can potentially drop some of the lower order bits of large
ints. Use static casts to (hopefully) remove the warnings.
2015-07-07 09:54:19 -06:00
Kenneth Moreland
1c2f33926b Use test_equal for comparisons in UnitTestMatrix.
Some compilers, particularly icc, do strange things to literals during
optimization that makes them slightly different. This change was originally
to fix a testing issue with the icc build. It is not actually fixing the
problem, but I am leaving in the change because it is good practice.
2015-07-06 12:23:33 -06:00
Kenneth Moreland
abcc6da52f Add Matrix class.
The matrix class is for thread-local matrix computations. It is intended
to store things like tensors or geometric transforms.
2015-07-02 11:20:21 -06:00
Kenneth Moreland
0b6d351a49 Enable the Vec negate operator only if the component is negatable.
Robert Maynard pointed out that the unary operator- I added to Vec could
lead to undesirable behavior for vectors of unsigned integer types. This
changed makes the definition of operator- conditional on the component
type being either a signed integer or a float type.

I also added some more actual testing of the new operator.
2015-06-30 14:55:16 -06:00
Kenneth Moreland
b5398babc5 Remove overloads for scalar to Vec multiplications
Previously, the templated Vec classes had overloaded multiply operators
to allow it to be multiplied by any basic type (float, double, int,
long, char, etc.). This was there to make it easier to multiply a vector
by a scalar without having to jump through introspection hoops for the
component types. However, using them almost always resulted in a
conversion warning on some type of compiler, so I think it is easier
just to remove them.
2015-06-30 09:23:18 -06:00
Kenneth Moreland
4a8d69ca66 Add CUDA math test
Also fix some issues that caused the compile to fail when trying to
run some of the math functions on a CUDA device. In particular, CUDA
is picky about using a global const on a device when the const type is
not one of the basic C types.
2015-06-25 13:54:24 -06:00
Kenneth Moreland
787feacf1e Change math test to run in execution environment
This change is to do the test on a CUDA device.
2015-06-25 12:07:15 -06:00
Kenneth Moreland
b642338465 Fix copyright statement in UnitTestMath.cxx. 2015-06-24 16:31:57 -06:00
Kenneth Moreland
7e2feb7e52 Add trig functions to math. 2015-06-24 16:27:07 -06:00
Kenneth Moreland
c7ad5207a3 Add sign-based math functions. 2015-06-24 15:40:18 -06:00
Kenneth Moreland
94744dc7fb Add precision functions to math. 2015-06-23 17:35:55 -06:00
Kenneth Moreland
fc9e36cea1 Add min/max functions. 2015-06-22 17:11:23 -06:00
Kenneth Moreland
ddddd4a33b Add exponential functions to math library. 2015-06-22 16:24:18 -06:00
Robert Maynard
e44510eef7 Testing was calling host functions from device+host functions. 2015-06-16 08:27:37 -04:00
Robert Maynard
ff2e03f180 Merge branch 'reduce_with_zip_arrays' into 'master'
Fancy Arrays as input to Device Algorithms

Currently working on the general approach to get ArrayHandleZip/Permutation to be handled by all device adapter algorithms.

See merge request !32
2015-06-12 11:57:09 -04:00
Robert Maynard
0de858bf70 Allow vtkm::Pair to be easily printed in testing code. 2015-06-12 10:08:10 -04:00
Kenneth Moreland
6a2140fe57 Fix a couple of conversion warnings in OptionParser for testing. 2015-06-10 13:58:26 -06:00
Robert Maynard
07970cf476 Correct all signed / unsigned and narrowing warnings ( 64bit to 32bit ). 2015-05-28 09:05:17 -04:00
Robert Maynard
6b8e7822be The Copyright statement now has all the periods in the correct location. 2015-05-21 10:30:11 -04:00
Kenneth Moreland
66aa10aab7 Fix issues with warnings about data loss from type conversion
Fix compile warnings that come up with the flags

  -Wconversion -Wno-sign-conversion

This catches several instances (mostly in the testing framework) where
types are implicitly converted. I expect these changes to fix some of
the warnings we are seeing in MSVC.

I was going to add these flags to the list of extra warning flags, but
unfortunately the Thrust library has several warnings of these types,
and I don't know a good way to turn on the warnings for our code but
turn them off for Thrust.
2015-05-07 16:34:06 -06:00
Robert Maynard
c2f2c166c0 Test all Fancy ArrayHandles and Array Portals on every device adapter.
Fancy array handles being Counting, Implicit, Permutation, Transform, and Zip.
2015-05-05 14:25:48 -04:00
Robert Maynard
519509bba1 Update the documentation to note have references to dax. 2014-12-10 10:37:25 -05:00
Kenneth Moreland
f4fb9f0ace Merge branch 'new-list-features' into distpach 2014-10-22 15:21:48 -06:00