//============================================================================ // Copyright (c) Kitware, Inc. // All rights reserved. // See LICENSE.txt for details. // // This software is distributed WITHOUT ANY WARRANTY; without even // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // PURPOSE. See the above copyright notice for more information. //============================================================================ #include #include namespace vtkm { namespace cont { namespace detail { void ArrayCopyConcreteSrc::CopyCountingFloat( vtkm::FloatDefault start, vtkm::FloatDefault step, vtkm::Id size, const vtkm::cont::UnknownArrayHandle& result) const { if (result.IsBaseComponentType()) { auto outArray = result.ExtractComponent(0); vtkm::cont::ArrayCopyDevice(vtkm::cont::make_ArrayHandleCounting(start, step, size), outArray); } else { vtkm::cont::ArrayHandle outArray; outArray.Allocate(size); CopyCountingFloat(start, step, size, outArray); result.DeepCopyFrom(outArray); } } vtkm::cont::ArrayHandle ArrayCopyConcreteSrc::CopyCountingId( const vtkm::cont::ArrayHandleCounting& source) const { vtkm::cont::ArrayHandle destination; vtkm::cont::ArrayCopyDevice(source, destination); return destination; } } } } // namespace vtkm::cont::detail