Skip to content
This repository has been archived by the owner on Jul 14, 2022. It is now read-only.

Commit

Permalink
Vtkm pointer (#210)
Browse files Browse the repository at this point in the history
* do the new way of vtkm pointers

* get rid of depracated calls
  • Loading branch information
mclarsen authored May 7, 2021
1 parent deed78e commit 3449e5d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
7 changes: 2 additions & 5 deletions src/vtkh/filters/HistSampling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <vtkm/worklet/DispatcherMapField.h>
#include <vtkm/worklet/WorkletMapField.h>

#include <vtkm/cont/DataSetFieldAdd.h>
#include <vtkm/worklet/FieldStatistics.h>
#include <vtkm/filter/CreateResult.h>
#include <vtkm/cont/ArrayHandleTransform.h>
Expand Down Expand Up @@ -341,15 +340,13 @@ void HistSampling::DoExecute()
vtkm::cont::ArrayHandle <vtkm::Float32> output;
vtkm::cont::Algorithm ::Copy(stencilBool , output );

vtkm::cont:: DataSetFieldAdd dataSetFieldAdd;

if(assoc == vtkm::cont::Field::Association::POINTS)
{
dataSetFieldAdd.AddPointField(dom , "valSampled", output );
dom.AddPointField("valSampled", output);
}
else
{
dataSetFieldAdd.AddCellField(dom , "valSampled", output );
dom.AddCellField("valSampled", output);
}
}

Expand Down
7 changes: 1 addition & 6 deletions src/vtkh/utils/vtkm_array_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,14 @@
#define VTKH_VTKM_ARRAY_UTILS_HPP

#include <vtkm/cont/ArrayHandle.h>
#include <vtkm/cont/serial/internal/DeviceAdapterTagSerial.h>

namespace vtkh {

template<typename T>
T *
GetVTKMPointer(vtkm::cont::ArrayHandle<T> &handle)
{
typedef typename vtkm::cont::ArrayHandle<T> HandleType;
typedef typename HandleType::template ExecutionTypes<vtkm::cont::DeviceAdapterTagSerial>::Portal PortalType;
typedef typename vtkm::cont::ArrayPortalToIterators<PortalType>::IteratorType IteratorType;
IteratorType iter = vtkm::cont::ArrayPortalToIterators<PortalType>(handle.WritePortal()).GetBegin();
return &(*iter);
return handle.WritePortal().GetArray();
}

}//namespace vtkh
Expand Down

0 comments on commit 3449e5d

Please sign in to comment.