Commit Graph

1263 Commits

Author SHA1 Message Date
Kenneth Moreland
feaed27cb0 Fixes related to changes in how the Dynamic class do casting
A recently merged topic branch changed the methods of how the Dynamic
classes do casting and type checking. The
support_visit_structured_points topic branch was started before these
changes and merged to master afterward. It used an old version of IsType
that did not conflict and caused a compile error. This fixes the compile
error.
2016-01-21 15:27:25 -07:00
Kenneth Moreland
51ef8f470c Merge branch 'static-dataset-builder-methods' into 'master'
Improvements to data set builds

Some improvements to data set builders to make them easier to use. The main changes are making most of the methods static so that the class does not have to be instantiated and to accept DynamicArrayHandle for fields.

See merge request !325
2016-01-21 17:21:59 -05:00
Kenneth Moreland
f9750e83f7 Fix issues with Field constructor overloads
I ran into a few minor issues with the constructors to the Field class.

The big change I made was that I removed the Field constructors that
take an example type and create an empty field of that type. The problem
was that the example type was easily confused with some other type that
was supposed to describe an array. This lead to some odd behavior in the
compiler and resulted in errors in unexpected places.

The use case for this constructor is dubious. There were several tests
in the code that would create an empty field, add it to a data set, then
get it back out to pass to the worklet. The code is much simpler if you
just make an ArrayHandle of the right type and use that in the worklet
invoke directly. It is also faster to compile with smaller code because
the type is known statically (whereas it is lost the other way).

The other change was to declare references to ArrayHandle and
DynamicArrayHandle as const. There is nothing in the behavior that
invalidates the const, and it accepts arrays constructed in the
parameter.
2016-01-21 13:54:05 -07:00
Kenneth Moreland
e066214090 Add methods to DataSetFieldAdd that accept a DynamicArrayHandle 2016-01-21 13:00:41 -07:00
Robert Maynard
27c25bd72f Merge topic 'support_visit_structured_points'
c8c0556d Fixed issues that Sujin found during code review.
33b20a8d All readers now support Fields before data (aka VisIt files).
10d59c17 StructuredPointsReader supports multiple visit fields.
735462f8 Update the io readers to handle visit style structured points files.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Sujin Philip <sujin.philip@kitware.com>
Merge-request: !313
2016-01-21 13:41:02 -05:00
Kenneth Moreland
d626f7317d Make DataSetBuilder methods static
This makes is slightly easier to use as you do not actually have to
construct the DataSetBuilder object but just call its static method.

The DataSetBuilderExplicitIterative methods are not static because they
use state of the builder object to create the data.
2016-01-21 10:45:33 -07:00
Robert Maynard
c8c0556dbb Fixed issues that Sujin found during code review. 2016-01-21 12:44:14 -05:00
Kenneth Moreland
c346d40eb4 Add WorkletMapCellToPoint class
The map topology worklets are to have convenience classes for all the
common mappings. However WorkletMapCellToPoint was left out as an
oversight. This adds the class.
2016-01-20 16:16:58 -07:00
Robert Maynard
33b20a8d18 All readers now support Fields before data (aka VisIt files). 2016-01-20 15:58:41 -05:00
Kenneth Moreland
020c31caf9 Merge branch 'get-cell-dimensions' into 'master'
Add GetCellDimensions to CellSetStructured

There was not an easy way to get the dimensions of cells in a structured
data set. Add a method to get that.

See merge request !323
2016-01-20 14:42:42 -05:00
Robert Maynard
8070586ea7 Merge topic 'less_temporary_copies'
4153c2c7 Found a few more places where we don't need to return by value.
dd85fc13 Document why we certain classes member variables need to be const ref.
6fb86da8 DynamicArrayHandle Casting methods now holds by const * const.
c1560e2d Perform less unnecessary copies when deducing a worklets parameters.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !320
2016-01-20 12:02:57 -05:00
Kenneth Moreland
384727d00e Add GetCellDimensions to CellSetStructured.
There was not an easy way to get the dimensions of cells in a structured
data set. Add a method to get that.
2016-01-20 09:24:31 -07:00
Kenneth Moreland
dec61fe51a Merge branch 'regular-to-uniform' into 'master'
Change Regular to Uniform

There was an inconsistency in naming classes where axes-aligned grids
with even spacing were sometimes called "uniform" and sometimes called
"regular". Maintain consistency by always calling them uniform.

