Commit Graph

33 Commits

Author SHA1 Message Date
Robert Maynard
b85cdd9080 Convert VTK-m over to use 'using' instead of 'typedef' 2017-08-07 14:05:43 -04:00
Kenneth Moreland
071c792148 Merge topic 'indent-generated'
b03a61da Make .in files match new formatting

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !784
2017-05-28 10:28:54 -04:00
Kenneth Moreland
b03a61da5d Make .in files match new formatting
The automatic formatter formatted the result of the .in files, but not
the .in files themselves. This caused the .in file check to fail.
2017-05-27 09:46:32 -06: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
Thomas J. Otahal
f1300c6143 Changed vtkm::Abs() to return input type 2017-02-06 15:50:13 -07:00
Thomas J. Otahal
71b2348dd9 Adjusted Math.h.in for const vtkm::Float32 function inputs 2017-02-06 12:18:13 -07:00
Thomas J. Otahal
7d6601d794 Modified Math.h.in and VectorAnalysis.h to support integral types.
Unary operations on scalars and vectors will return vtkm::Float64 for
integral input types and vtkm::Float64 input types. Unary operations will
return vtkm::Float32 for vtkm::Float32 input vectors and scalars.
2017-01-26 13:30:28 -07:00
Thomas J. Otahal
cd95cbe90b Modified Math.h.in instead of Math.h
Changed return types for all scalar and vector unary math operations
to return vtkm::FloatDefault instead of input type. vtkm::Float64 will
be returned when the input is vtkm::Float64.
2017-01-24 14:47:51 -07:00
Thomas J. Otahal
556b922733 Created a filter for the vector magnitude worklet.
Modified the vector magnitude worklet to accept VecAll instead
of Vec3 and return Scalar. Modified the Magnitude() and Sqrt() functions
to return FloatDefault for all inputs except for Float64.

Perhaps we should modify other functions in Math.h and VectorAnalysis.h to
return float types for intergral arguments instead of integral types?
2017-01-19 13:27:42 -07:00
Kenneth Moreland
c9e146a2a1 Make literals for bits unsigned
Literals that are used to represent the bits of certain floating point
numbers (e.g. VTKM_NAN_BITS_64) are placed into unsigned integers before
converted to floating points. We ran into an example where the compiler
complained that a literal (specifically VTKM_NEG_INF_BITS_64) was
declared signed and was negative but then placed in an unsigned (64-bit)
integer. This should fix the problem by making the literal itself
unsigned.
2016-12-16 08:47:18 -07:00
Kenneth Moreland
fda3ec71c5 Don't call std functions in math nonfinte functions for CUDA
The math nonfinite check functions (like IsNan) were calling the std
equivalent function. This is fine for most architectures, but is not
available for devices under CUDA. Instead, call the CUDA version of
these functions when compiling with CUDA.

This fixes an issue that became apparent once we added CUDA error code
checking.
2016-12-15 10:40:17 -07:00
Robert Maynard
213188b2c3 Properly use CUDA signbit functions. 2016-11-30 15:36:51 -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
b4378c8546 Allow vtkm::Matrix to support T values which are vtkm::Vec. 2016-11-15 18:54:53 -05:00
Robert Maynard
801473bc58 vtkm::Math now doesn't require boost 2016-09-02 13:32:26 -04:00
Kenneth Moreland
5d829f2142 Use std::Min/Max over fmin/fmax
We had a report that vtkm::Min/Max was significantly slower than other
products. This was traced back to the fact that these functions were not
completely inlining because they were calling fmin or fmax, and that
resulted in an actual C library call. It turns out using the templated
functions in the std namespace is faster.

This change has the VTK-m min/max functions use the std version in
almost all circumstances. The one exception (so far) is that fmin and
fmax are used for CUDA devices since the std functions are not declared
to run on the device and the nvcc compiler treats these functions
special.
2015-12-07 09:26:27 -07:00
Kenneth Moreland
9749e57838 Fix pyexpander errors
There was some inconsistencies between the input and output files for
pyexpander checked into the repository. This just makes them consistent.
2015-09-02 13:47:33 -07: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
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
13023792c4 Add component-wise Min/Max methods for Vec classes. 2015-07-22 13:27:44 -04:00
Sujin Philip
1a9e8d1e3d Initial support for generating documentation using Doxygen 2015-07-17 15:35:59 -04: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
f426b16daf Fix an issue where the remainder function not well supported on MSVC
Also fix a minor conversion warning.
2015-06-30 08:50:02 -06:00
Kenneth Moreland
3ab8288dc7 Fix use of VTKM_MSVC
The VTKM_MSVC is just defined if using MSVC. It is not set to any value.
There was a reference in Math.h that assumed it was set to true, which
it was not. This simple change should fix that.
2015-06-29 09:27:16 -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
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
Kenneth Moreland
b4a4534dbe Introductory pyexpander macros for Math functions 2015-06-22 14:19:10 -06:00