Commit Graph

27 Commits

Author SHA1 Message Date
Kenneth Moreland
6ebc3ea761 Fix potential warning in AverageByKey
To get the average, we (of course) divide the sum by the amount of
values, which is returned from valuesIn.GetNumberOfComponents(). To do
this, we need to cast the number of components (returned as a
vtkm::IdComponent) to a FieldType. This is a little more complex than it
first seems because FieldType might be a Vec type. If you just try a
static_cast<FieldType>(), it will use the constructor to FieldType which
might be a Vec constructor expecting the type of the component. This in
turn could cause a warning because the vtkm::IdComponent is implicitly
converted to the Vec's component type.

Get around this problem by first casting to the component type of the
field and then constructing a field value from that.
2018-11-27 09:31:23 -07:00
Matthew Letter
cb03238804 removed device from run function for AverageByKey
I also cleaned up the unit test to no longer pass the device
2018-10-24 10:28:12 -06:00
Kenneth Moreland
d879188de0 Make DispatcherBase invoke using a TryExecute
Rather than force all dispatchers to be templated on a device adapter,
instead use a TryExecute internally within the invoke to select a device
adapter.

Because this removes the need to declare a device when invoking a
worklet, this commit also removes the need to declare a device in
several other areas of the code.
2018-08-29 19:18:54 -07:00
Allison Vacanti
93506d25e2 Change function signatures to use 'using' aliases.
Also cleaned up some lingering type typedefs.
2018-05-25 17:18:41 -04:00
Robert Maynard
e630ac5aa4 Merge branch 'master' into vtk-m-cmake_refactor 2018-02-23 14:52:00 -05:00
Robert Maynard
182f4707e7 vtkm prefers 'using' over typedef. 2018-02-23 10:47:20 -05:00
Robert Maynard
75b0efccc9 Correct casting warnings found with new cmake code 2018-01-08 14:00:58 -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
Kenneth Moreland
b12a20a599 Fix issue where auto type was not resolving template parameters
Portal reference objects automatically cast to their value, but
that does not necessarily mean that it will cast correctly to
a subclass of that type.
2017-08-29 09:34:32 -07:00
Kenneth Moreland
3471dc27fe Expand usage of AverageByKey
The AverageByKey.h header file had a single function that used the
device adapter algorithm ReduceByKey method to do a simple averaging of
a field. I added a second method that can do an average when given a
vtkm::worklet::Keys object. I expect this to be a common use case as we
implement transforming fields from input to output in many algorithms.
2017-08-24 17:20:21 -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
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
f31d6c2258 Refactor vtkm::Types to be concise and move math helpers out of internal.
I have verified that the optimized assembly for Vec<3> and Vec<4> are consistent
with what we generated before.
2016-10-28 14:57:16 -04:00
Chuck Atkins
f74c0d3c88 Remove type conversion related warnings for GCC 2016-03-17 13:05:38 -04:00
Kenneth Moreland
891182ee19 Add ArrayHandleIndex class.
This is the most common use case for ArrayHandleCounting, and this class
is a bit easier to use and a bit faster.
2015-09-14 22:11:09 -06:00
Sujin Philip
6fde50160b Update VertexClustering to use the new features in vtkm 2015-09-02 16:41:54 -04:00
Robert Maynard
f20b1ea99a Add vtkm/BinaryPredicates header.
Currently includes the following predicates:
  - Equal
  - NotEqual
  - SortLess
  - SortGreater
  - LogicalAnd
  - LogicalOr
2015-08-04 16:55:53 -04:00
Kenneth Moreland
cc8a5d35ec Some fixes to VertexClustering
VertexClustering previously only worked with data of a specific floating
point type (32 bit for point coordinates). Add some templates to accept
either 32 bit or 64 bit floating points for point coordintes and be a
bit more careful about implicit type conversions.

I also made some changes to conform better with the VTK-m coding
standards. The most common changes are using 2 space indentation for all
block levels, capitolizing and using camel case for all class members,
and prefixing "this->" to all use of internal class members.
2015-06-29 15:14:50 -06:00
Jimmy
e234f29148 remove vc_debug 2015-06-25 10:52:02 -04:00
Jimmy
314c1b9da2 remove if 0 blocks in averageByKey 2015-06-25 10:38:34 -04:00
Jimmy
a5a4fb36ad remove internal namespace to expose AverageByKey 2015-06-25 10:37:11 -04:00
Jimmy
03823d96a1 Fix VertexClustering and missing iteratortype in ArrayHandleImplicit.h for CUDA 2015-06-24 16:35:11 -04:00
Jimmy
4220b37135 Finish testing codes for VertexClustering 2015-06-24 14:55:22 -04:00
Chun-Ming Chen
ebd6e43409 Added VertexClustering test 2015-06-24 14:55:22 -04:00
Chun-Ming Chen
4f813ca4c5 Prepare for vertex clustering algorithm 2015-06-24 14:55:21 -04:00