See merge request !322
2016-01-20 11:04:44 -05:00
Kenneth Moreland
9ccd7fa9c7 Change Regular to Uniform
There was an inconsistency in naming classes where axes-aligned grids
with even spacing were sometimes called "uniform" and sometimes called
"regular". Maintain consistency by always calling them uniform.
2016-01-19 15:54:05 -07:00
Robert Maynard
40ecf08948 Merge topic 'cleanup_copy_code_in_datasetbuilder'
2ae3f13a Don't use DeviceAdapter inside DataSetBuilderRectilinear.
8cf9b979 Don't use DeviceAdapter inside DataSetBuilderExplicit.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !319
2016-01-19 17:00:55 -05:00
Robert Maynard
2ae3f13a79 Don't use DeviceAdapter inside DataSetBuilderRectilinear.
No need to use the device adapter, just do a manual host side copy.
2016-01-19 15:43:49 -05:00
Robert Maynard
8973ca8f08 Merge topic 'simplify-vectorize-pragma-logic'
86bb45b9 Simplify the ifdef conditions used for vector pragma definitions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !310
2016-01-19 14:59:27 -05:00
Robert Maynard
4153c2c786 Found a few more places where we don't need to return by value. 2016-01-19 10:54:37 -05:00
Robert Maynard
dd85fc1366 Document why we certain classes member variables need to be const ref. 2016-01-19 09:29:55 -05:00
Robert Maynard
6fb86da8f9 DynamicArrayHandle Casting methods now holds by const * const.
This is to make it more clear to developers that the handle is a
reference that could be NULL.
2016-01-19 09:29:55 -05: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
8cf9b979c7 Don't use DeviceAdapter inside DataSetBuilderExplicit.
No need to use the device adapter, just do a manual host side copy.
2016-01-19 08:56:50 -05:00
Kenneth Moreland
c62937d612 Fix warning about uninitialized value. 2016-01-18 15:58:07 -07:00
Kenneth Moreland
ed43dad6ca Simplify and unify cast interface.
Previously, DynamicArrayHandle and DynamicCellSet had slightly different
interfaces to their CastTo feature. It was a bit confusing and not all
that easy to use.

This change simplifies and unifies them by making each class have a single
CopyTo method that takes a reference to a cast object (an ArrayHandle or
CellSet, respectively) and fills that object with the data contained if
the cast is successfull. This interface gets around having to declare
strange types.

Each object also has a Cast method that has to have a template parameter
specified and returns a reference of that type (if possible).

In addition, the old behavior is preserved for DynamicArrayHandle (but
not DynamicCellSet). To avoid confusion, the name of that cast method is
CastToTypeStorage. However, the method was chaned to not take parameters
to make it consistent with the other Cast method.

Also, the IsType methods have been modified to reflect changes in
cast/copy. IsType now no longer takes arguments. However, an alternate
IsSameType does the same thing but does take an argument.
2016-01-18 15:58:04 -07:00
Kenneth Moreland
92d2ad6a72 Consolidate dynamic_cast calls.
Previously in DynamicArrayHandle the dynamic_cast was contained in a
method that was reimplemented for every different instance of
DynamicArrayHandleBase. Change that to put the dynamic_cast in a
function outside of the class so that there is only one implementation
created per ArrayHandle type.

Similarly, DynamicCellSet had its dynamic_cast in a method plus there
was a second version in the functors used for the CastAndCall method.
Consolidate all of these into a function outside of either much like
DynamicArrayHandle.
2016-01-18 15:55:02 -07:00
Robert Maynard
61ed34e154 Merge topic 'remove_fill_via_copy'
4bb3cce0 Use the DataSetBuilderExplicitIterative helper where it is useful.
eba2fb49 Fixed some warnings in the DataSetBuilder code.
dd312516 Fix issue found be moving over to  DataSetBuilderExplicit.
e7456fa1 Update vtkm tests and examples to use DataSetBuilders.
449c425a Allow DataSetBuilderExplicit to create CellSetSingleType.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !318
2016-01-18 17:17:40 -05:00
Robert Maynard
4bb3cce016 Use the DataSetBuilderExplicitIterative helper where it is useful. 2016-01-18 16:19:48 -05:00
Robert Maynard
eba2fb493f Fixed some warnings in the DataSetBuilder code. 2016-01-18 15:04:18 -05:00
Robert Maynard
dd312516f6 Fix issue found be moving over to DataSetBuilderExplicit.
Mainly issue dealing with dimensionality of cell sets and what that represents.
Have added in code to allow user to specify a custom dimensionality so that
tests continue to work properly.
2016-01-15 16:16:38 -05:00
Robert Maynard
e7456fa120 Update vtkm tests and examples to use DataSetBuilders. 2016-01-15 15:44:56 -05:00
Robert Maynard
449c425a23 Allow DataSetBuilderExplicit to create CellSetSingleType.
If you have only a single cell shape, you can now efficiently create
a vtkm::cont::DataSet whose CellSet is vtkm::cont::CellSetSingleType.
2016-01-15 15:06:09 -05:00
Robert Maynard
9da2c081a6 Merge topic 'reduce_placeholder_name_length'
c8551cb7 Reduce the name length on Args<1>, etc to help reduce symbol size.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !312
2016-01-15 10:12:10 -05:00
Robert Maynard
c8551cb758 Reduce the name length on Args<1>, etc to help reduce symbol size. 2016-01-15 08:32:50 -05:00
Robert Maynard
e39c7819aa Merge topic 'more_worklets_not_templated_on_deviceadapter'
956cedfd Turn off the benchmarking ExternalsFaces.
18b866d6 Threshold worklet is not templated on device adapter.
dbee9275 ExternalFaces worklet is not templated on device adapter.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !315
2016-01-15 08:25:18 -05:00
Kenneth Moreland
f71b59e733 Merge branch 'cuda-timer-bug' into 'master'
Synchronize the CUDA timer on both the start and end events

