mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-16 17:22:55 +00:00
Compile IO library without device compiler
This commit is contained in:
parent
9b017f4f95
commit
245fc3a983
@ -49,19 +49,15 @@ set(sources
|
||||
ImageWriterPNG.cxx
|
||||
ImageWriterPNM.cxx
|
||||
VTKDataSetReader.cxx
|
||||
VTKDataSetReaderBase.cxx
|
||||
VTKDataSetWriter.cxx
|
||||
VTKPolyDataReader.cxx
|
||||
VTKRectilinearGridReader.cxx
|
||||
VTKStructuredGridReader.cxx
|
||||
VTKStructuredPointsReader.cxx
|
||||
VTKUnstructuredGridReader.cxx
|
||||
)
|
||||
|
||||
# These files use ArrayCopy which uses a WorkletMapField thus are required to be device_sources
|
||||
set(device_sources
|
||||
VTKDataSetReaderBase.cxx
|
||||
VTKRectilinearGridReader.cxx
|
||||
)
|
||||
|
||||
if (VTKm_ENABLE_HDF5_IO)
|
||||
set(headers
|
||||
${headers}
|
||||
|
@ -297,9 +297,16 @@ void VTKDataSetReaderBase::ReadCells(vtkm::cont::ArrayHandle<vtkm::Id>& connecti
|
||||
offsets.CastAndCallForTypes<vtkm::List<vtkm::Int64, vtkm::Int32>,
|
||||
vtkm::List<vtkm::cont::StorageTagBasic>>(
|
||||
[&](const auto& offsetsAH) {
|
||||
vtkm::cont::ArrayCopy(vtkm::cont::make_ArrayHandleOffsetsToNumComponents(
|
||||
vtkm::cont::make_ArrayHandleCast(offsetsAH, vtkm::Id{})),
|
||||
numIndices);
|
||||
// Convert on host. There will be several other passes of this array on the host anyway.
|
||||
numIndices.Allocate(offsetsSize - 1);
|
||||
auto offsetPortal = offsetsAH.ReadPortal();
|
||||
auto numIndicesPortal = numIndices.WritePortal();
|
||||
for (vtkm::Id cellIndex = 0; cellIndex < offsetsSize - 1; ++cellIndex)
|
||||
{
|
||||
numIndicesPortal.Set(cellIndex,
|
||||
static_cast<vtkm::IdComponent>(offsetPortal.Get(cellIndex + 1) -
|
||||
offsetPortal.Get(cellIndex)));
|
||||
}
|
||||
});
|
||||
|
||||
this->DataFile->Stream >> tag >> dataType >> std::ws;
|
||||
|
Loading…
Reference in New Issue
Block a user