vtk-m/docs/changelog
Kenneth Moreland d1a4aecc59 Improvements to moving data into ArrayHandle
We have made several improvements to adding data into an `ArrayHandle`.

## Moving data from an `std::vector`

For numerous reasons, it is convenient to define data in a `std::vector`
and then wrap that into an `ArrayHandle`. It is often the case that an
`std::vector` is filled and then becomes unused once it is converted to an
`ArrayHandle`. In this case, what we really want is to pass the data off to
the `ArrayHandle` so that the `ArrayHandle` is now managing the data and
not the `std::vector`.

C++11 has a mechanism to do this: move semantics. You can now pass
variables to functions as an "rvalue" (right-hand value). When something is
passed as an rvalue, it can pull state out of that variable and move it
somewhere else. `std::vector` implements this movement so that an rvalue
can be moved to another `std::vector` without actually copying the data.
`make_ArrayHandle` now also takes advantage of this feature to move rvalue
`std::vector`s.

There is a special form of `make_ArrayHandle` named `make_ArrayHandleMove`
that takes an rvalue. There is also a special overload of
`make_ArrayHandle` itself that handles an rvalue `vector`. (However, using
the explicit move version is better if you want to make sure the data is
actually moved.)

## Make `ArrayHandle` from initalizer list

A common use case for using `std::vector` (particularly in our unit tests)
is to quickly add an initalizer list into an `ArrayHandle`. Now you can
by simply passing an initializer list to `make_ArrayHandle`.

## Deprecated `make_ArrayHandle` with default shallow copy

For historical reasons, passing an `std::vector` or a pointer to
`make_ArrayHandle` does a shallow copy (i.e. `CopyFlag` defaults to `Off`).
Although more efficient, this mode is inherintly unsafe, and making it the
default is asking for trouble.

To combat this, calling `make_ArrayHandle` without a copy flag is
deprecated. In this way, if you wish to do the faster but more unsafe
creation of an `ArrayHandle` you should explicitly express that.

This requried quite a few changes through the VTK-m source (particularly in
the tests).

## Similar changes to `Field`

`vtkm::cont::Field` has a `make_Field` helper function that is similar to
`make_ArrayHandle`. It also features the ability to create fields from
`std::vector`s and C arrays. It also likewise had the same unsafe behavior
by default of not copying from the source of the arrays.

That behavior has similarly been depreciated. You now have to specify a
copy flag.

The ability to construct a `Field` from an initializer list of values has
also been added.
2020-07-23 10:53:38 -06:00
..
1.3 docs: update gitlab links to include /-/ component 2020-05-26 14:48:49 -04:00
1.4 Add release notes for v1.4.0 2019-06-26 12:13:47 -04:00
1.5 Add release notes for v1.5.0 2019-10-15 13:40:46 -04:00
array_handle_uniform_random.md Added changelog 2020-06-03 10:15:00 -06:00
arrayhandlegroupvecvariable.md ConvertNumComponentsToOffsets using ScanExtented vs. ScanExclusive 2020-03-05 10:57:34 -05:00
binary_search_algorithms.md Add vtkm/Algorithms.h header with device-friendly binary search algorithms. 2019-12-20 12:35:10 -05:00
buffer.md Replace basic ArrayHandle implementation to use Buffers 2020-06-25 14:02:26 -06:00
ci-script.md Add scripts to allow developers to replicate CI environments 2020-04-09 13:54:20 -04:00
configurable-default-types.md Enable changing policy used for library compiles 2020-03-19 15:07:07 -06:00
coordinate-transform-results.md Update changelogs 2020-05-19 10:37:36 -06:00
cuda-no-assert.md Disable asserts for CUDA architecture builds 2020-06-22 13:54:22 -06:00
custom_portal_iterators.md Fixup custom portal iterator logic. 2019-12-17 15:39:51 -05:00
dataset-unique-field-names.md Update changelogs 2020-05-19 10:37:36 -06:00
decorator_resizing.md Add support for ArrayHandleDecorator resizing. 2019-12-20 17:03:36 -05:00
deprecate-arrayhandlevirtualcoordinates.md Deprecate ArrayHandleVirtualCoordinates 2020-07-14 08:51:47 -06:00
deprecate-dataset-field-add.md Add newline to docs file. 2020-05-27 16:29:20 -04:00
deprecate-execute-with-policy.md Deprecate Execute with policy 2020-05-18 12:38:41 -06:00
deprecation.md Refactor deprecated macros 2019-11-06 14:47:59 -07:00
filter-specifies-own-field-types.md Update changelogs 2020-05-19 10:37:36 -06:00
flying-edges.md Update changelogs 2020-05-19 10:37:36 -06:00
google_benchmark.md Port benchmarking framework to Google Benchmark. 2020-01-08 10:58:51 -05:00
image_io.md Implement and test ImageReader and ImageWriter capabilities in the io library 2020-05-13 16:10:21 -06:00
io_reorganize.md Do not add half-baked 1.6 release notes; let Robert consolidate release notes. 2020-05-01 07:31:35 -04:00
list-tag-remove-if.md Add changelog for ListTagRemoveIf 2019-11-02 11:08:34 -06:00
list.md Add List changelog 2019-12-04 17:21:32 -07:00
mask_and_scatters_3d_scheduling.md Add changelog for mask and scatter 3d scheduling support 2020-02-27 08:25:54 -05:00
move-std-vector.md Improvements to moving data into ArrayHandle 2020-07-23 10:53:38 -06:00
no-cell-op-errors.md Update changelogs 2020-05-19 10:37:36 -06:00
ordered-async-access.md Add proper enqueuing of Tokens for ArrayHandle 2020-06-08 16:49:02 -06:00
probe-sets-invalid-value.md Enable setting invalid value in probe filter 2020-06-03 15:29:37 -06:00
readportalget.md ReadPortal().Get(idx) is slow in a loop. 2020-05-08 11:30:59 -04:00
remove-opengl-rendering-classes.md Update changelogs 2020-05-19 10:37:36 -06:00
scoping-tokens.md Remove locking control ArrayPortals 2020-03-16 07:10:10 -06:00
shorter-fancy-array-handle-classnames.md Shorter StorageTag for ArrayHandleZip 2020-01-07 07:01:34 -07:00
std_porting_headers.md Add porting layer for future std features 2020-03-16 17:12:16 -06:00
tuple.md Add changelog for Tuple 2020-03-16 17:12:17 -06:00
vtk-io-in-library.md Add BOVDataSetReader implementation to vtkm_io 2020-05-19 14:33:45 -06:00
write-uniform-rectilinear.md Write uniform and rectilinear grids to legacy VTK files 2020-07-08 19:12:14 -06:00