Previously, the timer for CUDA devices only called cudaEventSynchronize
at the end event when asking for the elapsed time. This, however, could
allow time to pass from when the timer was reset to when the start event
happened that was not recorded in the timer. This added synchronization
should make sure that all time spent in CUDA is recorded.

See merge request !291
2016-01-14 18:22:08 -05:00
Kenneth Moreland
1d1334e2ea Merge branch 'dataset-builder-fixes' into 'master'
DataSetBuilder fixes

There were some compiler warnings and testing issues with the
recently merged DataSetBuilder branch. This fixes some of
those problems.

See merge request !316
2016-01-14 18:03:40 -05:00
Kenneth Moreland
0b2823ba55 Make UnitTestArrayHandleCartesianProduct faster
Reduce the number of conditions UnitTestArrayHandleCartesianProduct
tries so that it is faster. All the conditions are pretty similar, so it
should be OK to reduce some.
2016-01-14 15:22:33 -07:00
Kenneth Moreland
427f3cf57d Make Rectilinear and Regular builder tests faster
Previously UnitTestDataSetBuilderRectilinear and
UnitTestDataSetBuilderRegular did an exhaustive test of all possible
grid sizes within a certain amount of dimensions and with some number of
ways to build point arrays. This created hundreds of thousands of cases
that were checked, and it was running a long time. At best it wasted
time and at worst ctest reported the test as timed out.

It is not really necessary to perform an exhaustive test. The tests are
changed to do 10 trials using random values for dimensions and fill
methods.
2016-01-14 15:15:19 -07:00
Robert Maynard
f4d2b63fcb Merge topic 'vertex_clustering_not_templated_on_device'
12ddcfdd VertexClustering worklet is not templated on device adapter.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !314
2016-01-14 16:15:10 -05:00
Kenneth Moreland
e0184e6648 Fixed warnings about sign conversion. 2016-01-14 14:01:28 -07:00
Robert Maynard
956cedfd17 Turn off the benchmarking ExternalsFaces. 2016-01-14 15:56:10 -05:00
Robert Maynard
18b866d6e0 Threshold worklet is not templated on device adapter.
This should help reduce the amount of code generation, when building the
Threshold worklet for all device adapters.
2016-01-14 15:55:22 -05:00
Robert Maynard
dbee92752e ExternalFaces worklet is not templated on device adapter.
This should help reduce the amount of code generation, when building the
ExternalFaces worklet for all device adapters.
2016-01-14 15:55:12 -05:00
Robert Maynard
12ddcfdda7 VertexClustering worklet is not templated on device adapter.
This should help reduce the amount of code generation, when building the
VertexClustering worklet for all device adapters.
2016-01-14 15:42:27 -05:00
Dave Pugmire
a5972e6a15 Merge topic 'dataset-builder2'
f86382f0 Fix support for CoordinateSystems using ArrayHandleCartesianProduct.
d6a2a142 Add toleranced compare for values. Add tests for vtkm::Float32,Float64,Id typed arrays.
5d438353 Add toleranced comparisions for bounds validation. Also, add vtkm::Float32 and vtkm::Float64 to the testing for rectilinear and regular datasets.
b225ae97 Rectilinear coordinates (created with DataSetBuilderRectilinear) are now converted to vtkm::FloatDefault. This reduces the number of types to consider when casting inside CoordinateSystem, and was felt by all to be a reasonable restriction.
d755e43d Use ArrayHandleCompositeVector to represent separated point arrays for DataSetBuilderExplicit.h.
c7b0ffb8 Add tests for DataSetBuilderExplicit. Added cont/testing/ExplicitTestData.h which includes several explicit datasets.  These datasets come from VTK data generated in VisIt.  The new unit tests build datasets in several different ways and do some basic validation.
b4d04fff Add specialization of printSummary_ArrayHandle for UInt8. It prints them as characters, which are a little hard to understand to this computer scientist.
bd929c20 Fix compiler warnings.
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !262
2016-01-14 14:57:02 -05:00
Robert Maynard
10d59c176b StructuredPointsReader supports multiple visit fields. 2016-01-14 13:10:24 -05:00
Robert Maynard
735462f891 Update the io readers to handle visit style structured points files. 2016-01-14 10:13:24 -05:00
Robert Maynard
719ee34a60 Merge topic 'dynamic_cell_set_use_default'
4e94617f Make DynamicCellSet use VTKM_DEFAULT_CELL_SET_LIST_TAG.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !309
2016-01-14 08:37:36 -05:00
Robert Maynard
020975930c Merge topic 'generalize-marchingcubes-input'
15e1f80d Generalize MarchingCubes input with additional template parameters.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !304
2016-01-13 13:49:13 -05:00
Robert Maynard
ede404191e Merge topic 'better_compiler_detection'
f5f9939f Update all of vtkm to understand it can only identify as one compiler.
c706c826 Configure.h can only state a machine is a one compiler.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !307
2016-01-13 13:49:07 -05:00
Chuck Atkins
86bb45b9ad Simplify the ifdef conditions used for vector pragma definitions 2016-01-13 12:48:03 -05:00
Robert Maynard
a06becd241 Merge topic 'use_vectorization_helpers_everywhere'
b8e5923a FunctorsTBB now uses VTKM_VECTORIZATION_X macros everywhere.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Chuck Atkins <chuck.atkins@kitware.com>
Merge-request: !306
2016-01-13 12:13:34 -05:00
Robert Maynard
4e94617f89 Make DynamicCellSet use VTKM_DEFAULT_CELL_SET_LIST_TAG.
It was previously using vtkm::cont::CellSetListTagCommon which would
break the ability for people to specify a custom value for
VTKM_DEFAULT_CELL_SET_LIST_TAG.
2016-01-13 11:05:58 -05:00
Kenneth Moreland
3f446ad261 Add ErrorControlCuda for better CUDA error checking.
Add lots of checks to CUDA calls in the timer to try to identify any
problems that might be showing up on the dashboard.

