Commit Graph

4662 Commits

Author SHA1 Message Date
Robert Maynard
707970f492 VTK-m StorageBasic is now able to give/take ownership of user allocated memory.
This fixes the three following issues with StorageBasic.

1. Memory that was allocated by VTK-m and Stolen by the user needed the
proper free function called which is generally StorageBasicAllocator::deallocate.
But that was hard for the user to hold onto. So now we provide a function
pointer to the correct free function.

2. Memory that was allocated outside of VTK-m was impossible to transfer to
VTK-m as we didn't know how to free it. This is now resolved by allowing the
user to specify a free function to be called on release.

3. When the CUDA backend allocates memory for an ArrayHandle that has no
control representation, and the location we are running on supports concurrent
managed access we want to specify that cuda managed memory as also the host memory.
This requires that StorageBasic be able to call an arbitrary new delete function
which is chosen at runtime.
2018-04-04 11:27:57 -04:00
Robert Maynard
83b360f1ea vtkm::Lerp now casts integer types to an appropriate scalar type.
Previously types such as vtkm::Id or vtkm::U/Int32 would be cast to whatever
the weight type was. This is problematic as they should actually be casted to
a double type as the weight type could be a float and therefore the results
2018-04-04 11:00:12 -04:00
Robert Maynard
0d45c5cff2 Correct warnings found after disabling all warning when CUDA is enabled. 2018-04-04 11:00:12 -04:00
Utkarsh Ayachit
a579b2c5b0 Merge topic 'remove-result'
3da8b5be Remove `vtkm::filter::Result`
cebe6820 add `vtkm::cont::ErrorFilterExecution`
68d43a61 Demo: fix `filter::Execute` API usage.
ff94622c fix README.md based on changes to Filter API.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1136
2018-04-03 19:51:17 -04:00
Utkarsh Ayachit
3da8b5be66 Remove vtkm::filter::Result
This commit removes `vtkm::filter::Result`. All methods that used
`vtkm::filter::Result` simply change to use `vtkm::cont::Dataset` instead.
The utility API on `Result` that was used to add fields to the resulting
dataset is now available via `vtkm::filter::internal::CreateResult`.
2018-04-03 16:55:03 -04:00
Utkarsh Ayachit
cebe6820b7 add vtkm::cont::ErrorFilterExecution
Adding a new exception type `vtkm::cont::ErrorFilterExecution`. Unlike
existing exceptions, when thrown in `TryExecute`, this exception causes
the call to not attempt to execute on any other devices and let it be
thrown so that the application can catch it.
2018-04-03 16:55:03 -04:00
Utkarsh Ayachit
68d43a6156 Demo: fix filter::Execute API usage. 2018-04-03 14:36:54 -04:00
Utkarsh Ayachit
ff94622c48 fix README.md based on changes to Filter API. 2018-04-03 14:36:53 -04:00
James
9f32bbe0a7 Merge branch 'rendering-label-leak' of https://gitlab.kitware.com/jameskress/vtk-m into rendering-label-leak 2018-04-03 09:26:53 -04:00
James
7906e89ed4 Updating leak fix to use uniq_ptr. 2018-04-03 09:26:00 -04:00
Kenneth Moreland
eca65146b3 Merge topic 'simplify-field-to-colors-interface'
3a812b04 Make default ColorTable preset
3391e5d2 Basic interface changes to FieldToColors
a3b2c393 Remove default constructor for ColorTable
cb8a05c7 Add a preset enum to ColorTable
97a24559 Make LAB the default color space

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1133
2018-04-02 18:24:05 -04:00
Kenneth Moreland
3a812b044e Make default ColorTable preset
Changed the "default" ColorTable preset from "cool to warm" to
"viridis." Also made a default constructor for ColorTable that sets it
to this default preset.

