Commit Graph

28 Commits

Author SHA1 Message Date
Kenneth Moreland
a771359d72 Remove brigand from FunctionInterface
Replace with features in `vtkm::List`.
2022-03-08 07:25:08 -07:00
Robert Maynard
daa6b0984b Another round of simplifications to FunctionInterface
Yet more ways that we can reduce the complexity of `FunctionInterface`.
This is another step in figuring out what set of features the replacement
for `FunctionInterface` needs to have.
2019-12-04 14:02:44 -05:00
Robert Maynard
d6d40c90d7 Simplify FunctionInterface
This includes removing Exec, and Cont methods that VTK-m is no longer
using. Also we simplify the used methods as much as possible.
2019-12-02 09:33:35 -05:00
Robert Maynard
0f31c69f32 Remove unnecessary constructor from ParameterContainer 2019-04-24 10:12:43 -04:00
nadavi
fbcea82e78 conslidate the license statement 2019-04-17 10:57:13 -06:00
Kenneth Moreland
e43770a376 Update pyexpander input files to work with python 3
Python 3 does not use xrange anymore. Use the range function instead.
2019-04-04 11:20:56 -06:00
Robert Maynard
c631dccfcb Invocation parameters are now non const and can be 'modified'
The invocation parameters need to be non const as we want to
be able to call non-const methods like `PrepareForOutput` on them
from a transport function.

The original implementation abused the fact that everything
could be copied by value and have that work properly. But
when we start introducing virtual classes copying by value of
a base type can cause type slicing.
2018-07-06 14:27:36 -04: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
ee69c7a4b7 Remove VS2013 workarounds from VTK-m. 2018-02-23 15:39:39 -05:00
Matthew Letter
c3737c728e Merge branch 'master' into increase-worklet-arguments 2018-01-04 12:07:38 -07:00
Matthew Letter
d9c51d650d increased the number of arguments to worklets
increase the number of arguments to worklets that we support to 10 from 20.
2018-01-04 12:06:16 -07:00
Robert Maynard
93bc0198fe Suppress false positive warnings about calling host device functions. 2018-01-02 10:40:49 -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
David C. Lonie
6a6e55b534 Fix warning on gcc 7.1.1.
Implicit cast from size_t to int was triggering a couple thousand
warnings on the new GCC.
2017-07-12 15:35:12 -04:00
Kenneth Moreland
731bb64a0b Make .in files match new formatting
More corrections for the autoformatter and .in files.
2017-05-31 09:37:29 -06:00
Robert Maynard
94bd79b09c Leverage std::move to help FunctionInterface make less copies. 2017-02-14 17:02:32 -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
a931b8e295 FunctionInterface and DispatcherBase don't require boost now. 2016-09-23 16:39:20 -04:00
Kenneth Moreland
eb8ca27932 VTKM_SUPPRESS_EXEC_WARNINGS was in the wrong place
The VTKM_SUPPRESS_EXEC_WARNINGS should go before the template keyword,
but on a couple of methods in FunctionInterfaceDetailPre.h.in it was
after the template keyword.
2016-06-27 13:08:35 -06:00
Robert Maynard
08b888f703 Improve the compile speed and binary output by tweaking FunctionInterface. 2016-05-04 14:48:42 -04:00
Robert Maynard
c1560e2d3f Perform less unnecessary copies when deducing a worklets parameters.
One of the causes of the large library size and slow compile times has been
that vtkm has been creating unnecessary copies when not needed. When the
objects being copied use shared_ptr this causes a bloom in library size. I
presume this bloom is caused by the atomic increment/decrement that is
required by shared_ptr.