Also adding some print statements around the sleep function in the
device adapter testing. For some reason the problem just went away with
them.
2016-01-12 15:19:54 -07:00
Kenneth Moreland
f582729803 Synchronize the CUDA timer on both the start and end events
Previously, the timer for CUDA devices only called cudaEventSynchronize
at the end event when asking for the elapsed time. This, however, could
allow time to pass from when the timer was reset to when the start event
happened that was not recorded in the timer. This added synchronization
should make sure that all time spent in CUDA is recorded.
2016-01-12 15:13:56 -07:00
Chuck Atkins
ccdb7bb6cf Fix incorrect vectorization pragma for GCC 2016-01-12 11:10:20 -05:00
Robert Maynard
f5f9939f26 Update all of vtkm to understand it can only identify as one compiler. 2016-01-12 11:05:40 -05:00
Robert Maynard
c706c8269b Configure.h can only state a machine is a one compiler.
It used to be possible for vtk-m to say it was multiple compilers, for example
it could be both GCC and PGI, Clang and MSVC ( yes possible ), or Intel and
Clang.

This logical restructure now makes that impossible, and instead prefers a system
where we choose the most specialized version of the compiler over the most
general, where general is GCC / Clang.
2016-01-12 11:05:40 -05:00
Robert Maynard
b8e5923ae1 FunctorsTBB now uses VTKM_VECTORIZATION_X macros everywhere. 2016-01-12 08:43:06 -05:00
Chuck Atkins
9e9e3caf3c Fix a misplaced '\' for GCC pragmas in Configure.h.in 2016-01-11 14:52:41 -05:00
T.J. Corona
15e1f80ddd Generalize MarchingCubes input with additional template parameters. 2016-01-08 14:56:10 -05:00
Robert Maynard
360694b54c Merge topic 'reset_type_and_storage_in_single_call'
b70a000a Allow resetting the Type and Storage of a DynamicArrayHandle in a single call.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !302
2016-01-08 12:25:39 -05:00
Robert Maynard
34ad520987 Merge topic 'marching_cubes_normal_generation_option'
82a573f7 MarchingCubes is now able to not generate normals.
502e7c28 Merge branch 'cleanup_scatter_counting_uses' into marching_cubes_normal_generation_option
8079dc28 MarchingCubes generate step now requires a ScatterCounting object.
4cd2f582 Add a default constructor for ScatterCounting.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !300
2016-01-08 11:50:10 -05:00
Robert Maynard
b70a000ac0 Allow resetting the Type and Storage of a DynamicArrayHandle in a single call.
vtkm::filter has the use case where we need to reset both the type and
storage of an array handle, by doing both at the same time we can reduce
the number of temporary objects, and invalid conversions of arrays.
2016-01-08 11:47:59 -05:00
Robert Maynard
82a573f712 MarchingCubes is now able to not generate normals. 2016-01-08 10:42:49 -05:00
Kenneth Moreland
23c3cd3020 Add PointCount to WorkletMapPointToCell.
WorkletMapPointToCell is a convenience subclass of WorkletMapTopology.
As such, it renames all the From/To signature tags to say Point/Cell to
be easier to read. However, the alias for FromCount was missing. Add the
alias PointCount.
2016-01-07 15:26:29 -07:00
dpugmire
f86382f0a9 Fix support for CoordinateSystems using ArrayHandleCartesianProduct. 2016-01-07 14:17:23 -05:00
dpugmire
d6a2a14271 Add toleranced compare for values.
Add tests for vtkm::Float32,Float64,Id typed arrays.
2016-01-07 11:04:38 -05:00
dpugmire
5d438353d7 Add toleranced comparisions for bounds validation.
Also, add vtkm::Float32 and vtkm::Float64 to the testing for rectilinear and regular datasets.
2016-01-07 10:52:31 -05:00
dpugmire
b225ae97a2 Rectilinear coordinates (created with DataSetBuilderRectilinear) are now converted to vtkm::FloatDefault.
This reduces the number of types to consider when casting inside CoordinateSystem, and was felt by all to be a reasonable restriction.
2016-01-07 10:23:52 -05:00
dpugmire
d755e43dec Use ArrayHandleCompositeVector to represent separated point arrays for DataSetBuilderExplicit.h. 2016-01-06 13:47:34 -05:00
dpugmire
c7b0ffb8a3 Add tests for DataSetBuilderExplicit.
Added cont/testing/ExplicitTestData.h which includes several explicit datasets.  These datasets come from VTK data generated in VisIt.  The new unit tests build datasets in several different ways and do some basic validation.