The main reason to change to viridis for the default is that it is in
LAB space. We are concerned that having the default ColorTable preset
being Diverging space could lead to users using that color space
inappropriately.
2018-04-02 15:32:23 -06:00
Kenneth Moreland
dcc8b8ae63 Merge topic 'template-sources-with-config'
0d2309ab Add template sources to built library

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1132
2018-04-02 16:59:59 -04:00
Utkarsh Ayachit
1cbbe2b705 Merge topic 'update-algorithm'
60a8ea67 Add `Algorithm::Transform`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1134
2018-04-02 16:22:55 -04:00
Utkarsh Ayachit
60a8ea67b4 Add Algorithm::Transform
Adding Algorithm::Transform API to match API provided by
`DeviceAdatorAlgorithm`.
2018-04-02 15:59:28 -04:00
Kenneth Moreland
3391e5d2cd Basic interface changes to FieldToColors
Provides a default constructor and the ability to set/get the color
table.
2018-04-02 11:44:18 -06:00
Kenneth Moreland
a3b2c3931d Remove default constructor for ColorTable
The problem is that there is no good "default" constructor for
ColorTable. The previous default constructor created an empty color
table, but that would be confusing if someone actually tried to use it.
We could set ot to the default preset, but the default preset uses the
diverging color map, which could foul people up if they actually want to
edit or create their own color map. Instead, force the declaration of
ColorTable to indicate what you plan to do with it.
2018-04-02 11:44:17 -06:00
Kenneth Moreland
cb8a05c71b Add a preset enum to ColorTable
You can still select presets through strings (and we leave ourselves
open to add more presets through strings than enumerating with the
enum), but this provides a way to select a preset that is verified by
the compiler.
2018-04-02 11:44:16 -06:00
Kenneth Moreland
97a245597f Make LAB the default color space
Interpolations in LAB are perceptually uniform, which generally makes it
a better choice as the color space.
2018-04-02 11:44:16 -06:00
Kenneth Moreland
0d2309aba3 Add template sources to built library
Previously there was a special build for the template source files
(.hxx) that installed them but did not create the test builds (because
they cannot be built outside of their enclosing .h file). It also added
an entry into the IDE that let them show up on the file list. However,
because they were not explicitly built as part of something actually
compiled, they did not have an compile options associated with them.
This caused confusion in some IDEs where it could not find the header
files it included, which made it more frustrating to edit them.
2018-04-02 10:11:06 -06:00
James Kress
b92c4801c8 Update CMakeLists.txt 2018-04-02 09:43:39 -04:00
James
70c50f72e5 Fixing mem leak with rendering annotations. 2018-04-02 09:38:22 -04:00
Utkarsh Ayachit
22f38ecc43 Merge topic 'fix-filter-inheritance'
a3eacce7 doc: fix typos
0f5ba79b fix warning in MakeTestDataSet
eda68a6f Make `MapFieldOntoOutput` private API.
dc474eb4 fix `Derived` type propagation in filter inheritance.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1130
2018-04-02 09:30:34 -04:00
Utkarsh Ayachit
a3eacce786 doc: fix typos 2018-04-02 09:30:58 -04:00
Utkarsh Ayachit
0f5ba79b3f fix warning in MakeTestDataSet 2018-04-02 09:30:58 -04:00
Utkarsh Ayachit
eda68a6fec Make MapFieldOntoOutput private API.
MapFieldOntoOutput is no longer public API. Since `vtkm::cont::Filter`
invokes it when appropriate, we no longer need to keep it public.

Also removes the overload of MapFieldOntoOutput that doesn't take
policy. That is no longer needed since vtkm::cont::Filter always can
provide the current policy being used.
2018-04-02 09:30:58 -04:00
Utkarsh Ayachit
dc474eb475 fix Derived type propagation in filter inheritance.
Filter subclasses were not passing the true derived type up the
hierarchy. Fixed that.
2018-04-02 09:30:57 -04:00
James
3be8b9c597 Merge branch 'master' of https://gitlab.kitware.com/jameskress/vtk-m 2018-04-02 09:25:12 -04:00
James
12dd2be12b Updating to master 2018-04-02 09:24:50 -04:00
Utkarsh Ayachit
0b0669139d Merge topic 'decomposer-fixes'
60f4936d cleanup diy usage in MultiBlock.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1129
2018-04-02 09:24:33 -04:00
Utkarsh Ayachit
60f4936d54 cleanup diy usage in MultiBlock.
This fixes several issues with how DIY was used in MultiBlock.

Instead of using `diy::RegularSwapPartners` using
`diy::RegularMergePartners` to reduce data to block(gid=0) and then
broadcast out to all ranks (and not blocks) using
`diy::RegularBroadcastPartners`. Old code that used RegularSwapPartners
ended up building reduced result on all blocks, which was not only
unnecessary, but expensive since we would generally have more blocks
than ranks.