For testing I used the following example:
```
struct ExampleFieldWorklet : public vtkm::worklet::WorkletMapField
{
  typedef void ControlSignature( FieldIn<>, FieldIn<>, FieldIn<>,
                                 FieldOut<>, FieldOut<>, FieldOut<> );
  typedef void ExecutionSignature( _1, _2, _3, _4, _5, _6 );

  template<typename T, typename U, typename V>
  VTKM_EXEC_EXPORT
  void operator()( const vtkm::Vec< T, 3 > & vec,
                   const U & scalar1,
                   const V& scalar2,
                   vtkm::Vec<T, 3>& out_vec,
                   U& out_scalar1,
                   V& out_scalar2 ) const
  {
    out_vec = vec * scalar1;
    out_scalar1 = scalar1 + scalar2;
    out_scalar2 = scalar2;
  }

  template<typename T, typename U, typename V, typename W, typename X, typename Y>
  VTKM_EXEC_EXPORT
  void operator()( const T & vec,
                   const U & scalar1,
                   const V& scalar2,
                   W& out_vec,
                   X& out_scalar,
                   Y& ) const
  {
  //no-op
  }
};

int main(int argc, char** argv)
{
  std::vector< vtkm::Vec<vtkm::Float32, 3> > inputVec;
  std::vector< vtkm::Int32 > inputScalar1;
  std::vector< vtkm::Float64 > inputScalar2;

  vtkm::cont::ArrayHandle< vtkm::Vec<vtkm::Float32, 3> > handleV =
    vtkm::cont::make_ArrayHandle(inputVec);

  vtkm::cont::ArrayHandle< vtkm::Vec<vtkm::Float32, 3> > handleS1 =
    vtkm::cont::make_ArrayHandle(inputVec);

  vtkm::cont::ArrayHandle< vtkm::Vec<vtkm::Float32, 3> > handleS2 =
    vtkm::cont::make_ArrayHandle(inputVec);

  vtkm::cont::ArrayHandle< vtkm::Vec<vtkm::Float32, 3> > handleOV;
  vtkm::cont::ArrayHandle< vtkm::Vec<vtkm::Float32, 3> > handleOS1;
  vtkm::cont::ArrayHandle< vtkm::Vec<vtkm::Float32, 3> > handleOS2;

  std::cout << "Making 3 output DynamicArrayHandles " << std::endl;
  vtkm::cont::DynamicArrayHandle out1(handleOV), out2(handleOS1), out3(handleOS2);

  typedef vtkm::worklet::DispatcherMapField<ExampleFieldWorklet> DispatcherType;

  std::cout << "Invoking ExampleFieldWorklet" << std::endl;
  DispatcherType dispatcher;

  dispatcher.Invoke(handleV, handleS1, handleS2, out1, out2, out3);

}
```

Original vtkm would generate a binary of size 4684kb and would perform 91
ArrayHandle copies or assignments. With this branch the binary size is
reduced to 2392kb and will perform 36 copies or assignments.
2016-01-19 09:20:49 -05:00
Robert Maynard
778d670ed3 FunctionInterface suppresses warnings on calling host function from host/device 2015-09-21 15:26:28 -04: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
37dac92052 Add index tags to FunctionInterface features.
The functors in the ForEach, StaticTransform, and DynamicTransform
methods sometimes can use the index of the parameter that they are
operating on. This can be a helpful diagnostic in compile and run-time
errors. It is also helpful when linking parameters from one
FunctionInterface with those of another.

This new features are now replacing implementations using the Zip
functionality that was removed earlier. The implementation is actually
simplified a bit.
2015-01-15 22:13:47 -07:00
Kenneth Moreland
ddf630da1c Fix wrapper macros around FunctionInterface header files
The header wrapper macros in all the FunctionInterface header files
declared the function interface to be in the cont package, which is
wrong.
2014-10-08 10:07:08 -06:00
Kenneth Moreland
5fb7f63829 Replace Boost preprocessor iteration with macro expansion tool
This commit removes the usage of the boost preprocessor library to
iteratively generate templates with a variable number of parameters. It
is replaced with a template that is expanded by running it through the
pyexpander macro processing tool (http://pyexpander.sourceforge.net).

One reason for this change is to make the code easier to read. In
particular, it is difficult to understand compiler errors when they
occur deep within an iterating macro. Another reason for this change is
that the Intel compiler currently has a bug that breaks with the boost
preprocessor library.

One issue with this approach is that the macro expansion is not part of
the build process. Although open, pyexpander is not a tool most
developers will have readily installed on their system. Thus, if you
want to make changes to any of the macro code, you have to make sure
pyexpander is installed, then make changes to the input files, then
manually run pyexpander from the command line.
2014-06-25 16:03:44 -06:00