Add some new methods for DataSetFieldAdd class to improve usability.
2016-01-05 16:28:57 -05:00
dpugmire
b4d04fffe9 Add specialization of printSummary_ArrayHandle for UInt8. It prints them as characters, which are a little hard to understand to this computer scientist. 2016-01-05 14:41:19 -05:00
Robert Maynard
a6088807c0 Merge topic 'correct_tbb_sort_by_key'
c7756c78 TBB SortByKey works now when the key is a ArrayHandleZip.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !301
2016-01-05 10:40:33 -05:00
Robert Maynard
a0d86165aa Merge topic 'restrict_output_types_on_marching_cubes'
30ac46f2 We know the exact FieldOutCell types for MarchingCubes, so restrict it.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !299
2016-01-05 10:40:06 -05:00
Robert Maynard
5500bae951 Merge topic 'allow_empty_field_construction'
c2ba8baf Allow vtkm::cont::Field to have a default constructor.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !297
2016-01-05 10:39:36 -05:00
Robert Maynard
c7756c78bb TBB SortByKey works now when the key is a ArrayHandleZip.
The issue was that the temporary index array storage container
was the same as the input ArrayHandleZip which is not correct.
2016-01-04 16:55:47 -05:00
Robert Maynard
502e7c28f2 Merge branch 'cleanup_scatter_counting_uses' into marching_cubes_normal_generation_option 2016-01-04 16:52:46 -05:00
Robert Maynard
30ac46f20e We know the exact FieldOutCell types for MarchingCubes, so restrict it.
By restricting the types explicitly in the ControlSignature we reduce
the code bloat, if we ever pass in a DynamicArrayHandle as one of those
parameters.
2016-01-04 16:43:28 -05:00
Robert Maynard
8079dc28f0 MarchingCubes generate step now requires a ScatterCounting object.
Instead of having the generate step templated on the device adapter and
the counting handle, we take in a fully constructed scatter counting object.
2016-01-04 16:38:11 -05:00
Robert Maynard
4cd2f582f4 Add a default constructor for ScatterCounting.
Without a default constructor for ScatterCounting any class that wants
to hold onto a ScatterCounting object is required to know what device
they are running on. By allowing default construction, we can move that
requirement to just have a method on the object require a device adapter
object.
2016-01-04 16:00:29 -05:00
Robert Maynard
c2ba8baf7c Allow vtkm::cont::Field to have a default constructor.
When designing vtkm::filter we needed the ability to construct invalid Fields.
This now allows us to do exactly that.
2016-01-04 15:40:37 -05:00
Kenneth Moreland
e874b52f18 Support control array portals in composite vector.
Previously, the ArrayHandleCompositeVector had a separate implementation
of ArrayPortal for the control and execution environments. Because I was
lazy when I implemented it, the control version did not support Get.