Remove `DecomposerMultiBlock`. This class was needed due to my
misunderstanding of how the decomposer works.
`diy::RegularDecomposer<diy::DiscreteBounds>` provides all the necessary
functionality provided by `DecomposerMultiBlock`.
2018-03-31 11:34:33 -04:00
Robert Maynard
fb1c8d88fe Merge branch 'release_v1.2.0' 2018-03-30 12:06:01 -04:00
Robert Maynard
9cb152230c Release VTK-m 1.2.0
1.2.0 is our third official release. This release is stable and should compile
across many platforms. However, note that VTK-m is still under heavy development
and each release contains backward-incompatible changes.
v1.2.0
2018-03-30 12:02:42 -04:00
Sujin Philip
96180086a1 Merge topic 'fix-example-unified_memory'
cd69e712 Fix Unified Memory example

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Utkarsh Ayachit <utkarsh.ayachit@kitware.com>
Merge-request: !1126
2018-03-30 10:43:39 -04:00
Robert Maynard
83213fcb6b Merge topic 'correct_windows_compile_issues'
82163375 Correct windows compile issues with ColorTable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1128
2018-03-30 02:19:53 -04:00
Robert Maynard
68a8a60dfa Merge topic 'add_fieldtocolor_filter'
79d922ee Add a filter that uses ColorTable to color any field from a dataset.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1124
2018-03-30 01:16:28 -04:00
Robert Maynard
9bc821bdd7 Merge topic 'correct_64bit_floatdefault_missing_symbols'
c9026870 CoordinateSystem now links with FloatDefault == 64

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1127
2018-03-30 01:16:06 -04:00
Robert Maynard
82163375f3 Correct windows compile issues with ColorTable 2018-03-30 01:14:30 -04:00
Robert Maynard
c9026870da CoordinateSystem now links with FloatDefault == 64 2018-03-30 00:07:13 -04:00
Robert Maynard
8808b41fbd Merge branch 'master' into vtk-m-cmake_refactor 2018-03-29 22:51:26 -04:00
Robert Maynard
79d922ee49 Add a filter that uses ColorTable to color any field from a dataset. 2018-03-29 22:12:30 -04:00
Kenneth Moreland
0efb1dc064 Merge topic 'color-table-length-fix'
90b925ba Fix off-by-one-overrun of color table map array

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1125
2018-03-29 19:04:48 -04:00
Sujin Philip
cd69e71247 Fix Unified Memory example
Update to use the new filter interface
2018-03-29 18:00:19 -04:00
Kenneth Moreland
90b925ba6d Fix off-by-one-overrun of color table map array
The display of a color bar in an OpenGL canvas had an array overrun.
This method first used ColorTable to create an array of colors. It then
used the array to look up values for polygons that make up the color
bar. However, each polygon used indices i and i+1, and on the last value
the i+1 looked pass the end of the array. This fixes the problem by
adding one more value to the color array generated.
2018-03-29 14:19:22 -06:00
Utkarsh Ayachit
90b91f7a3d Merge topic 'fix-shadow'
396f70ed remove shadow methods (fixes #210)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1123
2018-03-29 11:05:32 -04:00
Utkarsh Ayachit
396f70edf2 remove shadow methods (fixes #210) 2018-03-29 09:29:21 -04:00
Robert Maynard
8747f0ce9c Merge topic 'DiscretizableColorTransferFunction'
944bc3c0 Introduce vtkm::cont::ColorTable replacing vtkm::rendering::ColorTable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1103
2018-03-28 17:31:05 -04:00
Robert Maynard
944bc3c0d6 Introduce vtkm::cont::ColorTable replacing vtkm::rendering::ColorTable
The new and improved vtkm::cont::ColorTable provides a more feature complete
color table implementation that is modeled after
vtkDiscretizableColorTransferFunction. This class therefore supports different
color spaces ( rgb, lab, hsv, diverging ) and supports execution across all
device adapters.
2018-03-28 16:11:23 -04:00
luz.paz
efdf854306 Misc. Typos
Found via `codespell` and `grep`
2018-03-28 09:45:07 -04:00
Utkarsh Ayachit
428f7568c4 Merge topic 'fix-examples'
0208cd76 fix example after filters API change.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1122
2018-03-26 13:50:05 -04:00