Commit Graph

31 Commits

Author SHA1 Message Date
Kitware Robot
cf0cdcf7d1 clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
Robert Maynard
a652f7fe1e Update vtk-m doxygen to generate less warnings 2020-06-01 16:58:32 -04:00
Robert Maynard
99cbbf2ff2 Correct a regression in ArrayHandleDecorator with VisualStudio 2017 2019-09-19 18:35:20 -04:00
Robert Maynard
e93ce607fa Increase VecTraits GCC workaround to be for all GCC 4 and 5 versions 2019-09-19 11:54:44 -04:00
Kenneth Moreland
785f7994c7 Fix VecTraits internal compile errors with GCC 4.8
GCC 4.8 seems to have issues with the templated using statements
in VecTraits. Hopefully this change works around that problem.
2019-09-12 18:12:02 -06:00
Kenneth Moreland
6323d6803e Add recursive component queries to VecTraits
Added a BaseComponentType to VecTraits that recursively finds the base
(non-Vec) type of a Vec. This is useful when dealing with potentially
nested Vec's (e.g. Vec<Vec<T, M>, N>) and you need to keep the structure
but know the base type.

Also added a couple of templates for keeping the structure but changing
the type. These are ReplaceComponentType and ReplaceBaseComponentType.
These allow you to create new Vec's with the same structure as the query
Vec but with differen component types.
2019-09-09 08:19:15 -06:00
Kenneth Moreland
918766e7ab Fix VS 2015 compile issue with HasVecTraits
Apparently, the Visual Studio 2015 has a bug where the result of a
decltype might not be considered a type. Attempt to get around this
problem by putting the decltype inside of a struct and then have the
using statement use the typename keyword. Hopefully if you literally say
that something is a typename, the compiler will treat it like a type
name.
2019-08-20 12:09:55 -06:00
Kenneth Moreland
053d5a0591 Add HasVecTraits
HasVecTraits<T> is a template that will resolve to std::true_type if
VecTraits<T> is properly defined and std::false_type otherwise. This is
helpful when defining classes and methods that use VecTraits but you
still want them to compile if VecTraits does not exist.
2019-06-06 15:28:47 -06:00
nadavi
fbcea82e78 conslidate the license statement 2019-04-17 10:57:13 -06:00
Robert Maynard
f5d23396b6 Add bool to supported types for VecTraits 2018-08-06 13:10:05 -04:00
Robert Maynard
7c54125b66 Switch over from static const to static constexpr where possible. 2018-03-10 11:39:58 -05:00
luz.paz
80b11afa24 Misc. typos
Found via `codespell -q 3` via downstream VTK
2018-01-30 06:51:47 -05:00
Kenneth Moreland
c3a3184d51 Update copyright for Sandia
Sandia National Laboratories recently changed management from the
Sandia Corporation to the National Technology & Engineering Solutions
of Sandia, LLC (NTESS). The copyright statements need to be updated
accordingly.
2017-09-20 15:33:44 -06:00
Robert Maynard
b85cdd9080 Convert VTK-m over to use 'using' instead of 'typedef' 2017-08-07 14:05:43 -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
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
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
12810165bb Switch over to c++11 type_traits. 2016-08-31 16:11:26 -04:00
Kenneth Moreland
bcc5987858 Add missing export macro to VecTraits.
The VTKM_EXEC_CONT_EXPORT macro was missing from the
GetNumberOfComponents method in the VecTraits class for base C types.
2016-05-29 10:22:30 -06:00
Robert Maynard
4a7085f415 Update VecTraits/TypeTraits to include types that VTK uses. 2016-02-22 14:20:25 -05:00
Kenneth Moreland
77568789ea Make vtkm::Pair behave as a better core type
These changes are basically to support some upcoming changes to
ArrayHandleZip. The major additions are an implementation of VecTraits
for Pair and an overloaded << operator to ostream for Pair.

I also had to declare the operator<< for Pair to be in Types.h. Under
some circumstances the operator has to either be declared before the
template is declared or declared in the vtkm namespace. (The reasons are
described at <http://clang.llvm.org/compatibility.html#dep_lookup> but I
still don't understand.) I tried adding it to the vtkm namespace, but
that caused several of the other operator<< to fail. Since there is no
way to guarantee that Pair.h is declared before, say, ArrayHandle.h, I
moved the implementation to Types.h.

Since I was moving operator<< to Types.h, I went ahead and moved the
TypeTraits and VecTraits to their respective headers. Since Pair is
declared (but not implemented) in Types.h, these templated classes can
be implemented without including Pair.h.
2015-09-20 00:01:04 -06:00
Kenneth Moreland
5a896c6ce7 Add tests for interpolate functions.
Also tests the current parametric coordinates methods. The added test
lead to some minor corrections and additions.
2015-08-27 16:31:06 -06:00
Kenneth Moreland
c9d95298b0 Added VecFromPortal class. 2015-08-14 09:15:47 -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
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
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
Kenneth Moreland
c3fbe073e8 Change VectorTraits to VecTraits.
Matches the previous move from Tuple to Vec. We can unify on this name.
2014-10-08 10:09:43 -06:00