Since originally implementing this class, VTK-m now allows defining
methods that are declared as working in both control and execution
environments (VTKM_EXEC_CONT_EXPORT) but only work in one or the other
depending on methods of templated subclasses they call. Thus, solve this
problem by simply removing the control version of the portal and use the
same portal for both.
2016-01-04 12:53:56 -07:00
dpugmire
bd929c207b Fix compiler warnings. 2016-01-04 14:45:39 -05:00
dpugmire
0372acbe4f Fix compiler warnings. 2016-01-04 14:45:27 -05:00
Robert Maynard
b93658b403 Merge topic 'correct_serial_sort_by_key'
c9751b0d Serial SortByKey works now when the key is a ArrayHandleZip.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !295
2015-12-31 15:13:17 -05:00
Robert Maynard
c9751b0d40 Serial SortByKey works now when the key is a ArrayHandleZip.
The issue was that the temporary index array storage container
was the same as the input ArrayHandleZip which is not correct.
2015-12-31 14:45:18 -05:00
dpugmire
fe1ab945a2 This commit has several changes.
1. Additional ASSERT calls to validate arguments in: DataSetBuilderRegular
2. Fix some untested compile errors in DataSetBuilderRectilinear
3. Added a new unit test, cont/testing/UnitTestDataSetBuilderRectilinear.cxx
4. Provided additional tests for UnitTestDataSetBuilderRegular.cxx.
The new tests in (4) were also included in (3), and provide a much more robust way of validating datasets created. It has nested for loops to do an all-all test on various ways to specify the X,Y, and Z coordinates.  It computes the bounds on the coordinate system and make sure they are correct.
Note: The GetBounds() call for Rectilinear is not working, and is an item for future discussion. It is disabled for now.
2015-12-30 12:34:04 -05:00
dpugmire
482341562f Add more robust testing for DataSetBuilderRegular class. Also, add options for creating rectilinear dataset from ArrayHandle. 2015-12-29 12:17:46 -05:00
dpugmire
c0d188c2da Add tests for ArrayHandleCartesianProduct. 2015-12-29 09:44:30 -05:00
Dave Pugmire
acd4dae229 Change interface to DataSetBuilderRegular::Create to better match the VTKM philosophy. Modify the MakeTestDataSet class to use the new interface. 2015-12-24 11:46:07 -05:00
Dave Pugmire
665427dbb0 Merge branch 'dataset-builder2' of gitlab.kitware.com:dpugmire/vtk-m into dataset-builder2 2015-12-24 11:21:08 -05:00
Dave Pugmire
d0934e0672 Fix a typo in mehtod name, and missing argument. 2015-12-24 11:19:51 -05:00
T.J. Corona
b17bfb2d43 Install RuntimeDeviceInformation.h. 2015-12-23 14:54:41 -05:00
dpugmire
ff96659902 Fix compile issues. Add new files to CMakeLists.txt 2015-12-22 12:41:30 -05:00
Kenneth Moreland
5fd5353194 Add GetNumberOfPoints to CellSet.
This is a pure virtual method that all CellSet subclasses must
implement. I needed to add an implementation to CellSetPermutation.
2015-12-21 17:27:54 -07:00
dpugmire
ee93ce4258 Rename iterative dataset builder to conform to class nomenclature 2015-12-16 15:39:06 -05:00
Robert Maynard
37851dbe9f Merge topic 'numeric_device_adapter_id'
c70da5fc Extend vtkm::DeviceAdapterTraits to include a unique numeric identifier.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !292
2015-12-16 13:56:33 -05:00
Robert Maynard
c70da5fc23 Extend vtkm::DeviceAdapterTraits to include a unique numeric identifier.
Previously each device adapter only had a unique string name. This was
not the best when it came to developing data structures to track the status
of a given device at runtime.

This adds in a unique numeric identifier to each device adapter. This will
allow classes to easily create bitmasks / lookup tables for the validity of
devices.
2015-12-16 11:18:52 -05:00
Kenneth Moreland
c382847a91 Merge branch 'old-gcc-pragmas' into 'master'
Fixes for older compilers

This branch fixes some issues that have occurred on older compilers
(specifically on GCC 4.4).


See merge request !290
2015-12-16 10:31:37 -05:00
Robert Maynard
f96206338f Merge topic 'enable_runtime_detection_of_cuda'
a7127f0f Adding vtkm::cont::RuntimeDeviceInformation.
7d249e89 Move DeviceAdapterTraits into vtkm::cont as they are user API.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !287
2015-12-16 08:48:24 -05:00
Robert Maynard
a7127f0fc3 Adding vtkm::cont::RuntimeDeviceInformation.
The RuntimeDeviceInformation class allows developers to check if a given
device is supported on a machine at runtime. This allows developers to properly
check for CUDA support before running any worklets.
2015-12-15 17:25:27 -05:00
Kenneth Moreland
2e8873272d Add parentheses around condition in VTKM_STATIC_ASSERT_MSG
This is necessary for older compilers.
2015-12-15 10:29:53 -07:00
Kenneth Moreland
ea69785009 Disable warning push/pop on older compilers
Older GCC compilers (earlier than 4.6) do not support the diagnostic
pragmas that push and pop the warning levels. This change just disables
the warnings we need to for third party libraries and leaves them off.
This means you might miss some legit warnings on older compilers, but
most developers use newer compilers anyway, and the push/pop should
still work there.
2015-12-14 10:54:02 -07:00
dpugmire
a975ad4a0c final cleanup of file. 2015-12-14 11:52:07 -05:00
Robert Maynard
7b7a56c664 UnitTestCellAverage now properly verifies against an explicit cell set. 2015-12-14 10:07:32 -05:00
dpugmire
611618c405 compiler warnings. 2015-12-11 16:18:11 -05:00
dpugmire
64b52248fd fix compiler warnings. 2015-12-11 13:44:30 -05:00
Matt Larsen
ef0b78b9ff Fixing explicit cell set bug 2015-12-11 13:38:37 -05:00
dpugmire
8e42e5c8dd fix warnings... 2015-12-11 09:53:06 -05:00
Robert Maynard
7d249e8996 Move DeviceAdapterTraits into vtkm::cont as they are user API.
When writing multiple backend code users of vtkm need to use the
DeviceAdapterTraits classes, so therefore we should move them to vtkm::cont
to signify this.
2015-12-11 09:52:18 -05:00
dpugmire
51c35cdd2a Fix warnings. 2015-12-11 09:41:20 -05:00
dpugmire
e674a6c80d Fix issue with PointToCell indices not being computed.
Also, mark them as valid, when valid.
2015-12-08 15:14:43 -05:00
Kenneth Moreland
763de94aca Merge branch 'whole-array-control-signature' into 'master'
WholeArray tag for ControlSignature

