Skip to content

WIP: Split make_ArrayHandle() into make_ArrayHandle{Copy,NoCopy}()

fixes: #395 (closed)

This MR attempts to deprecate make_ArrayHandle without its vtkm::CopyFlag parameter and adds the following two alias:

  1. make_ArrayHandleCopy
  2. make_ArrayHandleNoCopy

The rationale of this change is to explicitly indicate the relation between the arrayhandle and its data, making it safer.

It is a trivial change, however, as make_ArrayHandle is ubiquitous, the changes spans around the whole project.

To comply wit this I substituted all the calls to make_ArrayHandle in the following way:

make_ArrayHandle(vec) ->  make_ArrayHandle(vec, vtkm::CopyFlag::Off)
make_ArrayHandle(arr, len) -> make_ArrayHandle(arr, len, vtkm::CopyFlag::Off)

This in theory does not add any side effect to the existing codebase since we already default to vtkm:CopyFlag::Off

In the code belonging to the vtkm codebase, I chose the version corresponding to its passed vtkm::CopyFlag in each call .

In very few cases, I did replace make_ArrayHandle to make_ArrayHandleNoCopy as it seemed that the copy was overkill.

Edited by Vicente Bolea

Merge request reports

Loading