Add WholeArrayIn, WholeArrayInOut, and WholeArrayOut tags for ControlSignature. They tags behave similarly to using an ExecObject tag with an ExecutionWholeArray or ExecutionWholeArrayConst object. However, the WholeArray* tags can simplify some implementations in two ways. First, it allows you to specify more precisely what data is passed in. You have to pass in an ArrayHandle or else an error will occur (as opposed to be able to pass in any type of execution object). Second, this allows you to easily pass in arrays stored in DynamicArrayHandle objects. The Invoke mechanism will automatically find the appropriate static class. This cannot be done easily with ExecutionWholeArray.


See merge request !284
2015-12-07 18:24:54 -05:00
Kenneth Moreland
6f03f72b49 Use WholeArrayIn instead of ExecObject for MarchingCubes worklets
The two worklets for marching cubes use tables stored in arrays that
have random access. Previously, they arrays were passed using the
ExecObject tag in ControlSignature along with ExecutionWholeArrayConst.
This changes to using a WholeArrayIn tag and just passing the
ArrayHandle directly to the Invoke method. The end result is the same,
but the code is a bit cleaner.
2015-12-07 09:52:29 -07:00
Kenneth Moreland
2ac8456b5e Add WholeArray* ControlSignature tags
The WholeArrayIn, WholeArrayInOut, and WholeArrayOut ControlSignature
tags behave similarly to using an ExecObject tag with an
ExecutionWholeArray or ExecutionWholeArrayConst object. However, the
WholeArray* tags can simplify some implementations in two ways. First,
it allows you to specify more precisely what data is passed in. You have
to pass in an ArrayHandle or else an error will occur (as opposed to be
able to pass in any type of execution object). Second, this allows you
to easily pass in arrays stored in DynamicArrayHandle objects. The
Invoke mechanism will automatically find the appropriate static class.
This cannot be done easily with ExecutionWholeArray.
2015-12-07 09:52:29 -07: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
dpugmire
25a1e3c36f Cleanup and fix an issue in Explicit dataset testing with the initial merge. 2015-12-04 16:15:51 -05:00
Robert Maynard
03661259b8 Merge topic 'simplify_vectorization_options'
2df501c7 Suppress failure to vectorize warnings from the Intel Compiler.
68e3032b Properly detect OSX Intel Compiler as Intel not Clang.
646b3ad7 Suppress notification about failure to vectorize on release builds.
05e8f592 Disable vectorization pragma's if we detect the compiler doesn't support them.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !282
2015-12-04 11:00:41 -05:00
T.J. Corona
baa73eaad8 Merge topic 'marching-cubes'
33b0d1bf Move marching cubes edge table out of the worklet.
a5ae4127 Remove IsosurfaceUniformGrid.
35355382 Generalize IsosurfaceUniformGrid to Accept explicit cell sets.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !272
2015-12-03 14:54:02 -05:00
Robert Maynard
68e3032b4e Properly detect OSX Intel Compiler as Intel not Clang. 2015-12-03 14:41:07 -05:00
Robert Maynard
05e8f592cd Disable vectorization pragma's if we detect the compiler doesn't support them. 2015-12-03 13:44:52 -05:00
T.J. Corona
33b0d1bfd7 Move marching cubes edge table out of the worklet. 2015-12-02 15:33:52 -05:00
T.J. Corona
a5ae4127e0 Remove IsosurfaceUniformGrid. 2015-12-02 15:11:56 -05:00
dpugmire
ab268c2c18 Fix some compile errors introduced in the merge. 2015-12-02 13:55:37 -05:00
Robert Maynard
6e62b9626a Merge topic 'simplify_vectorization_options'
bfb6c26a Simplify the design of vectorization support.
4ea567ae Remove VTKm_ENABLE_VECTORIZATION, as VTKm_Vectorization handles all use cases.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !277
2015-12-02 08:15:52 -05:00
dpugmire
62bd2394b0 Add support for rectilinear coordinates via ArrayHandleCartesianProduct.
It consists of 3 ArrayHandles, and handles indexing to give each point in the grid.
Added some examples to the test dataset class, and a basic test.
2015-12-01 17:24:56 -05:00
Dave Pugmire
11d59c74b6 Add iterative explicit dataset builder class. 2015-12-01 17:24:56 -05:00
Dave Pugmire
29e4f06691 remove explicitdataset1, which was identical to dataset0. 2015-12-01 17:24:52 -05:00
Dave Pugmire
7dfa1009dc Add dataset builder classes. 2015-12-01 17:22:47 -05:00
Robert Maynard
bfb6c26a98 Simplify the design of vectorization support.
Remove the configured file variables, as that causes problems
when using an installed version of VTK-m.
2015-12-01 11:37:41 -05:00
Kenneth Moreland
a598f03fbb Fix initialization order of fields in MakeStreamLines class
When a C++ object is constructed, the fields (ivars) of that object are
initialized in the order they are declared in the structure regardless
of the order of initializers listed in the constructor. Thus, it is good
C++ convention to list the initializers of the constructor in the same
order they are declared in the class so that there is no confusion about
the order of initialization (which can matter if there are any
dependencies). To help enforce this convention, some compilers warn if
the order does not match. This commit fixes that issue.

This commit also removes trailing whitespace at the end of some lines in
StreamLineUniformGrid.h. My editor does this automatically because
trailing whitespace bugs some programmers.
2015-11-30 14:20:00 -07:00
Robert Maynard
c06c54b1fb Merge topic 'enable_vectorization'
4ceb111a Enable vectorization inside the Serial and TBB backends.
514ea09a Teach VTK-m how to enable vectorization for gcc, clang, and icc.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !275
2015-11-27 09:36:15 -05:00
Robert Maynard
4ceb111a68 Enable vectorization inside the Serial and TBB backends. 2015-11-25 15:59:13 -05:00
Sujin Philip
9c31290619 Merge topic 'io-reader-unsupported-cells'
066e1bf3 Convert unsupported cell types to supported types

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !273
2015-11-24 15:29:58 -05:00
Sujin Philip
066e1bf3b1 Convert unsupported cell types to supported types 2015-11-24 13:56:23 -05:00
Patricia Kroll Fasel - 090207
6c4fb856df Add example data file for streamline. 2015-11-23 17:00:22 -07:00
Patricia Kroll Fasel - 090207
cba0e218d8 Verify unit test results 2015-11-23 16:46:23 -07:00
Patricia Kroll Fasel - 090207
3946b0c462 Add unit test, pass all args in Run() 2015-11-23 16:19:26 -07:00
Patricia Kroll Fasel - 090207
02f84a1992 StreamLine filter outputs dataset. Add example. 2015-11-23 12:54:12 -07:00
Robert Maynard
514ea09afc Teach VTK-m how to enable vectorization for gcc, clang, and icc. 2015-11-23 12:44:05 -05:00
T.J. Corona
353553829d Generalize IsosurfaceUniformGrid to Accept explicit cell sets. 2015-11-20 12:38:03 -05:00
Patricia Kroll Fasel - 090207
e34aaa02ea Merge branch 'master' of gitlab.kitware.com:Fasel/vtk-m into streamline 2015-11-12 16:08:44 -07:00
Patricia Kroll Fasel - 090207
82d9c10206 Pass input and output datasets and not arrays. Support FORWARD, BACKWARD and BOTH. 2015-11-12 15:35:46 -07:00
Sujin Philip
c6a562aeba Fix for MSVC conversion warning 2015-11-12 10:29:30 -05:00
Sujin Philip
503f9197fd Fix VTK DataSet IO to work correctly with DynamicArrayHandle 2015-11-12 10:28:22 -05:00
Sujin Philip
2b771418e6 Update Clip worklets to work with more types 2015-11-12 10:28:22 -05:00
T.J. Corona
9414120b6a Replace ArrayHandleCastForInput with the more versatile ArrayHandleCast. 2015-11-11 17:13:04 -05:00
Kenneth Moreland
1a538ca196 Merge branch 'scatter-worklets' into 'master'
Scatter in worklets

Add the functionality to perform a scatter operation from input to output in a worklet invocation. This allows you to, for example, specify a variable amount of outputs generated for each input.

See merge request !221
2015-11-11 13:09:47 -05:00
Kenneth Moreland
7b05604a66 Add more tolerance to UnitTestParametricCoordinates
I noticed a failure in a dashboard run of UnitTestParametricCoordinates.
This test uses randomly generated numbers to test the behavior of some
cell shapes, and there was an instance that occured with seed 1447261681
that caused one of the comparisons to be just slightly larger than the
default tolerance but still within reasonable value.

I just increased the tolerance of that particular comparison. Hopefully
this will prevent all future failures.
2015-11-11 10:38:17 -07:00